def join(self, roomJID, nick, historyOptions=None, password=None):
    '\n        Join a MUC room by sending presence to it.\n\n        @param roomJID: The JID of the room the entity is joining.\n        @type roomJID: L{JID<twisted.words.protocols.jabber.jid.JID>}\n\n        @param nick: The nick name for the entitity joining the room.\n        @type nick: C{unicode}\n\n        @param historyOptions: Options for conversation history sent by the\n            room upon joining.\n        @type historyOptions: L{HistoryOptions}\n\n        @param password: Optional password for the room.\n        @type password: C{unicode}\n\n        @return: A deferred that fires with the room when the entity is in the\n            room, or with a failure if an error has occurred.\n        '

    def cb(presence):
        '\n            We have presence that says we joined a room.\n            '
        if (STATUS_CODE.ROOM_CREATED in presence.mucStatuses):
            room.locked = True
        return room

    def eb(failure):
        self._removeRoom(roomJID)
        return failure
    room = Room(roomJID, nick)
    self._addRoom(room)
    d = MUCClientProtocol.join(self, roomJID, nick, historyOptions, password)
    d.addCallbacks(cb, eb)
    return d
Join a MUC room by sending presence to it.

@param roomJID: The JID of the room the entity is joining.
@type roomJID: L{JID<twisted.words.protocols.jabber.jid.JID>}

@param nick: The nick name for the entitity joining the room.
@type nick: C{unicode}

@param historyOptions: Options for conversation history sent by the
    room upon joining.
@type historyOptions: L{HistoryOptions}

@param password: Optional password for the room.
@type password: C{unicode}

@return: A deferred that fires with the room when the entity is in the
    room, or with a failure if an error has occurred.
def join(self, roomJID, nick, historyOptions=None, password=None):
    '\n        Join a MUC room by sending presence to it.\n\n        @param roomJID: The JID of the room the entity is joining.\n        @type roomJID: L{JID<twisted.words.protocols.jabber.jid.JID>}\n\n        @param nick: The nick name for the entitity joining the room.\n        @type nick: C{unicode}\n\n        @param historyOptions: Options for conversation history sent by the\n            room upon joining.\n        @type historyOptions: L{HistoryOptions}\n\n        @param password: Optional password for the room.\n        @type password: C{unicode}\n\n        @return: A deferred that fires with the room when the entity is in the\n            room, or with a failure if an error has occurred.\n        '

    def cb(presence):
        '\n            We have presence that says we joined a room.\n            '
        if (STATUS_CODE.ROOM_CREATED in presence.mucStatuses):
            room.locked = True
        return room

    def eb(failure):
        self._removeRoom(roomJID)
        return failure
    room = Room(roomJID, nick)
    self._addRoom(room)
    d = MUCClientProtocol.join(self, roomJID, nick, historyOptions, password)
    d.addCallbacks(cb, eb)
    return d