mirror of
https://github.com/WuKongIM/WuKongIMFlutterSDK
synced 2025-06-04 02:38:00 +00:00
fix: Modifying messages sent by oneself will increase the issue of unread quantity
This commit is contained in:
parent
bf378ca075
commit
1b1313958c
@ -83,4 +83,6 @@
|
|||||||
### 1.4.1
|
### 1.4.1
|
||||||
* fix: Modifying non JSON serialization errors in extended fields
|
* fix: Modifying non JSON serialization errors in extended fields
|
||||||
### 1.4.2
|
### 1.4.2
|
||||||
* fix: Optimize synchronization channel messages
|
* fix: Optimize synchronization channel messages
|
||||||
|
### 1.4.3
|
||||||
|
* fix: Modifying messages sent by oneself will increase the issue of unread quantity
|
@ -156,7 +156,6 @@ class ChatListDataState extends State<ChatList> {
|
|||||||
getMsgList(int oldestOrderSeq, int pullMode, bool isReset) {
|
getMsgList(int oldestOrderSeq, int pullMode, bool isReset) {
|
||||||
WKIM.shared.messageManager.getOrSyncHistoryMessages(channelID, channelType,
|
WKIM.shared.messageManager.getOrSyncHistoryMessages(channelID, channelType,
|
||||||
oldestOrderSeq, oldestOrderSeq == 0, pullMode, 5, 0, (list) {
|
oldestOrderSeq, oldestOrderSeq == 0, pullMode, 5, 0, (list) {
|
||||||
print('同步完成${list.length}条消息');
|
|
||||||
List<UIMsg> uiList = [];
|
List<UIMsg> uiList = [];
|
||||||
for (int i = 0; i < list.length; i++) {
|
for (int i = 0; i < list.length; i++) {
|
||||||
if (pullMode == 0 && !isReset) {
|
if (pullMode == 0 && !isReset) {
|
||||||
|
@ -121,7 +121,7 @@ class HttpUtils {
|
|||||||
String payload = json['payload'];
|
String payload = json['payload'];
|
||||||
try {
|
try {
|
||||||
msg.payload = jsonDecode(utf8.decode(base64Decode(payload)));
|
msg.payload = jsonDecode(utf8.decode(base64Decode(payload)));
|
||||||
// print('查询的消息${msg.payload}');
|
print('消息seq: ${msg.messageSeq},查询的消息${msg.payload}');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// print('异常了');
|
// print('异常了');
|
||||||
}
|
}
|
||||||
|
@ -460,8 +460,8 @@ class WKConnectionManager {
|
|||||||
msg.contentType != WkMessageContentType.insideMsg) {
|
msg.contentType != WkMessageContentType.insideMsg) {
|
||||||
int row = await WKIM.shared.messageManager.saveMsg(msg);
|
int row = await WKIM.shared.messageManager.saveMsg(msg);
|
||||||
msg.clientSeq = row;
|
msg.clientSeq = row;
|
||||||
WKUIConversationMsg? uiMsg =
|
WKUIConversationMsg? uiMsg = await WKIM.shared.conversationManager
|
||||||
await WKIM.shared.conversationManager.saveWithLiMMsg(msg);
|
.saveWithLiMMsg(msg, msg.header.redDot ? 1 : 0);
|
||||||
if (uiMsg != null) {
|
if (uiMsg != null) {
|
||||||
List<WKUIConversationMsg> list = [];
|
List<WKUIConversationMsg> list = [];
|
||||||
list.add(uiMsg);
|
list.add(uiMsg);
|
||||||
|
@ -36,7 +36,7 @@ class WKConversationManager {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<WKUIConversationMsg?> saveWithLiMMsg(WKMsg msg) async {
|
Future<WKUIConversationMsg?> saveWithLiMMsg(WKMsg msg, int redDot) async {
|
||||||
WKConversationMsg wkConversationMsg = WKConversationMsg();
|
WKConversationMsg wkConversationMsg = WKConversationMsg();
|
||||||
if (msg.channelType == WKChannelType.communityTopic &&
|
if (msg.channelType == WKChannelType.communityTopic &&
|
||||||
msg.channelID != '') {
|
msg.channelID != '') {
|
||||||
@ -52,7 +52,7 @@ class WKConversationManager {
|
|||||||
wkConversationMsg.lastMsgTimestamp = msg.timestamp;
|
wkConversationMsg.lastMsgTimestamp = msg.timestamp;
|
||||||
wkConversationMsg.lastClientMsgNO = msg.clientMsgNO;
|
wkConversationMsg.lastClientMsgNO = msg.clientMsgNO;
|
||||||
wkConversationMsg.lastMsgSeq = msg.messageSeq;
|
wkConversationMsg.lastMsgSeq = msg.messageSeq;
|
||||||
wkConversationMsg.unreadCount = msg.header.redDot ? 1 : 0;
|
wkConversationMsg.unreadCount = redDot;
|
||||||
WKUIConversationMsg? uiMsg = await ConversationDB.shared
|
WKUIConversationMsg? uiMsg = await ConversationDB.shared
|
||||||
.insertOrUpdateWithConvMsg(wkConversationMsg);
|
.insertOrUpdateWithConvMsg(wkConversationMsg);
|
||||||
return uiMsg;
|
return uiMsg;
|
||||||
|
@ -587,7 +587,7 @@ class WKMessageManager {
|
|||||||
WKIM.shared.messageManager.setOnMsgInserted(wkMsg);
|
WKIM.shared.messageManager.setOnMsgInserted(wkMsg);
|
||||||
if (row > 0) {
|
if (row > 0) {
|
||||||
WKUIConversationMsg? uiMsg =
|
WKUIConversationMsg? uiMsg =
|
||||||
await WKIM.shared.conversationManager.saveWithLiMMsg(wkMsg);
|
await WKIM.shared.conversationManager.saveWithLiMMsg(wkMsg, 0);
|
||||||
if (uiMsg != null) {
|
if (uiMsg != null) {
|
||||||
List<WKUIConversationMsg> uiMsgs = [];
|
List<WKUIConversationMsg> uiMsgs = [];
|
||||||
uiMsgs.add(uiMsg);
|
uiMsgs.add(uiMsg);
|
||||||
@ -779,8 +779,8 @@ class WKMessageManager {
|
|||||||
var tempMsg = await MessageDB.shared.queryMaxOrderSeqMsgWithChannel(
|
var tempMsg = await MessageDB.shared.queryMaxOrderSeqMsgWithChannel(
|
||||||
wkMsg.channelID, wkMsg.channelType);
|
wkMsg.channelID, wkMsg.channelType);
|
||||||
if (tempMsg != null) {
|
if (tempMsg != null) {
|
||||||
var uiMsg =
|
var uiMsg = await WKIM.shared.conversationManager
|
||||||
await WKIM.shared.conversationManager.saveWithLiMMsg(tempMsg);
|
.saveWithLiMMsg(tempMsg, 0);
|
||||||
if (uiMsg != null) {
|
if (uiMsg != null) {
|
||||||
List<WKUIConversationMsg> uiMsgs = [];
|
List<WKUIConversationMsg> uiMsgs = [];
|
||||||
uiMsgs.add(uiMsg);
|
uiMsgs.add(uiMsg);
|
||||||
|
56
pubspec.lock
56
pubspec.lock
@ -232,6 +232,30 @@ packages:
|
|||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.6.5"
|
version: "0.6.5"
|
||||||
|
leak_tracker:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: leak_tracker
|
||||||
|
sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a"
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "10.0.4"
|
||||||
|
leak_tracker_flutter_testing:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: leak_tracker_flutter_testing
|
||||||
|
sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8"
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "3.0.3"
|
||||||
|
leak_tracker_testing:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: leak_tracker_testing
|
||||||
|
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "3.0.1"
|
||||||
lints:
|
lints:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -244,34 +268,34 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: matcher
|
name: matcher
|
||||||
sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e"
|
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.12.16"
|
version: "0.12.16+1"
|
||||||
material_color_utilities:
|
material_color_utilities:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: material_color_utilities
|
name: material_color_utilities
|
||||||
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
|
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.5.0"
|
version: "0.8.0"
|
||||||
meta:
|
meta:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: meta
|
name: meta
|
||||||
sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e
|
sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.10.0"
|
version: "1.12.0"
|
||||||
path:
|
path:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: path
|
name: path
|
||||||
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
|
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.8.3"
|
version: "1.9.0"
|
||||||
path_provider_linux:
|
path_provider_linux:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -457,10 +481,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: test_api
|
name: test_api
|
||||||
sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
|
sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f"
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.6.1"
|
version: "0.7.0"
|
||||||
typed_data:
|
typed_data:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -485,14 +509,14 @@ packages:
|
|||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.4"
|
version: "2.1.4"
|
||||||
web:
|
vm_service:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: web
|
name: vm_service
|
||||||
sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
|
sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.3.0"
|
version: "14.2.1"
|
||||||
web_socket_channel:
|
web_socket_channel:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -526,5 +550,5 @@ packages:
|
|||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.2"
|
version: "1.0.2"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=3.2.0-194.0.dev <4.0.0"
|
dart: ">=3.3.0 <4.0.0"
|
||||||
flutter: ">=3.3.0"
|
flutter: ">=3.18.0-18.0.pre.54"
|
||||||
|
@ -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.4.2
|
version: 1.4.3
|
||||||
homepage: https://github.com/WuKongIM/WuKongIMFlutterSDK
|
homepage: https://github.com/WuKongIM/WuKongIMFlutterSDK
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user