Commit 1cea0931 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Do not send presence of group members of non-shared groups that can see shared groups. JM-745

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@4217 b35dd754-fafc-0310-a699-88a17e54d16e
parent 189d83f6
...@@ -750,23 +750,23 @@ public class RosterManager extends BasicModule implements GroupEventListener { ...@@ -750,23 +750,23 @@ public class RosterManager extends BasicModule implements GroupEventListener {
Collection<JID> users = new HashSet<JID>(group.getMembers()); Collection<JID> users = new HashSet<JID>(group.getMembers());
users.addAll(group.getAdmins()); users.addAll(group.getAdmins());
// Check if anyone can see this shared group // If the user of the roster belongs to the shared group then we should return
if ("everybody".equals(showInRoster)) { // users that need to be in the roster with subscription "from"
// If the user of the roster belongs to the public group then we should return all users if (group.isUser(roster.getUsername())) {
// in the system since they all need to be in the roster with subscription "from" // Check if anyone can see this shared group
if (group.isUser(roster.getUsername())) { if ("everybody".equals(showInRoster)) {
// Add all users in the system // Add all users in the system
for (String username : UserManager.getInstance().getUsernames()) { for (String username : UserManager.getInstance().getUsernames()) {
users.add(server.createJID(username, null)); users.add(server.createJID(username, null));
} }
} }
} else {
else { // Add the users that may see the group
// Add the users that may see the group Collection<Group> groupList = parseGroups(groupNames);
Collection<Group> groupList = parseGroups(groupNames); for (Group groupInList : groupList) {
for (Group groupInList : groupList) { users.addAll(groupInList.getMembers());
users.addAll(groupInList.getMembers()); users.addAll(groupInList.getAdmins());
users.addAll(groupInList.getAdmins()); }
} }
} }
return users; return users;
......
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