mirror of
https://github.com/WuKongIM/WuKongIMAndroidSDK
synced 2025-06-06 17:50:53 +00:00
fix:修复处理附件消息时未将消息类型添加到消息体中
This commit is contained in:
parent
3904ad553a
commit
789faba683
6
.idea/AndroidProjectSystem.xml
generated
Normal file
6
.idea/AndroidProjectSystem.xml
generated
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="AndroidProjectSystem">
|
||||||
|
<option name="providerId" value="com.android.tools.idea.GradleProjectSystem" />
|
||||||
|
</component>
|
||||||
|
</project>
|
@ -343,7 +343,7 @@ public class ConversationDbManager {
|
|||||||
}
|
}
|
||||||
wkConversationMsg.channelID = msg.channelID;
|
wkConversationMsg.channelID = msg.channelID;
|
||||||
wkConversationMsg.channelType = msg.channelType;
|
wkConversationMsg.channelType = msg.channelType;
|
||||||
wkConversationMsg.localExtraMap = msg.localExtraMap;
|
// wkConversationMsg.localExtraMap = msg.localExtraMap;
|
||||||
wkConversationMsg.lastMsgTimestamp = msg.timestamp;
|
wkConversationMsg.lastMsgTimestamp = msg.timestamp;
|
||||||
wkConversationMsg.lastClientMsgNO = msg.clientMsgNO;
|
wkConversationMsg.lastClientMsgNO = msg.clientMsgNO;
|
||||||
wkConversationMsg.lastMsgSeq = msg.messageSeq;
|
wkConversationMsg.lastMsgSeq = msg.messageSeq;
|
||||||
|
@ -202,6 +202,7 @@ public class CMDManager extends BaseManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
WKCMD wkcmd = new WKCMD(cmd, jsonObject);
|
WKCMD wkcmd = new WKCMD(cmd, jsonObject);
|
||||||
|
WKLoggerUtils.getInstance().e("处理cmd:"+cmd);
|
||||||
pushCMDs(wkcmd);
|
pushCMDs(wkcmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -410,7 +410,7 @@ public class MsgManager extends BaseManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
WKIM.getInstance().getConversationManager().setOnRefreshMsg(uiMsgList,"deleteWithClientMsgNOList");
|
WKIM.getInstance().getConversationManager().setOnRefreshMsg(uiMsgList, "deleteWithClientMsgNOList");
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<WKMsg> getExpireMessages(int limit) {
|
public List<WKMsg> getExpireMessages(int limit) {
|
||||||
@ -755,10 +755,25 @@ public class MsgManager extends BaseManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public boolean updateContentAndRefresh(String clientMsgNo, WKMessageContent messageContent, boolean isRefreshUI) {
|
public boolean updateContentAndRefresh(String clientMsgNo, String content, boolean isRefreshUI) {
|
||||||
return MsgDbManager.getInstance().updateFieldWithClientMsgNo(clientMsgNo, WKDBColumns.WKMessageColumns.content, messageContent.encodeMsg().toString(), isRefreshUI);
|
return MsgDbManager.getInstance().updateFieldWithClientMsgNo(clientMsgNo, WKDBColumns.WKMessageColumns.content, content, isRefreshUI);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public boolean updateContentAndRefresh(String clientMsgNo, WKMessageContent model, boolean isRefreshUI) {
|
||||||
|
JSONObject jsonObject = model.encodeMsg();
|
||||||
|
try {
|
||||||
|
if (jsonObject == null) {
|
||||||
|
jsonObject = new JSONObject();
|
||||||
|
}
|
||||||
|
jsonObject.put("type", model.type);
|
||||||
|
} catch (JSONException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
return updateContentAndRefresh(clientMsgNo, jsonObject.toString(), isRefreshUI);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void updateViewedAt(int viewed, long viewedAt, String clientMsgNo) {
|
public void updateViewedAt(int viewed, long viewedAt, String clientMsgNo) {
|
||||||
MsgDbManager.getInstance().updateViewedAt(viewed, viewedAt, clientMsgNo);
|
MsgDbManager.getInstance().updateViewedAt(viewed, viewedAt, clientMsgNo);
|
||||||
}
|
}
|
||||||
|
@ -168,13 +168,13 @@ public class WKConnection {
|
|||||||
connectionClient = new ConnectionClient(iNonBlockingConnection -> {
|
connectionClient = new ConnectionClient(iNonBlockingConnection -> {
|
||||||
connCount = 0;
|
connCount = 0;
|
||||||
if (iNonBlockingConnection == null || connection == null || !connection.getId().equals(iNonBlockingConnection.getId())) {
|
if (iNonBlockingConnection == null || connection == null || !connection.getId().equals(iNonBlockingConnection.getId())) {
|
||||||
WKLoggerUtils.getInstance().e(TAG,"重复连接");
|
WKLoggerUtils.getInstance().e(TAG, "重复连接");
|
||||||
forcedReconnection();
|
forcedReconnection();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Object att = iNonBlockingConnection.getAttachment();
|
Object att = iNonBlockingConnection.getAttachment();
|
||||||
if (att == null || !att.equals(socketSingleID)) {
|
if (att == null || !att.equals(socketSingleID)) {
|
||||||
WKLoggerUtils.getInstance().e(TAG,"不属于当前连接");
|
WKLoggerUtils.getInstance().e(TAG, "不属于当前连接");
|
||||||
forcedReconnection();
|
forcedReconnection();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -458,8 +458,13 @@ public class WKConnection {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (hasAttached) {
|
if (hasAttached) {
|
||||||
msg.content = msg.baseContentMsgModel.encodeMsg().toString();
|
JSONObject jsonObject = WKProto.getInstance().getSendPayload(msg);
|
||||||
WKIM.getInstance().getMsgManager().updateContentAndRefresh(msg.clientMsgNO, msg.baseContentMsgModel, false);
|
if (jsonObject != null) {
|
||||||
|
msg.content = jsonObject.toString();
|
||||||
|
} else {
|
||||||
|
msg.content = msg.baseContentMsgModel.encodeMsg().toString();
|
||||||
|
}
|
||||||
|
WKIM.getInstance().getMsgManager().updateContentAndRefresh(msg.clientMsgNO, msg.content, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//获取发送者信息
|
//获取发送者信息
|
||||||
@ -476,7 +481,13 @@ public class WKConnection {
|
|||||||
WKIM.getInstance().getMsgManager().setUploadAttachment(msg, (isSuccess, messageContent) -> {
|
WKIM.getInstance().getMsgManager().setUploadAttachment(msg, (isSuccess, messageContent) -> {
|
||||||
if (isSuccess) {
|
if (isSuccess) {
|
||||||
msg.baseContentMsgModel = messageContent;
|
msg.baseContentMsgModel = messageContent;
|
||||||
WKIM.getInstance().getMsgManager().updateContentAndRefresh(msg.clientMsgNO, msg.baseContentMsgModel, false);
|
JSONObject jsonObject = WKProto.getInstance().getSendPayload(msg);
|
||||||
|
if (jsonObject != null) {
|
||||||
|
msg.content = jsonObject.toString();
|
||||||
|
} else {
|
||||||
|
msg.content = msg.baseContentMsgModel.encodeMsg().toString();
|
||||||
|
}
|
||||||
|
WKIM.getInstance().getMsgManager().updateContentAndRefresh(msg.clientMsgNO, msg.content, false);
|
||||||
if (!sendingMsgHashMap.containsKey((int) msg.clientSeq)) {
|
if (!sendingMsgHashMap.containsKey((int) msg.clientSeq)) {
|
||||||
WKSendMsg base1 = WKProto.getInstance().getSendBaseMsg(msg);
|
WKSendMsg base1 = WKProto.getInstance().getSendBaseMsg(msg);
|
||||||
addSendingMsg(base1);
|
addSendingMsg(base1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user