Skip to content

Commit c614395

Browse files
Merge pull request #110 from sendbird/v4.2.15
Add 4.2.15.
2 parents 890d341 + 200976d commit c614395

File tree

57 files changed

+1780
-594
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1780
-594
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
## v4.2.15 (Jun 5, 2024)
2+
3+
### Improvements
4+
- Fixed the bugs regarding my mute info
5+
- Fixed the bugs regarding changelogs on web
6+
- Fixed the bugs regarding connection management
7+
- Fixed the bugs regarding `markAsDelivered()` in `SendbirdChat`
8+
- Added `metaData`, `readStatus`, `deliveryStatus` in channel db
9+
- Fixed a bug when `includeEmpty` is `false` in `GroupChannelCollection`
10+
111
## v4.2.14 (May 16, 2024)
212

313
### 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.14
53+
sendbird_chat_sdk: ^4.2.15
5454
```
5555
5656
- Run `flutter pub get` command in your project directory.

lib/src/internal/db/db.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ class DB {
177177
return await _isar.cMessageChunks.count();
178178
}
179179

180-
// ChannelChangeLogInfo
180+
// ChannelInfo
181181
Future<void> upsertChannelInfo(ChannelInfo info) async {
182182
await CChannelInfo.upsert(_chat, _isar, info);
183183
}

lib/src/internal/db/schema/channel/c_base_channel.dart

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// Copyright (c) 2023 Sendbird, Inc. All rights reserved.
22

3+
import 'dart:convert';
4+
35
import 'package:isar/isar.dart';
46
import 'package:sendbird_chat_sdk/src/internal/main/chat/chat.dart';
57
import 'package:sendbird_chat_sdk/src/public/core/channel/base_channel/base_channel.dart';
@@ -24,6 +26,7 @@ class CBaseChannel {
2426
String? customType;
2527
bool? isFrozen;
2628
bool? isEphemeral;
29+
late String metaData; // Map<String, String>
2730

2831
// Internal
2932
late bool fromCache;
@@ -46,6 +49,7 @@ class CBaseChannel {
4649
customType = channel.customType;
4750
isFrozen = channel.isFrozen;
4851
isEphemeral = channel.isEphemeral;
52+
metaData = jsonEncode(channel.getCachedMetaData());
4953
}
5054
fromCache = channel.fromCache;
5155
dirty = channel.dirty;
@@ -77,6 +81,11 @@ class CBaseChannel {
7781
..customType = cBaseChannel.customType
7882
..isFrozen = cBaseChannel.isFrozen
7983
..isEphemeral = cBaseChannel.isEphemeral;
84+
85+
final cachedMetaData =
86+
(jsonDecode(cBaseChannel.metaData) as Map<String, dynamic>)
87+
.map((key, value) => MapEntry(key, value.toString()));
88+
channel.setCachedMetaData(cachedMetaData);
8089
}
8190
return channel;
8291
}

lib/src/internal/db/schema/channel/c_feed_channel.g.dart

Lines changed: 189 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/src/internal/db/schema/channel/c_group_channel.dart

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// Copyright (c) 2023 Sendbird, Inc. All rights reserved.
22

3+
import 'dart:convert';
4+
35
import 'package:isar/isar.dart';
46
import 'package:sendbird_chat_sdk/sendbird_chat_sdk.dart';
57
import 'package:sendbird_chat_sdk/src/internal/db/schema/channel/c_base_channel.dart';
@@ -67,6 +69,9 @@ class CGroupChannel extends CBaseChannel {
6769

6870
late int pinnedMessageUpdatedAt;
6971

72+
late String readStatus; // Map<String, int>
73+
late String deliveryStatus; // Map<String, int>
74+
7075
CGroupChannel();
7176

7277
factory CGroupChannel.fromGroupChannel(GroupChannel channel) {
@@ -111,7 +116,10 @@ class CGroupChannel extends CBaseChannel {
111116
..lastPinnedMessageType =
112117
channel.lastPinnedMessage?.messageType ?? MessageType.user
113118
..lastPinnedMessageRootId = channel.lastPinnedMessage?.rootId
114-
..pinnedMessageUpdatedAt = channel.pinnedMessageUpdatedAt;
119+
..pinnedMessageUpdatedAt = channel.pinnedMessageUpdatedAt
120+
..readStatus = jsonEncode(channel.getCachedReadStatus(channel.channelUrl))
121+
..deliveryStatus =
122+
jsonEncode(channel.getCachedDeliveryStatus(channel.channelUrl));
115123
}
116124

117125
Future<GroupChannel> toGroupChannel(Chat chat, Isar isar) async {
@@ -162,6 +170,16 @@ class CGroupChannel extends CBaseChannel {
162170
groupChannel.members.add(member);
163171
}
164172
}
173+
174+
final cachedReadStatus = (jsonDecode(readStatus) as Map<String, dynamic>)
175+
.map((key, value) => MapEntry(key, value as int));
176+
groupChannel.setCachedReadStatus(cachedReadStatus);
177+
178+
final cachedDeliveryStatus =
179+
(jsonDecode(deliveryStatus) as Map<String, dynamic>)
180+
.map((key, value) => MapEntry(key, value as int));
181+
groupChannel.setCachedDeliveryStatus(cachedDeliveryStatus);
182+
165183
return groupChannel;
166184
}
167185

0 commit comments

Comments
 (0)