User name update doesn't update the roster

When I change the name of a User, the roster of its friends is not updated when the roster is built using groups.

Investigating why, I discovered that it happens because the cache is not update.

So I did this fix to update all friends roster:

β€” a/src/java/org/jivesoftware/openfire/roster/

+++ b/src/java/org/jivesoftware/openfire/roster/

@@ -591,8 +591,23 @@ public class RosterManager extends BasicModule implements GroupEventListener, Us


  • public void userModified(User user, Map<String,Object> params) {

  •    //Do nothing
  • public void userModified(User user, Map<String, Object> params) {

  •    if ("nameModified".equals(params.get("type"))) {
  •        for (Group group : getSharedGroups(user.getUsername())) {
  •            ArrayList<JID> groupUsers = new ArrayList<>();
  •            groupUsers.addAll(group.getAdmins());
  •            groupUsers.addAll(group.getMembers());
  •            for (JID groupUser : groupUsers) {
  •                String groupUsername = groupUser.getNode();
  •                synchronized ((groupUsername + " ro").intern()) {
  •                    rosterCache.remove(groupUsername);
  •                }
  •            }
  •        }
  •    }


Thanks for this bug report and proposed patch; filed as OF-868.

This seems similar to my issue Roster updates taking longer than before

I have found out, that roster updates are taking long. Some users get them quicker, some will only get them after a few hours. It’s like Openfie is doing staged updates of the rosters.