Skip to content

Commit 8f09912

Browse files
Merge pull request #129 from sendbird/v4.2.29
Add 4.2.29.
2 parents 451f678 + ec21198 commit 8f09912

File tree

6 files changed

+60
-12
lines changed

6 files changed

+60
-12
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## v4.2.29 (Nov 20, 2024)
2+
3+
### Features
4+
- Updated the versions for `mime`, `web_socket_channel` and `flutter_lints` packages
5+
6+
### Improvements
7+
- Added the filtering for `replyType` in `MessageCollection`
8+
19
## v4.2.28 (Nov 15, 2024)
210

311
### Improvements

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Before installing Sendbird Chat SDK, you need to create a Sendbird application o
5050

5151
```yaml
5252
dependencies:
53-
sendbird_chat_sdk: ^4.2.28
53+
sendbird_chat_sdk: ^4.2.29
5454
```
5555
5656
- Run `flutter pub get` command in your project directory.

lib/src/internal/db/schema/message/meta/c_channel_message.dart

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,6 @@ class CChannelMessage {
160160
// [includeParentMessageInfo]
161161
// When calling API, this value have to be `true` to make chunk.
162162

163-
// [replyType]
164-
// Must call API, because this can not be queried with local cache.
165-
166163
// [showSubChannelMessagesOnly]
167164
// Must call API, because this can not be queried with local cache.
168165

@@ -259,6 +256,30 @@ class CChannelMessage {
259256
}
260257
}
261258

259+
//+ replyType
260+
messages.removeWhere((message) {
261+
if (message is BaseMessage) {
262+
switch (params.replyType) {
263+
case ReplyType.none:
264+
if (message.parentMessageId != null) {
265+
return true; // Remove
266+
}
267+
break;
268+
case ReplyType.all:
269+
break;
270+
case ReplyType.onlyReplyToChannel:
271+
if (message.parentMessageId != null && !message.isReplyToChannel) {
272+
return true; // Remove
273+
}
274+
break;
275+
case null:
276+
break;
277+
}
278+
}
279+
return false; // Do not remove
280+
});
281+
//- replyType
282+
262283
// reversed
263284
if (messages.length >= 2) {
264285
if ((isPrevious && !params.reverse) || (!isPrevious && params.reverse)) {

lib/src/internal/main/chat/chat.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ part 'chat_notifications.dart';
6262
part 'chat_push.dart';
6363
part 'chat_user.dart';
6464

65-
const sdkVersion = '4.2.28';
65+
const sdkVersion = '4.2.29';
6666

6767
// Internal implementation for main class. Do not directly access this class.
6868
class Chat with WidgetsBindingObserver {

lib/src/public/main/collection/group_channel_message_collection/base_message_collection.dart

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -885,9 +885,7 @@ abstract class BaseMessageCollection {
885885
}
886886

887887
// [Filter] senderIds
888-
if (addedMessage is BaseMessage &&
889-
params.senderIds != null &&
890-
params.customTypes!.isNotEmpty) {
888+
if (addedMessage is BaseMessage && params.senderIds != null) {
891889
bool found = false;
892890
for (final senderId in params.senderIds!) {
893891
if (addedMessage.sender?.userId == senderId) {
@@ -901,6 +899,27 @@ abstract class BaseMessageCollection {
901899
}
902900
}
903901

902+
// [Filter] replyType
903+
if (addedMessage is BaseMessage) {
904+
switch (params.replyType) {
905+
case ReplyType.none:
906+
if (addedMessage.parentMessageId != null) {
907+
return false;
908+
}
909+
break;
910+
case ReplyType.all:
911+
break;
912+
case ReplyType.onlyReplyToChannel:
913+
if (addedMessage.parentMessageId != null &&
914+
!addedMessage.isReplyToChannel) {
915+
return false;
916+
}
917+
break;
918+
case null:
919+
break;
920+
}
921+
}
922+
904923
return true;
905924
}
906925

pubspec.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: sendbird_chat_sdk
22
description: With Sendbird Chat for Flutter, you can easily build an in-app chat with all the essential messaging features.
3-
version: 4.2.28
3+
version: 4.2.29
44
homepage: https://sendbird.com
55
repository: https://github.com/sendbird/sendbird-chat-sdk-flutter
66
documentation: https://sendbird.com/docs/chat/sdk/v4/flutter/getting-started/send-first-message
@@ -24,10 +24,10 @@ dependencies:
2424
shared_preferences: ^2.2.2
2525
http: '>=0.13.6 <2.0.0'
2626
logger: '>=1.4.0 <3.0.0'
27-
mime: ^1.0.4
27+
mime: '>=1.0.4 <3.0.0'
2828
connectivity_plus: '>=5.0.1 <7.0.0'
2929
http_parser: ^4.0.2
30-
web_socket_channel: ^2.4.0
30+
web_socket_channel: '>=2.4.0 <4.0.0'
3131
universal_io: ^2.2.0
3232
async: ^2.10.0
3333
isar: ^3.1.0+1
@@ -38,7 +38,7 @@ dependencies:
3838
dev_dependencies:
3939
flutter_test:
4040
sdk: flutter
41-
flutter_lints: ^2.0.1
41+
flutter_lints: '>=2.0.1 <6.0.0'
4242
test: ^1.22.0
4343
stack_trace: ^1.11.0
4444
json_serializable: ^6.6.2

0 commit comments

Comments
 (0)