public void presenceUpdated(final MUCOccupant occupant, final Presence newPresence) {
        final String occupantNickName = occupant.getNickname();

        try {
            List<MUCOccupant> occupants = getOccupantsByNickname(occupantNickName);
            for (MUCOccupant occ : occupants) {
                occ.setPresence(newPresence.createCopy());
            }
        } catch (UserNotFoundException e) {
            Log.debug("Failed to update presence of room occupant. Occupant nickname: {}", occupantNickName, e);
        }

        // Get the new, updated presence for the occupant in the room. The presence reflects the occupant's updated
        // availability and their existing association.
        final Presence updatedPresence = occupant.getPresence();

        // Broadcast updated presence of occupant.
        broadcastPresence(updatedPresence, false, occupant);
    }
An event callback fired whenever an occupant updated his presence in the chatroom.

Handles occupants updating their presence in the chatroom. Assumes the user updates their presence whenever their
availability in the room changes. This method should not be called to handle other presence related updates, such
as nickname changes.

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