/**
  * Copy to groups.
  *
  * @param currentUser the current user
  * @param newUser the new user
  */
 private static void copyToGroups(String currentUser, String newUser) {
   GroupManager groupManager = GroupManager.getInstance();
   for (Group group : groupManager.getGroups()) {
     if (group.isUser(currentUser)) {
       group.getMembers().add(XMPPServer.getInstance().createJID(newUser, null));
     }
   }
 }
Ejemplo n.º 2
0
 public void addUserToGroup(String userJid, String groupName) throws GroupNotFoundException {
   log.debug("addUserToGroup " + userJid + " GroupName " + groupName);
   JID jid = new JID(userJid);
   Group group = groupManager.getGroup(groupName, true);
   if (group.getAdmins().contains(jid)) {
     log.debug("Admins already has " + jid);
   } else {
     group.getMembers().add(jid);
   }
 }
Ejemplo n.º 3
0
 public void removeUserFromGroup(String userJid, String groupName) throws GroupNotFoundException {
   JID jid = new JID(userJid);
   Group group = groupManager.getGroup(groupName, true);
   group.getMembers().remove(jid);
   group.getAdmins().remove(jid);
 }