diff --git a/CHANGELOG.md b/CHANGELOG.md index bbe09f0..926bebd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -61,4 +61,6 @@ ### 1.3.0 * Modification of sending messages containing replies error ### 1.3.1 - * fix: synchronization channel message multiple synchronization issue \ No newline at end of file + * fix: synchronization channel message multiple synchronization issue + ### 1.3.2 + * fix: Optimization of loading channel messages without the latest messages and multiple synchronization issues \ No newline at end of file diff --git a/README.md b/README.md index bfac7ef..77443d8 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ #### 安装 ``` dependencies: - wukongimfluttersdk: ^1.3.1 + wukongimfluttersdk: ^1.3.2 ``` #### 引入 ```dart diff --git a/example/lib/chat.dart b/example/lib/chat.dart index ac50e2d..1de4115 100644 --- a/example/lib/chat.dart +++ b/example/lib/chat.dart @@ -140,7 +140,7 @@ class ChatListDataState extends State { getMsgList(int oldestOrderSeq, int pullMode, bool isReset) { WKIM.shared.messageManager.getOrSyncHistoryMessages(channelID, channelType, - oldestOrderSeq, oldestOrderSeq == 0, pullMode, 20, 0, (list) { + oldestOrderSeq, oldestOrderSeq == 0, pullMode, 10, 0, (list) { List uiList = []; for (int i = 0; i < list.length; i++) { if (pullMode == 0 && !isReset) { diff --git a/lib/db/message.dart b/lib/db/message.dart index be897d3..60d60ac 100644 --- a/lib/db/message.dart +++ b/lib/db/message.dart @@ -320,7 +320,6 @@ class MessageDB { //获取原始数据 List list = await getMessages( channelId, channelType, oldestOrderSeq, contain, pullMode, limit); - print("查询总数量${list.length}"); //业务判断数据 List tempList = []; for (int i = 0, size = list.length; i < size; i++) { @@ -360,6 +359,10 @@ class MessageDB { } else { oldestMsgSeq = oldestOrderSeq ~/ 1000; } + if (oldestMsgSeq == 1) { + iGetOrSyncHistoryMsgBack(list); + return; + } if (pullMode == 0) { //下拉获取消息 if (maxMessageSeq != 0 && diff --git a/pubspec.lock b/pubspec.lock index 234f4e7..976ffd4 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -389,6 +389,14 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.10.0" + sprintf: + dependency: transitive + description: + name: sprintf + sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23" + url: "https://pub.flutter-io.cn" + source: hosted + version: "7.0.0" sqflite: dependency: "direct main" description: @@ -465,10 +473,10 @@ packages: dependency: "direct main" description: name: uuid - sha256: "648e103079f7c64a36dc7d39369cabb358d377078a051d6ae2ad3aa539519313" + sha256: cd210a09f7c18cbe5a02511718e0334de6559871052c90a90c0cca46a4aa81c8 url: "https://pub.flutter-io.cn" source: hosted - version: "3.0.7" + version: "4.3.3" vector_math: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 466d426..ba55d9c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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.1 +version: 1.3.2 homepage: https://github.com/WuKongIM/WuKongIMFlutterSDK environment: @@ -41,7 +41,7 @@ dependencies: encryptions: ^1.1.0+1 hex: ^0.2.0 crypto: ^3.0.3 - uuid: ^3.0.7 + uuid: ^4.3.3 web_socket_channel: ^2.4.0 dio: ^5.3.2 encryptor: ^0.0.1