/** * Notification that a Group user has been added. Update the group users' roster accordingly. * * @param group the group where the user was added. * @param addedUser the username of the user that has been added to the group. */ private void groupUserAdded(Group group, JID addedUser) { groupUserAdded(group, getAffectedUsers(group), addedUser); }
/** * Notification that a Group user has been deleted. Update the group users' roster accordingly. * * @param group the group from where the user was deleted. * @param deletedUser the username of the user that has been deleted from the group. */ private void groupUserDeleted(Group group, JID deletedUser) { groupUserDeleted(group, getAffectedUsers(group), deletedUser); }
@Override public void groupDeleting(Group group, Map params) { // Get group members Collection<JID> users = new HashSet<>(group.getMembers()); users.addAll(group.getAdmins()); // Get users whose roster will be updated Collection<JID> affectedUsers = getAffectedUsers(group); // Iterate on group members and update rosters of affected users for (JID deletedUser : users) { groupUserDeleted(group, affectedUsers, deletedUser); } }
/** * Returns all the users that are related to a shared group. This is the logic that we are * using: 1) If the group visiblity is configured as "Everybody" then all users in the system or * all logged users in the system will be returned (configurable thorugh the "filterOffline" * flag), 2) if the group visiblity is configured as "onlyGroup" then all the group users will * be included in the answer and 3) if the group visiblity is configured as "onlyGroup" and * the group allows other groups to include the group in the groups users' roster then all * the users of the allowed groups will be included in the answer. */ private Collection<JID> getAffectedUsers(Group group) { return getAffectedUsers(group, group.getProperties().get("sharedRoster.showInRoster"), group.getProperties().get("sharedRoster.groupList")); }
users.addAll(group.getAdmins()); Collection<JID> affectedUsers = getAffectedUsers(group, originalValue, group.getProperties().get("sharedRoster.groupList")); users.addAll(group.getAdmins()); Collection<JID> affectedUsers = getAffectedUsers(group, group.getProperties().get("sharedRoster.showInRoster"), originalValue); Collection<JID> users = getAffectedUsers(group);
/** * Notification that a Group user has been added. Update the group users' roster accordingly. * * @param group the group where the user was added. * @param addedUser the username of the user that has been added to the group. */ private void groupUserAdded(Group group, JID addedUser) { groupUserAdded(group, getAffectedUsers(group), addedUser); }
/** * Notification that a Group user has been deleted. Update the group users' roster accordingly. * * @param group the group from where the user was deleted. * @param deletedUser the username of the user that has been deleted from the group. */ private void groupUserDeleted(Group group, JID deletedUser) { groupUserDeleted(group, getAffectedUsers(group), deletedUser); }
@Override public void groupDeleting(Group group, Map params) { // Get group members Collection<JID> users = new HashSet<>(group.getMembers()); users.addAll(group.getAdmins()); // Get users whose roster will be updated Collection<JID> affectedUsers = getAffectedUsers(group); // Iterate on group members and update rosters of affected users for (JID deletedUser : users) { groupUserDeleted(group, affectedUsers, deletedUser); } }
/** * Returns all the users that are related to a shared group. This is the logic that we are * using: 1) If the group visiblity is configured as "Everybody" then all users in the system or * all logged users in the system will be returned (configurable thorugh the "filterOffline" * flag), 2) if the group visiblity is configured as "onlyGroup" then all the group users will * be included in the answer and 3) if the group visiblity is configured as "onlyGroup" and * the group allows other groups to include the group in the groups users' roster then all * the users of the allowed groups will be included in the answer. */ private Collection<JID> getAffectedUsers(Group group) { return getAffectedUsers(group, group.getProperties().get("sharedRoster.showInRoster"), group.getProperties().get("sharedRoster.groupList")); }
users.addAll(group.getAdmins()); Collection<JID> affectedUsers = getAffectedUsers(group, originalValue, group.getProperties().get("sharedRoster.groupList")); users.addAll(group.getAdmins()); Collection<JID> affectedUsers = getAffectedUsers(group, group.getProperties().get("sharedRoster.showInRoster"), originalValue); Collection<JID> users = getAffectedUsers(group);