Ignore:
Timestamp:
Aug 18, 2011, 3:22:45 PM (11 years ago)
Author:
Ralph Meijer <ralphm@…>
Branch:
wokkel-muc-client-support-24
Message:

Split protocol and room/user administration into two classes.

This introduces MUCClientProtocol, which only contains the protocol
implementation. The only state keeping there is remembering the Occupant JID
that was used to join a room, so you can use the Room JID everywhere.

The room and user owner administration that was intertwined with the protocol
is still in MUCClient that is a subclass of MUCClientProtocol. As this
record keeping barely had proper tests, the test coverage for this class is
sub-optimal for now.

This also fixes various test cases for the pure protocol support.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wokkel/iwokkel.py

    r151 r152  
    825825
    826826
    827     def join(service, roomIdentifier, nick, history=None):
     827    def join(roomJID, nick, historyOptions=None, password=None):
    828828        """
    829829        Join a MUC room by sending presence to it.
    830830
    831         @param server: The server where the room is located.
    832         @type server: C{unicode}
    833 
    834         @param room: The room name the entity is joining.
    835         @type room: C{unicode}
     831        @param roomJID: The JID of the room the entity is joining.
     832        @type roomJID: L{jid.JID}
    836833
    837834        @param nick: The nick name for the entitity joining the room.
    838835        @type nick: C{unicode}
    839836
    840         @param history: The maximum number of history stanzas you would like.
     837        @param historyOptions: Options for conversation history sent by the
     838            room upon joining.
     839        @type historyOptions: L{HistoryOptions}
     840
     841        @param password: Optional password for the room.
     842        @type password: C{unicode}
    841843
    842844        @return: A deferred that fires when the entity is in the room or an
     
    885887
    886888
    887     def groupChat(roomJID, body, children=None):
     889    def groupChat(roomJID, body):
    888890        """
    889891        Send a groupchat message.
     
    891893
    892894
    893     def chat(occupantJID, body, children=None):
     895    def chat(occupantJID, body):
    894896        """
    895897        Send a private chat message to a user in a MUC room.
     
    899901        @param occupantJID: The Room JID of the other user.
    900902        @type occupantJID: L{jid.JID}
    901         """
    902 
    903 
    904     def password(roomJID, password):
    905         """
    906         Send a password to a room so the entity can join.
    907 
    908         See: http://xmpp.org/extensions/xep-0045.html#enter-pw
    909 
    910         @param roomJID: The bare JID of the room.
    911         @type roomJID: L{jid.JID}
    912 
    913         @param password: The MUC room password.
    914         @type password: C{unicode}
    915903        """
    916904
Note: See TracChangeset for help on using the changeset viewer.