def nick(self, roomJID, nick):
    "\n        Change an entity's nick name in a MUC room.\n\n        See: http://xmpp.org/extensions/xep-0045.html#changenick\n\n        @param roomJID: The JID of the room, i.e. without a resource.\n        @type roomJID: L{JID<twisted.words.protocols.jabber.jid.JID>}\n\n        @param nick: The new nick name within the room.\n        @type nick: C{unicode}\n        "

    def cb(presence):
        room.setNick(nick)
        return room
    room = self._getRoom(roomJID)
    d = MUCClientProtocol.nick(self, roomJID, nick)
    d.addCallback(cb)
    return d
Change an entity's nick name in a MUC room.

See: http://xmpp.org/extensions/xep-0045.html#changenick

@param roomJID: The JID of the room, i.e. without a resource.
@type roomJID: L{JID<twisted.words.protocols.jabber.jid.JID>}

@param nick: The new nick name within the room.
@type nick: C{unicode}
def nick(self, roomJID, nick):
    "\n        Change an entity's nick name in a MUC room.\n\n        See: http://xmpp.org/extensions/xep-0045.html#changenick\n\n        @param roomJID: The JID of the room, i.e. without a resource.\n        @type roomJID: L{JID<twisted.words.protocols.jabber.jid.JID>}\n\n        @param nick: The new nick name within the room.\n        @type nick: C{unicode}\n        "

    def cb(presence):
        room.setNick(nick)
        return room
    room = self._getRoom(roomJID)
    d = MUCClientProtocol.nick(self, roomJID, nick)
    d.addCallback(cb)
    return d