mirror of
https://github.com/WuKongIM/WuKongIMAndroidSDK
synced 2025-06-06 09:08:33 +00:00
fix:修改获取频道资料卡的问题
This commit is contained in:
parent
25caa7a067
commit
35b2d6c019
@ -22,6 +22,7 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
import java.util.concurrent.CopyOnWriteArrayList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 5/20/21 5:49 PM
|
* 5/20/21 5:49 PM
|
||||||
@ -43,7 +44,7 @@ public class ChannelManager extends BaseManager {
|
|||||||
|
|
||||||
private IRefreshChannelAvatar iRefreshChannelAvatar;
|
private IRefreshChannelAvatar iRefreshChannelAvatar;
|
||||||
private IGetChannelInfo iGetChannelInfo;
|
private IGetChannelInfo iGetChannelInfo;
|
||||||
private final List<WKChannel> wkChannelList = Collections.synchronizedList(new ArrayList<>());
|
private final CopyOnWriteArrayList<WKChannel> wkChannelList = new CopyOnWriteArrayList<>();
|
||||||
//监听刷新频道
|
//监听刷新频道
|
||||||
private ConcurrentHashMap<String, IRefreshChannel> refreshChannelMap;
|
private ConcurrentHashMap<String, IRefreshChannel> refreshChannelMap;
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@ import com.xinbida.wukongim.interfaces.ISyncConversationChat;
|
|||||||
import com.xinbida.wukongim.interfaces.ISyncConversationChatBack;
|
import com.xinbida.wukongim.interfaces.ISyncConversationChatBack;
|
||||||
import com.xinbida.wukongim.message.type.WKConnectStatus;
|
import com.xinbida.wukongim.message.type.WKConnectStatus;
|
||||||
import com.xinbida.wukongim.message.type.WKMsgContentType;
|
import com.xinbida.wukongim.message.type.WKMsgContentType;
|
||||||
|
import com.xinbida.wukongim.utils.DispatchQueuePool;
|
||||||
import com.xinbida.wukongim.utils.WKCommonUtils;
|
import com.xinbida.wukongim.utils.WKCommonUtils;
|
||||||
import com.xinbida.wukongim.utils.WKLoggerUtils;
|
import com.xinbida.wukongim.utils.WKLoggerUtils;
|
||||||
|
|
||||||
@ -41,6 +42,8 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||||||
* 最近会话管理
|
* 最近会话管理
|
||||||
*/
|
*/
|
||||||
public class ConversationManager extends BaseManager {
|
public class ConversationManager extends BaseManager {
|
||||||
|
private final DispatchQueuePool dispatchQueuePool = new DispatchQueuePool(3);
|
||||||
|
|
||||||
private final String TAG = "ConversationManager";
|
private final String TAG = "ConversationManager";
|
||||||
|
|
||||||
private ConversationManager() {
|
private ConversationManager() {
|
||||||
@ -238,7 +241,7 @@ public class ConversationManager extends BaseManager {
|
|||||||
long version = ConversationDbManager.getInstance().queryMaxVersion();
|
long version = ConversationDbManager.getInstance().queryMaxVersion();
|
||||||
String lastMsgSeqStr = ConversationDbManager.getInstance().queryLastMsgSeqs();
|
String lastMsgSeqStr = ConversationDbManager.getInstance().queryLastMsgSeqs();
|
||||||
runOnMainThread(() -> iSyncConversationChat.syncConversationChat(lastMsgSeqStr, 20, version, syncChat -> {
|
runOnMainThread(() -> iSyncConversationChat.syncConversationChat(lastMsgSeqStr, 20, version, syncChat -> {
|
||||||
new Thread(() -> saveSyncChat(syncChat, () -> iSyncConversationChatBack.onBack(syncChat))).start();
|
dispatchQueuePool.execute(() -> saveSyncChat(syncChat, () -> iSyncConversationChatBack.onBack(syncChat)));
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -220,11 +220,6 @@ class WKProto {
|
|||||||
receivedMsg.topicID = wkRead.readString();
|
receivedMsg.topicID = wkRead.readString();
|
||||||
}
|
}
|
||||||
String content = wkRead.readPayload();
|
String content = wkRead.readPayload();
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
WKLoggerUtils.getInstance().e(TAG, "消息payload:" + content);
|
|
||||||
receivedMsg.payload = CryptoUtils.getInstance().aesDecrypt(CryptoUtils.getInstance().base64Decode(content));
|
|
||||||
>>>>>>> 9978523a9a818731b66c2409ff4c0cba70fab46f
|
|
||||||
String msgKey = receivedMsg.messageID
|
String msgKey = receivedMsg.messageID
|
||||||
+ receivedMsg.messageSeq
|
+ receivedMsg.messageSeq
|
||||||
+ receivedMsg.clientMsgNo
|
+ receivedMsg.clientMsgNo
|
||||||
@ -239,13 +234,13 @@ class WKProto {
|
|||||||
}
|
}
|
||||||
String base64Result = CryptoUtils.getInstance().base64Encode(result);
|
String base64Result = CryptoUtils.getInstance().base64Encode(result);
|
||||||
String localMsgKey = CryptoUtils.getInstance().digestMD5(base64Result);
|
String localMsgKey = CryptoUtils.getInstance().digestMD5(base64Result);
|
||||||
WKLoggerUtils.getInstance().e("Receive message:");
|
|
||||||
WKLoggerUtils.getInstance().e(receivedMsg.toString());
|
|
||||||
if (!localMsgKey.equals(receivedMsg.msgKey)) {
|
if (!localMsgKey.equals(receivedMsg.msgKey)) {
|
||||||
WKLoggerUtils.getInstance().e("Illegal messages,localMsgKey:" + localMsgKey + ",msgKey:" + msgKey);
|
WKLoggerUtils.getInstance().e("Illegal messages,localMsgKey:" + localMsgKey + ",msgKey:" + msgKey);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
receivedMsg.payload = CryptoUtils.getInstance().aesDecrypt(CryptoUtils.getInstance().base64Decode(content));
|
receivedMsg.payload = CryptoUtils.getInstance().aesDecrypt(CryptoUtils.getInstance().base64Decode(content));
|
||||||
|
WKLoggerUtils.getInstance().e("Receive message:");
|
||||||
|
WKLoggerUtils.getInstance().e(receivedMsg.toString());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
WKLoggerUtils.getInstance().e(TAG, "deReceivedMsg Decoding received message error");
|
WKLoggerUtils.getInstance().e(TAG, "deReceivedMsg Decoding received message error");
|
||||||
}
|
}
|
||||||
|
@ -102,12 +102,8 @@ public class CryptoUtils {
|
|||||||
} catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException |
|
} catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException |
|
||||||
InvalidAlgorithmParameterException | IllegalBlockSizeException |
|
InvalidAlgorithmParameterException | IllegalBlockSizeException |
|
||||||
BadPaddingException e) {
|
BadPaddingException e) {
|
||||||
<<<<<<< HEAD
|
WKLoggerUtils.getInstance().e(TAG,"aesEncrypt encrypt error");
|
||||||
WKLoggerUtils.getInstance().e(TAG,"aesEncrypt encrypt error");
|
return null;
|
||||||
return null;
|
|
||||||
=======
|
|
||||||
WKLoggerUtils.getInstance().e(TAG, "aesEncrypt encrypt error");
|
|
||||||
>>>>>>> 9978523a9a818731b66c2409ff4c0cba70fab46f
|
|
||||||
}
|
}
|
||||||
if (encrypted == null) {
|
if (encrypted == null) {
|
||||||
WKLoggerUtils.getInstance().e(TAG, "aesEncrypt The encrypted data is empty");
|
WKLoggerUtils.getInstance().e(TAG, "aesEncrypt The encrypted data is empty");
|
||||||
@ -143,7 +139,7 @@ public class CryptoUtils {
|
|||||||
|
|
||||||
|
|
||||||
public byte[] base64Decode(String data) {
|
public byte[] base64Decode(String data) {
|
||||||
return Base64.decode(data, Base64.NO_WRAP);
|
return Base64.decode(data, Base64.NO_WRAP);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user