mirror of
https://github.com/WuKongIM/WuKongIMFlutterSDK
synced 2025-05-28 22:52:20 +00:00
fix: Optimization of loading channel messages without the latest messages and multiple synchronization issues
This commit is contained in:
parent
e57a9a505c
commit
3900a39b66
@ -63,4 +63,6 @@
|
||||
### 1.3.1
|
||||
* fix: synchronization channel message multiple synchronization issue
|
||||
### 1.3.2
|
||||
* fix: Optimization of loading channel messages without the latest messages and multiple synchronization issues
|
||||
### 1.3.3
|
||||
* fix: Optimization of loading channel messages without the latest messages and multiple synchronization issues
|
@ -9,7 +9,7 @@
|
||||
#### 安装
|
||||
```
|
||||
dependencies:
|
||||
wukongimfluttersdk: ^1.3.2
|
||||
wukongimfluttersdk: ^1.3.3
|
||||
```
|
||||
#### 引入
|
||||
```dart
|
||||
|
@ -80,6 +80,7 @@ class HttpUtils {
|
||||
int pullMode,
|
||||
Function(WKSyncChannelMsg) back) async {
|
||||
final dio = Dio();
|
||||
print('同不消息');
|
||||
final response = await dio.post('$apiURL/channel/messagesync', data: {
|
||||
"login_uid": UserInfo.uid, // 当前登录用户uid
|
||||
"channel_id": channelID, // 频道ID
|
||||
|
@ -308,6 +308,7 @@ class MessageDB {
|
||||
}
|
||||
|
||||
var requestCount = 0;
|
||||
var isMore = 1;
|
||||
void getOrSyncHistoryMessages(
|
||||
String channelId,
|
||||
int channelType,
|
||||
@ -359,7 +360,9 @@ class MessageDB {
|
||||
} else {
|
||||
oldestMsgSeq = oldestOrderSeq ~/ 1000;
|
||||
}
|
||||
if (oldestMsgSeq == 1) {
|
||||
if (oldestMsgSeq == 1 || isMore == 0) {
|
||||
isMore = 1;
|
||||
requestCount = 0;
|
||||
iGetOrSyncHistoryMsgBack(list);
|
||||
return;
|
||||
}
|
||||
@ -460,15 +463,18 @@ class MessageDB {
|
||||
if (syncChannelMsg != null &&
|
||||
syncChannelMsg.messages != null &&
|
||||
syncChannelMsg.messages!.isNotEmpty) {
|
||||
isMore = syncChannelMsg.more;
|
||||
getOrSyncHistoryMessages(channelId, channelType, oldestOrderSeq,
|
||||
contain, pullMode, limit, iGetOrSyncHistoryMsgBack, syncBack);
|
||||
} else {
|
||||
requestCount = 0;
|
||||
isMore = 1;
|
||||
iGetOrSyncHistoryMsgBack(list);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
requestCount = 0;
|
||||
isMore = 1;
|
||||
iGetOrSyncHistoryMsgBack(list);
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ description: wukong IM flutter sdk
|
||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||
# In Windows, build-name is used as the major, minor, and patch parts
|
||||
# of the product and file versions while build-number is used as the build suffix.
|
||||
version: 1.3.2
|
||||
version: 1.3.3
|
||||
homepage: https://github.com/WuKongIM/WuKongIMFlutterSDK
|
||||
|
||||
environment:
|
||||
|
Loading…
x
Reference in New Issue
Block a user