Commit bbba018f authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Fixed roster item creation for remote shared contact when roster in memory. JM-589

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@3534 b35dd754-fafc-0310-a699-88a17e54d16e
parent 1613deb8
......@@ -455,6 +455,15 @@ public class RosterManager extends BasicModule implements GroupEventListener {
roster = (Roster) CacheManager.getCache("username2roster")
.get(userToUpdate.getNode());
}
// Only update rosters in memory
if (roster != null) {
roster.addSharedUser(group, addedUser);
}
// Update the roster of the newly added group user.
if (addedUserRoster != null) {
Collection<Group> groups = GroupManager.getInstance().getGroups(userToUpdate);
addedUserRoster.addSharedUser(userToUpdate, groups, group);
}
if (!server.isLocal(addedUser)) {
// Susbcribe to the presence of the remote user. This is only necessary for
// remote users and may only work with remote users that **automatically**
......@@ -467,15 +476,6 @@ public class RosterManager extends BasicModule implements GroupEventListener {
// accept presence subscription requests
sendSubscribeRequest(addedUser, userToUpdate, true);
}
// Only update rosters in memory
if (roster != null) {
roster.addSharedUser(group, addedUser);
}
// Update the roster of the newly added group user.
if (addedUserRoster != null) {
Collection<Group> groups = GroupManager.getInstance().getGroups(userToUpdate);
addedUserRoster.addSharedUser(userToUpdate, groups, group);
}
}
}
}
......@@ -520,6 +520,15 @@ public class RosterManager extends BasicModule implements GroupEventListener {
roster = (Roster) CacheManager.getCache("username2roster")
.get(userToUpdate.getNode());
}
// Only update rosters in memory
if (roster != null) {
roster.deleteSharedUser(group, deletedUser);
}
// Update the roster of the newly deleted group user.
if (deletedUserRoster != null) {
Collection<Group> groups = GroupManager.getInstance().getGroups(userToUpdate);
deletedUserRoster.deleteSharedUser(userToUpdate, groups, group);
}
if (!server.isLocal(deletedUser)) {
// Unsusbcribe from the presence of the remote user. This is only necessary for
// remote users and may only work with remote users that **automatically**
......@@ -532,15 +541,6 @@ public class RosterManager extends BasicModule implements GroupEventListener {
// accept presence subscription requests
sendSubscribeRequest(deletedUser, userToUpdate, false);
}
// Only update rosters in memory
if (roster != null) {
roster.deleteSharedUser(group, deletedUser);
}
// Update the roster of the newly deleted group user.
if (deletedUserRoster != null) {
Collection<Group> groups = GroupManager.getInstance().getGroups(userToUpdate);
deletedUserRoster.deleteSharedUser(userToUpdate, groups, group);
}
}
}
......
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