Changeset 155:8b2ed9549399 for wokkel


Ignore:
Timestamp:
Nov 10, 2011, 9:55:59 AM (8 years ago)
Author:
Ralph Meijer <ralphm@…>
Branch:
wokkel-muc-client-support-24
Parents:
154:e016bb963410 (diff), 105:5d8f1609aaf3 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge in tip changes.

Location:
wokkel
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • wokkel/disco.py

    r134 r155  
    210210                item = data_form.Form.fromElement(child)
    211211
    212             if item:
     212            if item is not None:
    213213                info.append(item)
    214214
  • wokkel/iwokkel.py

    r96 r155  
    1 # Copyright (c) Ralph Meijer.
     1# Copyright (c) Ralph Meijer
    22# See LICENSE for details.
    33
     
    770770
    771771
    772     def affiliationsGet(request):
    773         """
    774         Called when a affiliations retrieval request (owner) has been received.
    775 
    776         @param request: The publish-subscribe request.
    777         @type request: L{wokkel.pubsub.PubSubRequest}
    778         @return: A deferred that fires with a C{dict} of affiliations with the
    779             entity as key (L{JID}) and the affiliation state as value
    780             (C{unicode}).  The affiliation can be C{u'owner'}, C{u'publisher'},
    781             or C{u'outcast'}.
    782         @rtype: L{defer.Deferred}
    783 
    784         @note: Affiliations are always on the bare JID. An implementation of
    785         this method MUST NOT return JIDs with a resource part.
    786         """
    787 
    788 
    789     def affiliationsSet(request):
    790         """
    791         Called when a affiliations modify request has been received.
    792 
    793         @param request: The publish-subscribe request.
    794         @type request: L{wokkel.pubsub.PubSubRequest}
    795         @return: A deferred that fires with C{None} when the affiliation
    796             changes were succesfully processed..
    797         @rtype: L{defer.Deferred}
    798 
    799         @note: Affiliations are always on the bare JID. The JIDs in
    800         L{wokkel.pubsub.PubSubRequest.affiliations} are already stripped of
    801         any resource.
    802         """
     772
     773class IMUCClient(Interface):
     774    """
     775    Multi-User Chat Client
     776
     777    A client interface to XEP-045 : http://xmpp.org/extensions/xep-0045.html
     778
     779    """
     780
     781    def receivedSubject(room, user, subject):
     782        """
     783        A subject is received when you join a room and when the subject is changed. This
     784        method is triggered by one of those two events.
     785
     786        @param room: The room the subject was accepted for.
     787        @type room: L{muc.Room}
     788
     789        @param user: The user that set the subject.
     790        @type  user: L{muc.User}
     791
     792        @param subject: The subject of the given room.
     793        @type subject: C{unicode}
     794        """
     795
     796
     797    def receivedHistory(room, user, message):
     798        """
     799        Past messages from a chat room has been received. This occurs when you join a room.
     800        """
     801
     802
     803    def configure(roomJID, options):
     804        """
     805        Configure a room.
     806
     807        @param roomJID: The room to configure.
     808        @type roomJID: L{jid.JID}
     809
     810        @param options: A mapping of field names to values, or C{None} to cancel.
     811        @type options: C{dict}
     812        """
     813
     814
     815    def getConfiguration(roomJID):
     816        """
     817        Grab the configuration from the room.
     818
     819        This sends an iq request to the room.
     820
     821        @param roomJID: The bare JID of the room.
     822        @type roomJID: L{jid.JID}
     823
     824        @return: A deferred that fires with the room's configuration form as
     825            a L{data_form.Form} or C{None} if there are no configuration
     826            options available.
     827        """
     828
     829
     830    def join(roomJID, nick, historyOptions=None, password=None):
     831        """
     832        Join a MUC room by sending presence to it.
     833
     834        @param roomJID: The JID of the room the entity is joining.
     835        @type roomJID: L{jid.JID}
     836
     837        @param nick: The nick name for the entitity joining the room.
     838        @type nick: C{unicode}
     839
     840        @param historyOptions: Options for conversation history sent by the
     841            room upon joining.
     842        @type historyOptions: L{HistoryOptions}
     843
     844        @param password: Optional password for the room.
     845        @type password: C{unicode}
     846
     847        @return: A deferred that fires when the entity is in the room or an
     848                 error has occurred.
     849        """
     850
     851
     852    def nick(roomJID, nick):
     853        """
     854        Change an entity's nick name in a MUC room.
     855
     856        See: http://xmpp.org/extensions/xep-0045.html#changenick
     857
     858        @param roomJID: The JID of the room, i.e. without a resource.
     859        @type roomJID: L{jid.JID}
     860
     861        @param nick: The new nick name within the room.
     862        @type nick: C{unicode}
     863        """
     864
     865
     866    def leave(roomJID):
     867        """
     868        Leave a MUC room.
     869
     870        See: http://xmpp.org/extensions/xep-0045.html#exit
     871
     872        @param roomJID: The Room JID of the room to leave.
     873        @type roomJID: L{jid.JID}
     874        """
     875
     876
     877    def userJoinedRoom(room, user):
     878        """
     879        User has joined a MUC room.
     880
     881        This method will need to be modified inorder for clients to
     882        do something when this event occurs.
     883
     884        @param room: The room the user joined.
     885        @type  room: L{muc.Room}
     886
     887        @param user: The user that joined the room.
     888        @type  user: L{muc.User}
     889        """
     890
     891
     892    def groupChat(roomJID, body):
     893        """
     894        Send a groupchat message.
     895        """
     896
     897
     898    def chat(occupantJID, body):
     899        """
     900        Send a private chat message to a user in a MUC room.
     901
     902        See: http://xmpp.org/extensions/xep-0045.html#privatemessage
     903
     904        @param occupantJID: The Room JID of the other user.
     905        @type occupantJID: L{jid.JID}
     906        """
     907
     908
     909    def register(roomJID, options):
     910        """
     911        Send a request to register for a room.
     912
     913        @param roomJID: The bare JID of the room.
     914        @type roomJID: L{jid.JID}
     915
     916        @param options: A mapping of field names to values, or C{None} to
     917            cancel.
     918        @type options: C{dict}
     919        """
     920
     921
     922    def subject(roomJID, subject):
     923        """
     924        Change the subject of a MUC room.
     925
     926        See: http://xmpp.org/extensions/xep-0045.html#subject-mod
     927
     928        @param roomJID: The bare JID of the room.
     929        @type roomJID: L{jid.JID}
     930
     931        @param subject: The subject you want to set.
     932        @type subject: C{unicode}
     933        """
     934
     935
     936    def voice(roomJID):
     937        """
     938        Request voice for a moderated room.
     939
     940        @param roomJID: The room jabber/xmpp entity id.
     941        @type roomJID: L{jid.JID}
     942        """
     943
     944
     945    def history(roomJID, messages):
     946        """
     947        Send history to create a MUC based on a one on one chat.
     948
     949        See: http://xmpp.org/extensions/xep-0045.html#continue
     950
     951        @param roomJID: The room jabber/xmpp entity id.
     952        @type roomJID: L{jid.JID}
     953
     954        @param messages: The history to send to the room as an ordered list of
     955                         message, represented by a dictionary with the keys
     956                         C{'stanza'}, holding the original stanza a
     957                         L{domish.Element}, and C{'timestamp'} with the
     958                         timestamp.
     959        @type messages: L{list} of L{domish.Element}
     960        """
     961
     962
     963    def ban(roomJID, entity, reason=None, sender=None):
     964        """
     965        Ban a user from a MUC room.
     966
     967        @param roomJID: The bare JID of the room.
     968        @type roomJID: L{jid.JID}
     969
     970        @param entity: The bare JID of the entity to be banned.
     971        @type entity: L{jid.JID}
     972
     973        @param reason: The reason for banning the entity.
     974        @type reason: C{unicode}
     975
     976        @param sender: The entity sending the request.
     977        @type sender: L{jid.JID}
     978        """
     979
     980
     981    def kick(roomJID, nick, reason=None, sender=None):
     982        """
     983        Kick a user from a MUC room.
     984
     985        @param roomJID: The bare JID of the room.
     986        @type roomJID: L{jid.JID}
     987
     988        @param nick: The occupant to be banned.
     989        @type nick: L{jid.JID} or C{unicode}
     990
     991        @param reason: The reason given for the kick.
     992        @type reason: C{unicode}
     993
     994        @param sender: The entity sending the request.
     995        @type sender: L{jid.JID}
     996        """
  • wokkel/iwokkel.py

    r153 r155  
    1 # Copyright (c) 2003-2008 Ralph Meijer
     1# Copyright (c) Ralph Meijer
    22# See LICENSE for details.
    33
  • wokkel/muc.py

    r154 r155  
    7575            form.makeFields(self.options)
    7676
    77         if form:
     77        if form is not None:
    7878            query.addChild(form.toElement())
    7979
Note: See TracChangeset for help on using the changeset viewer.