fix:update send noPersist message

This commit is contained in:
SL 2024-07-26 11:21:50 +08:00
parent 913c75a4dd
commit e726086953
3 changed files with 21 additions and 15 deletions

View File

@ -97,4 +97,6 @@
### 1.4.8 ### 1.4.8
* fix: Upgrade send message api * fix: Upgrade send message api
### 1.4.9 ### 1.4.9
* fix: Upgrade save channel member extra data api * fix: Upgrade save channel member extra data api
### 1.4.9
* fix: Upgrade send noPersist message

View File

@ -572,9 +572,7 @@ class WKMessageManager {
wkMsg.channelType = channel.channelType; wkMsg.channelType = channel.channelType;
wkMsg.fromUID = WKIM.shared.options.uid!; wkMsg.fromUID = WKIM.shared.options.uid!;
wkMsg.contentType = messageContent.contentType; wkMsg.contentType = messageContent.contentType;
int tempOrderSeq = await MessageDB.shared
.queryMaxOrderSeq(wkMsg.channelID, wkMsg.channelType);
wkMsg.orderSeq = tempOrderSeq + 1;
wkMsg.content = _getSendPayload(wkMsg); wkMsg.content = _getSendPayload(wkMsg);
wkMsg.setChannelInfo(channel); wkMsg.setChannelInfo(channel);
WKChannel? from = await WKIM.shared.channelManager WKChannel? from = await WKIM.shared.channelManager
@ -582,18 +580,24 @@ class WKMessageManager {
if (from != null) { if (from != null) {
wkMsg.setFrom(from); wkMsg.setFrom(from);
} }
int row = await saveMsg(wkMsg); if (!options.header.noPersist) {
wkMsg.clientSeq = row; int tempOrderSeq = await MessageDB.shared
WKIM.shared.messageManager.setOnMsgInserted(wkMsg); .queryMaxOrderSeq(wkMsg.channelID, wkMsg.channelType);
if (row > 0) { wkMsg.orderSeq = tempOrderSeq + 1;
WKUIConversationMsg? uiMsg = int row = await saveMsg(wkMsg);
await WKIM.shared.conversationManager.saveWithLiMMsg(wkMsg, 0); wkMsg.clientSeq = row;
if (uiMsg != null) { if (row > 0) {
List<WKUIConversationMsg> uiMsgs = []; WKUIConversationMsg? uiMsg =
uiMsgs.add(uiMsg); await WKIM.shared.conversationManager.saveWithLiMMsg(wkMsg, 0);
WKIM.shared.conversationManager.setRefreshUIMsgs(uiMsgs); WKIM.shared.messageManager.setOnMsgInserted(wkMsg);
if (uiMsg != null) {
List<WKUIConversationMsg> uiMsgs = [];
uiMsgs.add(uiMsg);
WKIM.shared.conversationManager.setRefreshUIMsgs(uiMsgs);
}
} }
} }
if (wkMsg.messageContent is WKMediaMessageContent) { if (wkMsg.messageContent is WKMediaMessageContent) {
// //
if (_uploadAttachmentBack != null) { if (_uploadAttachmentBack != null) {

View File

@ -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.9 version: 1.5.0
homepage: https://github.com/WuKongIM/WuKongIMFlutterSDK homepage: https://github.com/WuKongIM/WuKongIMFlutterSDK
environment: environment: