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
* fix: Upgrade send message api
### 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.fromUID = WKIM.shared.options.uid!;
wkMsg.contentType = messageContent.contentType;
int tempOrderSeq = await MessageDB.shared
.queryMaxOrderSeq(wkMsg.channelID, wkMsg.channelType);
wkMsg.orderSeq = tempOrderSeq + 1;
wkMsg.content = _getSendPayload(wkMsg);
wkMsg.setChannelInfo(channel);
WKChannel? from = await WKIM.shared.channelManager
@ -582,18 +580,24 @@ class WKMessageManager {
if (from != null) {
wkMsg.setFrom(from);
}
int row = await saveMsg(wkMsg);
wkMsg.clientSeq = row;
WKIM.shared.messageManager.setOnMsgInserted(wkMsg);
if (row > 0) {
WKUIConversationMsg? uiMsg =
await WKIM.shared.conversationManager.saveWithLiMMsg(wkMsg, 0);
if (uiMsg != null) {
List<WKUIConversationMsg> uiMsgs = [];
uiMsgs.add(uiMsg);
WKIM.shared.conversationManager.setRefreshUIMsgs(uiMsgs);
if (!options.header.noPersist) {
int tempOrderSeq = await MessageDB.shared
.queryMaxOrderSeq(wkMsg.channelID, wkMsg.channelType);
wkMsg.orderSeq = tempOrderSeq + 1;
int row = await saveMsg(wkMsg);
wkMsg.clientSeq = row;
if (row > 0) {
WKUIConversationMsg? uiMsg =
await WKIM.shared.conversationManager.saveWithLiMMsg(wkMsg, 0);
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 (_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
# 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.4.9
version: 1.5.0
homepage: https://github.com/WuKongIM/WuKongIMFlutterSDK
environment: