diff --git a/client/src/main/java/cn/wildfirechat/remote/ChatManager.java b/client/src/main/java/cn/wildfirechat/remote/ChatManager.java index 6acd3cb8c..b69665728 100644 --- a/client/src/main/java/cn/wildfirechat/remote/ChatManager.java +++ b/client/src/main/java/cn/wildfirechat/remote/ChatManager.java @@ -132,8 +132,6 @@ public class ChatManager { private LruCache userInfoCache; // key = memberId@groupId private LruCache groupMemberCache; - // key = userId@groupId - private LruCache groupUserCache; public enum PushType { Xiaomi(1), @@ -388,7 +386,6 @@ private void onGroupMembersUpdate(String groupId, List groupMembers } for (GroupMember member : groupMembers) { groupMemberCache.remove(groupMemberCacheKey(groupId, member.memberId)); - groupUserCache.remove(groupMemberCacheKey(groupId, member.memberId)); } mainHandler.post(() -> { for (OnGroupMembersUpdateListener listener : groupMembersUpdateListeners) { @@ -1179,7 +1176,6 @@ public boolean connect(String userId, String token) { this.token = token; this.userInfoCache = new LruCache<>(1024); this.groupMemberCache = new LruCache<>(1024); - this.groupUserCache = new LruCache<>(1024); if (mClient != null) { try { @@ -2411,11 +2407,9 @@ public UserInfo getUserInfo(String userId, String groupId, boolean refresh) { if (TextUtils.isEmpty(userId)) { return null; } - UserInfo userInfo; + UserInfo userInfo = null; if (!refresh) { - if (!TextUtils.isEmpty(groupId)) { - userInfo = groupUserCache.get(groupMemberCacheKey(groupId, userId)); - } else { + if (TextUtils.isEmpty(groupId)) { userInfo = userInfoCache.get(userId); } if (userInfo != null) { @@ -2441,8 +2435,6 @@ public UserInfo getUserInfo(String userId, String groupId, boolean refresh) { } else { if (TextUtils.isEmpty(groupId)) { userInfoCache.put(userId, userInfo); - } else { - groupUserCache.put(groupMemberCacheKey(groupId, userId), userInfo); } } return userInfo; @@ -2491,8 +2483,6 @@ public List getUserInfos(List userIds, String groupId) { if (info != null) { if (TextUtils.isEmpty(groupId)) { userInfoCache.put(info.uid, info); - } else { - groupUserCache.put(groupMemberCacheKey(groupId, info.uid), info); } } } @@ -3059,7 +3049,6 @@ public void onSuccess() throws RemoteException { @Override public void run() { groupMemberCache.remove(groupMemberCacheKey(groupId, userId)); - groupUserCache.remove(groupMemberCacheKey(groupId, userId)); callback.onSuccess(); } });