source: ralphm-patches/jid_cleanup.patch @ 49:537d1413b661

Last change on this file since 49:537d1413b661 was 49:537d1413b661, checked in by Ralph Meijer <ralphm@…>, 9 years ago

Save work after moving stuff to keep from wokkel.xmppim to wokkel.im.

File size: 3.2 KB
  • wokkel/im.py

    # HG changeset patch
    # Parent c91f18811c37c85486826a8e7916333ad769dce7
    
    diff -r c91f18811c37 wokkel/im.py
    a b  
    1212All of it should eventually move to Twisted.
    1313"""
    1414
    15 from twisted.words.protocols.jabber.jid import JID
     15from twisted.words.protocols.jabber.jid import JID, internJID
    1616from twisted.words.xish import domish
    1717
    1818from wokkel.compat import IQ
     
    246246
    247247        @param recipient: Optional Recipient to which the presence should be
    248248            sent.
    249         @type recipient: {JID}
     249        @type recipient: L{JID}
    250250
    251251        @param show: Optional detailed presence information. One of C{'away'},
    252252            C{'xa'}, C{'chat'}, C{'dnd'}.
     
    271271        Send unavailable presence.
    272272
    273273        @param recipient: Optional entity to which the presence should be sent.
    274         @type recipient: {JID}
     274        @type recipient: L{JID}
    275275
    276276        @param statuses: dictionary of natural language descriptions of the
    277277            availability status, keyed by the language descriptor. A status
     
    288288        Send subscription request
    289289
    290290        @param recipient: Entity to subscribe to.
    291         @type recipient: {JID}
     291        @type recipient: L{JID}
    292292        """
    293293        presence = SubscriptionPresence(recipient=recipient, sender=sender)
    294294        presence.stanzaType = 'subscribe'
     
    300300        Send unsubscription request
    301301
    302302        @param recipient: Entity to unsubscribe from.
    303         @type recipient: {JID}
     303        @type recipient: L{JID}
    304304        """
    305305        presence = SubscriptionPresence(recipient=recipient, sender=sender)
    306306        presence.stanzaType = 'unsubscribe'
     
    312312        Send subscription confirmation.
    313313
    314314        @param recipient: Entity that subscribed.
    315         @type recipient: {JID}
     315        @type recipient: L{JID}
    316316        """
    317317        presence = SubscriptionPresence(recipient=recipient, sender=sender)
    318318        presence.stanzaType = 'subscribed'
     
    324324        Send unsubscription confirmation.
    325325
    326326        @param recipient: Entity that unsubscribed.
    327         @type recipient: {JID}
     327        @type recipient: L{JID}
    328328        """
    329329        presence = SubscriptionPresence(recipient=recipient, sender=sender)
    330330        presence.stanzaType = 'unsubscribed'
     
    336336        Send presence probe.
    337337
    338338        @param recipient: Entity to be probed.
    339         @type recipient: {JID}
     339        @type recipient: L{JID}
    340340        """
    341341        presence = ProbePresence(recipient=recipient, sender=sender)
    342342        self.send(presence.toElement())
     
    389389
    390390
    391391    def _parseRosterItem(self, element):
    392         jid = JID(element['jid'])
     392        jid = internJID(element['jid'])
    393393        item = RosterItem(jid)
    394394        item.name = element.getAttribute('name')
    395395        subscription = element.getAttribute('subscription')
     
    453453        itemElement = iq.query.item
    454454
    455455        if unicode(itemElement['subscription']) == 'remove':
    456             self.onRosterRemove(JID(itemElement['jid']))
     456            self.onRosterRemove(internJID(itemElement['jid']))
    457457        else:
    458458            item = self._parseRosterItem(iq.query.item)
    459459            self.onRosterSet(item)
Note: See TracBrowser for help on using the repository browser.