Commit 88f85551 authored by akrherz's avatar akrherz

Revert "OF-867 Wrong key in groupMetaCache evict"

This reverts commit ffe14c90 and hopefully resolves OF-1263 and OF-1269
parent 8f1ac77c
...@@ -171,7 +171,9 @@ public class GroupManager { ...@@ -171,7 +171,9 @@ public class GroupManager {
// Remove only the collection of groups the member belongs to. // Remove only the collection of groups the member belongs to.
String member = (String) params.get("member"); String member = (String) params.get("member");
evictCachedUserForGroup(member); if(member != null) {
groupMetaCache.remove(member);
}
} }
@Override @Override
...@@ -182,7 +184,9 @@ public class GroupManager { ...@@ -182,7 +184,9 @@ public class GroupManager {
// Remove only the collection of groups the member belongs to. // Remove only the collection of groups the member belongs to.
String member = (String) params.get("member"); String member = (String) params.get("member");
evictCachedUserForGroup(member); if(member != null) {
groupMetaCache.remove(member);
}
} }
@Override @Override
...@@ -193,7 +197,9 @@ public class GroupManager { ...@@ -193,7 +197,9 @@ public class GroupManager {
// Remove only the collection of groups the member belongs to. // Remove only the collection of groups the member belongs to.
String member = (String) params.get("admin"); String member = (String) params.get("admin");
evictCachedUserForGroup(member); if(member != null) {
groupMetaCache.remove(member);
}
} }
@Override @Override
...@@ -204,20 +210,11 @@ public class GroupManager { ...@@ -204,20 +210,11 @@ public class GroupManager {
// Remove only the collection of groups the member belongs to. // Remove only the collection of groups the member belongs to.
String member = (String) params.get("admin"); String member = (String) params.get("admin");
evictCachedUserForGroup(member); if(member != null) {
} groupMetaCache.remove(member);
private void evictCachedUserForGroup(String user) {
if(user != null) {
JID userJid = new JID(user);
if (XMPPServer.getInstance().isLocal(userJid)) {
String username = userJid.getNode();
synchronized (username.intern()) {
groupMetaCache.remove(username);
}
}
} }
} }
}); });
UserEventDispatcher.addListener(new UserEventListener() { UserEventDispatcher.addListener(new UserEventListener() {
...@@ -586,7 +583,7 @@ public class GroupManager { ...@@ -586,7 +583,7 @@ public class GroupManager {
* @return all groups that an entity belongs to. * @return all groups that an entity belongs to.
*/ */
public Collection<Group> getGroups(JID user) { public Collection<Group> getGroups(JID user) {
String key = user.getNode(); String key = user.toBareJID();
Collection<String> groupNames = (Collection<String>)groupMetaCache.get(key); Collection<String> groupNames = (Collection<String>)groupMetaCache.get(key);
if (groupNames == null) { if (groupNames == null) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment