Skip to content

Commit

Permalink
Add 4.2.29.
Browse files Browse the repository at this point in the history
  • Loading branch information
sf-tyler-jeong committed Nov 20, 2024
1 parent 451f678 commit ec21198
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 12 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## v4.2.29 (Nov 20, 2024)

### Features
- Updated the versions for `mime`, `web_socket_channel` and `flutter_lints` packages

### Improvements
- Added the filtering for `replyType` in `MessageCollection`

## v4.2.28 (Nov 15, 2024)

### Improvements
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Before installing Sendbird Chat SDK, you need to create a Sendbird application o

```yaml
dependencies:
sendbird_chat_sdk: ^4.2.28
sendbird_chat_sdk: ^4.2.29
```
- Run `flutter pub get` command in your project directory.
Expand Down
27 changes: 24 additions & 3 deletions lib/src/internal/db/schema/message/meta/c_channel_message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,6 @@ class CChannelMessage {
// [includeParentMessageInfo]
// When calling API, this value have to be `true` to make chunk.

// [replyType]
// Must call API, because this can not be queried with local cache.

// [showSubChannelMessagesOnly]
// Must call API, because this can not be queried with local cache.

Expand Down Expand Up @@ -259,6 +256,30 @@ class CChannelMessage {
}
}

//+ replyType
messages.removeWhere((message) {
if (message is BaseMessage) {
switch (params.replyType) {
case ReplyType.none:
if (message.parentMessageId != null) {
return true; // Remove
}
break;
case ReplyType.all:
break;
case ReplyType.onlyReplyToChannel:
if (message.parentMessageId != null && !message.isReplyToChannel) {
return true; // Remove
}
break;
case null:
break;
}
}
return false; // Do not remove
});
//- replyType

// reversed
if (messages.length >= 2) {
if ((isPrevious && !params.reverse) || (!isPrevious && params.reverse)) {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/internal/main/chat/chat.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ part 'chat_notifications.dart';
part 'chat_push.dart';
part 'chat_user.dart';

const sdkVersion = '4.2.28';
const sdkVersion = '4.2.29';

// Internal implementation for main class. Do not directly access this class.
class Chat with WidgetsBindingObserver {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -885,9 +885,7 @@ abstract class BaseMessageCollection {
}

// [Filter] senderIds
if (addedMessage is BaseMessage &&
params.senderIds != null &&
params.customTypes!.isNotEmpty) {
if (addedMessage is BaseMessage && params.senderIds != null) {
bool found = false;
for (final senderId in params.senderIds!) {
if (addedMessage.sender?.userId == senderId) {
Expand All @@ -901,6 +899,27 @@ abstract class BaseMessageCollection {
}
}

// [Filter] replyType
if (addedMessage is BaseMessage) {
switch (params.replyType) {
case ReplyType.none:
if (addedMessage.parentMessageId != null) {
return false;
}
break;
case ReplyType.all:
break;
case ReplyType.onlyReplyToChannel:
if (addedMessage.parentMessageId != null &&
!addedMessage.isReplyToChannel) {
return false;
}
break;
case null:
break;
}
}

return true;
}

Expand Down
8 changes: 4 additions & 4 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: sendbird_chat_sdk
description: With Sendbird Chat for Flutter, you can easily build an in-app chat with all the essential messaging features.
version: 4.2.28
version: 4.2.29
homepage: https://sendbird.com
repository: https://github.com/sendbird/sendbird-chat-sdk-flutter
documentation: https://sendbird.com/docs/chat/sdk/v4/flutter/getting-started/send-first-message
Expand All @@ -24,10 +24,10 @@ dependencies:
shared_preferences: ^2.2.2
http: '>=0.13.6 <2.0.0'
logger: '>=1.4.0 <3.0.0'
mime: ^1.0.4
mime: '>=1.0.4 <3.0.0'
connectivity_plus: '>=5.0.1 <7.0.0'
http_parser: ^4.0.2
web_socket_channel: ^2.4.0
web_socket_channel: '>=2.4.0 <4.0.0'
universal_io: ^2.2.0
async: ^2.10.0
isar: ^3.1.0+1
Expand All @@ -38,7 +38,7 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^2.0.1
flutter_lints: '>=2.0.1 <6.0.0'
test: ^1.22.0
stack_trace: ^1.11.0
json_serializable: ^6.6.2
Expand Down

0 comments on commit ec21198

Please sign in to comment.