public void nicknameChanged(MUCOccupant occupant, Presence newPresence, String oldNick, String newNick)
    {
        List<MUCOccupant> occupants;
        try {
            occupants = getOccupantsByNickname(oldNick);
        } catch (UserNotFoundException e) {
            Log.debug("Unable to process nickname change from old '{}' to new '{}' for occupant '{}' as no occupant with the old nickname is found.", oldNick, newNick, occupant, e);
            return;
        }

        for (MUCOccupant occ : occupants) {
            // Update the role with the new info
            occ.setPresence(newPresence);
            occ.changeNickname(newNick);

            // Fire event that user changed his nickname
            MUCEventDispatcher.nicknameChanged(getSelfRepresentation().getOccupantJID(), occ.getUserAddress(), oldNick, newNick);
        }

        // Broadcast new presence of occupant
        broadcastPresence(occupant.getPresence(), false, occupant);
    }
An event callback fired whenever an occupant changes his nickname within the chatroom.

@param occupant occupant that changed his nickname in the room (cannot be {@code null}).
@param newPresence presence sent by the occupant with the new nickname (cannot be {@code null}).
@param oldNick old nickname within the room (cannot be {@code null}).
@param newNick new nickname within the room (cannot be {@code null}).
xmppserver/src/main/java/org/jivesoftware/openfire/muc/MUCRoom.java