def availableReceived(self, presence):
    '\n        Available presence was received.\n        '
    (room, user) = self._getRoomUser(presence)
    if (room is None):
        return
    if (user is None):
        nick = presence.sender.resource
        user = User(nick, presence.entity)
    user.status = presence.status
    user.show = presence.show
    if room.inRoster(user):
        self.userUpdatedStatus(room, user, presence.show, presence.status)
    else:
        room.addUser(user)
        self.userJoinedRoom(room, user)
Available presence was received.
def availableReceived(self, presence):
    '\n        \n        '
    (room, user) = self._getRoomUser(presence)
    if (room is None):
        return
    if (user is None):
        nick = presence.sender.resource
        user = User(nick, presence.entity)
    user.status = presence.status
    user.show = presence.show
    if room.inRoster(user):
        self.userUpdatedStatus(room, user, presence.show, presence.status)
    else:
        room.addUser(user)
        self.userJoinedRoom(room, user)