Skip to content

Commit

Permalink
Update for pull request #194
Browse files Browse the repository at this point in the history
  • Loading branch information
Anckermann authored and guusdk committed Jun 25, 2024
1 parent 965d4d4 commit 9d7024d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 18 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>plugins</artifactId>
<groupId>org.igniterealtime.openfire</groupId>
<version>4.8.1</version>
<version>4.8.0</version>
</parent>
<groupId>org.igniterealtime.openfire.plugins</groupId>
<artifactId>restAPI</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ private static void addNewUserToOthersRoster(User newUser, RosterItem otherItem,

// Is this user registered with our OF server?
String username = otherItem.getJid().getNode();
if (username != null && username.length() > 0 && userManager.isRegisteredUser(otherItem.getJid(), true)
if (username != null && username.length() > 0 && userManager.isRegisteredUser(otherItem.getJid(), false)
&& XMPPServer.getInstance().isLocal(XMPPServer.getInstance().createJID(currentUser, null))) {
try {
User otherUser = userManager.getUser(username);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
import org.jivesoftware.openfire.user.UserAlreadyExistsException;
import org.jivesoftware.openfire.user.UserManager;
import org.jivesoftware.openfire.user.UserNotFoundException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.xmpp.packet.JID;

/**
Expand All @@ -44,6 +46,7 @@
* @author Justin Hunt
*/
public class UserServiceLegacyController {
private static final Logger LOG = LoggerFactory.getLogger(UserServiceLegacyController.class);

/** The Constant INSTANCE. */
public static final UserServiceLegacyController INSTANCE = new UserServiceLegacyController();
Expand Down Expand Up @@ -107,15 +110,15 @@ public void createUser(String username, String password, String name, String ema
} catch (GroupNotFoundException e) {
// Create this group ;
try {
group = GroupManager.getInstance().createGroup(groupName);
group.getProperties().put("sharedRoster.showInRoster", "nobody");
group.getProperties().put("sharedRoster.displayName", groupName);
group.getProperties().put("sharedRoster.groupList", "");
group = GroupManager.getInstance().createGroup(groupName);
group.getProperties().put("sharedRoster.showInRoster", "nobody");
group.getProperties().put("sharedRoster.displayName", groupName);
group.getProperties().put("sharedRoster.groupList", "");
} catch (GroupAlreadyExistsException e1) {
e1.printStackTrace();
} catch (GroupNameInvalidException e1) {
e1.printStackTrace();
}
LOG.error(e1.getMessage(), e1);
} catch (GroupNameInvalidException e1) {
LOG.error(e1.getMessage(), e1);
}
}
groups.add(group);
}
Expand Down Expand Up @@ -195,15 +198,15 @@ public void updateUser(String username, String password, String name, String ema
} catch (GroupNotFoundException e) {
// Create this group ;
try {
group = GroupManager.getInstance().createGroup(groupName);
group.getProperties().put("sharedRoster.showInRoster", "nobody");
group.getProperties().put("sharedRoster.displayName", groupName);
group.getProperties().put("sharedRoster.groupList", "");
group = GroupManager.getInstance().createGroup(groupName);
group.getProperties().put("sharedRoster.showInRoster", "nobody");
group.getProperties().put("sharedRoster.displayName", groupName);
group.getProperties().put("sharedRoster.groupList", "");
} catch (GroupAlreadyExistsException e1) {
e1.printStackTrace();
} catch (GroupNameInvalidException e1) {
e1.printStackTrace();
}
LOG.error(e1.getMessage(), e1);
} catch (GroupNameInvalidException e1) {
LOG.error(e1.getMessage(), e1);
}
}

newGroups.add(group);
Expand Down

0 comments on commit 9d7024d

Please sign in to comment.