mirror of
https://github.com/WuKongIM/WuKongIMFlutterSDK
synced 2025-06-07 14:10:52 +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
@ -64,3 +64,5 @@
|
|||||||
* fix: synchronization channel message multiple synchronization issue
|
* fix: synchronization channel message multiple synchronization issue
|
||||||
### 1.3.2
|
### 1.3.2
|
||||||
* fix: Optimization of loading channel messages without the latest messages and multiple synchronization issues
|
* 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:
|
dependencies:
|
||||||
wukongimfluttersdk: ^1.3.2
|
wukongimfluttersdk: ^1.3.3
|
||||||
```
|
```
|
||||||
#### 引入
|
#### 引入
|
||||||
```dart
|
```dart
|
||||||
|
@ -80,6 +80,7 @@ class HttpUtils {
|
|||||||
int pullMode,
|
int pullMode,
|
||||||
Function(WKSyncChannelMsg) back) async {
|
Function(WKSyncChannelMsg) back) async {
|
||||||
final dio = Dio();
|
final dio = Dio();
|
||||||
|
print('同不消息');
|
||||||
final response = await dio.post('$apiURL/channel/messagesync', data: {
|
final response = await dio.post('$apiURL/channel/messagesync', data: {
|
||||||
"login_uid": UserInfo.uid, // 当前登录用户uid
|
"login_uid": UserInfo.uid, // 当前登录用户uid
|
||||||
"channel_id": channelID, // 频道ID
|
"channel_id": channelID, // 频道ID
|
||||||
|
@ -308,6 +308,7 @@ class MessageDB {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var requestCount = 0;
|
var requestCount = 0;
|
||||||
|
var isMore = 1;
|
||||||
void getOrSyncHistoryMessages(
|
void getOrSyncHistoryMessages(
|
||||||
String channelId,
|
String channelId,
|
||||||
int channelType,
|
int channelType,
|
||||||
@ -359,7 +360,9 @@ class MessageDB {
|
|||||||
} else {
|
} else {
|
||||||
oldestMsgSeq = oldestOrderSeq ~/ 1000;
|
oldestMsgSeq = oldestOrderSeq ~/ 1000;
|
||||||
}
|
}
|
||||||
if (oldestMsgSeq == 1) {
|
if (oldestMsgSeq == 1 || isMore == 0) {
|
||||||
|
isMore = 1;
|
||||||
|
requestCount = 0;
|
||||||
iGetOrSyncHistoryMsgBack(list);
|
iGetOrSyncHistoryMsgBack(list);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -460,15 +463,18 @@ class MessageDB {
|
|||||||
if (syncChannelMsg != null &&
|
if (syncChannelMsg != null &&
|
||||||
syncChannelMsg.messages != null &&
|
syncChannelMsg.messages != null &&
|
||||||
syncChannelMsg.messages!.isNotEmpty) {
|
syncChannelMsg.messages!.isNotEmpty) {
|
||||||
|
isMore = syncChannelMsg.more;
|
||||||
getOrSyncHistoryMessages(channelId, channelType, oldestOrderSeq,
|
getOrSyncHistoryMessages(channelId, channelType, oldestOrderSeq,
|
||||||
contain, pullMode, limit, iGetOrSyncHistoryMsgBack, syncBack);
|
contain, pullMode, limit, iGetOrSyncHistoryMsgBack, syncBack);
|
||||||
} else {
|
} else {
|
||||||
requestCount = 0;
|
requestCount = 0;
|
||||||
|
isMore = 1;
|
||||||
iGetOrSyncHistoryMsgBack(list);
|
iGetOrSyncHistoryMsgBack(list);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
requestCount = 0;
|
requestCount = 0;
|
||||||
|
isMore = 1;
|
||||||
iGetOrSyncHistoryMsgBack(list);
|
iGetOrSyncHistoryMsgBack(list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ description: wukong IM flutter sdk
|
|||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# 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
|
# 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.
|
# 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
|
homepage: https://github.com/WuKongIM/WuKongIMFlutterSDK
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user