From e5b43d2df33360ea83105cbffb5a517c90f0eafd Mon Sep 17 00:00:00 2001 From: Tyler Jeong Date: Fri, 8 Mar 2024 11:35:27 +0900 Subject: [PATCH] Add 4.2.4. --- CHANGELOG.md | 5 +++++ README.md | 2 +- lib/src/internal/db/schema/message/c_base_message.dart | 7 +------ lib/src/internal/main/chat/chat.dart | 2 +- .../group_channel_collection_manager.dart | 9 ++++++--- lib/src/public/core/message/root_message.dart | 2 ++ .../public/main/query/message/message_search_query.dart | 2 +- pubspec.yaml | 2 +- 8 files changed, 18 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7dbf0bd..a382bdc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## v4.2.4 (Mar 8, 2024) + +### Improvements +- Fixed the exception regarding unmodifiable list + ## v4.2.3 (Mar 4, 2024) ### Improvements diff --git a/README.md b/README.md index d9d4eba..0ec1bb8 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Before installing Sendbird Chat SDK, you need to create a Sendbird application o ```yaml dependencies: - sendbird_chat_sdk: ^4.2.3 + sendbird_chat_sdk: ^4.2.4 ``` - Run `flutter pub get` command in your project directory. diff --git a/lib/src/internal/db/schema/message/c_base_message.dart b/lib/src/internal/db/schema/message/c_base_message.dart index 10686bf..8b54879 100644 --- a/lib/src/internal/db/schema/message/c_base_message.dart +++ b/lib/src/internal/db/schema/message/c_base_message.dart @@ -131,12 +131,6 @@ class CBaseMessage extends CRootMessage { ? await cBaseMessage.sender?.toSender(chat, isar) : null; - for (final userId in cBaseMessage.mentionedUsers) { - final user = await CUser.get(chat, isar, userId); - if (user != null) { - baseMessage.mentionedUsers.add(user); - } - } return baseMessage; } @@ -213,6 +207,7 @@ class CThreadInfo { Future toThreadInfo(Chat chat, Isar isar) async { final threadInfo = ThreadInfo() ..replyCount = replyCount + ..mostRepliesUsers = [] ..lastRepliedAt = lastRepliedAt ..updatedAt = updatedAt; diff --git a/lib/src/internal/main/chat/chat.dart b/lib/src/internal/main/chat/chat.dart index 1bdf1fe..e0085f4 100644 --- a/lib/src/internal/main/chat/chat.dart +++ b/lib/src/internal/main/chat/chat.dart @@ -60,7 +60,7 @@ part 'chat_notifications.dart'; part 'chat_push.dart'; part 'chat_user.dart'; -const sdkVersion = '4.2.3'; +const sdkVersion = '4.2.4'; // Internal implementation for main class. Do not directly access this class. class Chat with WidgetsBindingObserver { diff --git a/lib/src/internal/main/chat_manager/collection_manager/group_channel_collection_manager.dart b/lib/src/internal/main/chat_manager/collection_manager/group_channel_collection_manager.dart index 67b8f68..f95fc34 100644 --- a/lib/src/internal/main/chat_manager/collection_manager/group_channel_collection_manager.dart +++ b/lib/src/internal/main/chat_manager/collection_manager/group_channel_collection_manager.dart @@ -179,7 +179,8 @@ extension GroupChannelCollectionManager on CollectionManager { } if (!isChannelExists) { - if (await channelCollection.canAddChannel(eventSource, addedChannel)) { + if (await channelCollection.canAddChannel( + eventSource, addedChannel)) { addedChannelsForEvent.add(addedChannel); } } @@ -202,7 +203,8 @@ extension GroupChannelCollectionManager on CollectionManager { // Need to compare channel properties with updatedChannel // when eventSource is CollectionEventSource.channelChangeLogs (?) - if (await channelCollection.canAddChannel(eventSource, updatedChannel, + if (await channelCollection.canAddChannel( + eventSource, updatedChannel, checkToUpdateChannel: true)) { channelCollection.channelList[index] = updatedChannel; updatedChannelsForEvent.add(updatedChannel); @@ -218,7 +220,8 @@ extension GroupChannelCollectionManager on CollectionManager { if (eventSource == CollectionEventSource.channelChangeLogs && !isUpdatedChannelInChannelList) { - if (await channelCollection.canAddChannel(eventSource, updatedChannel)) { + if (await channelCollection.canAddChannel( + eventSource, updatedChannel)) { addedChannelsForEvent.add(updatedChannel); } } diff --git a/lib/src/public/core/message/root_message.dart b/lib/src/public/core/message/root_message.dart index a18bc5c..9cd6e87 100644 --- a/lib/src/public/core/message/root_message.dart +++ b/lib/src/public/core/message/root_message.dart @@ -57,6 +57,8 @@ class RootMessage { } } } + + if (_mentionedUsers.isEmpty) return []; return _mentionedUsers; } diff --git a/lib/src/public/main/query/message/message_search_query.dart b/lib/src/public/main/query/message/message_search_query.dart index 01bbeeb..ec7370d 100644 --- a/lib/src/public/main/query/message/message_search_query.dart +++ b/lib/src/public/main/query/message/message_search_query.dart @@ -100,7 +100,7 @@ class MessageSearchQuery extends BaseQuery { targetFields: targetFields, ), ); - + hasNext = res.hasNext; totalCount = res.totalCount; token = res.next; diff --git a/pubspec.yaml b/pubspec.yaml index 238e741..8f7d523 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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.3 +version: 4.2.4 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