Ignore:
Timestamp:
Jul 28, 2008, 5:07:40 PM (14 years ago)
Author:
Ralph Meijer <ralphm@…>
Branch:
default
Convert:
svn:b33ecbfc-034c-dc11-8662-000475d9059e/trunk@58
Message:

Add client side support for removing a roster item.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wokkel/xmppim.py

    r12 r28  
    328328        return d
    329329
     330
     331    def removeItem(self, entity):
     332        """
     333        Remove an item from the contact list.
     334
     335        @param entity: The contact to remove the roster item for.
     336        @type entity: L{JID<twisted.words.protocols.jabber.jid.JID>}
     337        @rtype: L{twisted.internet.defer.Deferred}
     338        """
     339        iq = IQ(self.xmlstream, 'set')
     340        iq.addElement((NS_ROSTER, 'query'))
     341        item = iq.query.addElement('item')
     342        item['jid'] = entity.full()
     343        item['subscription'] = 'remove'
     344        return iq.send()
     345
     346
    330347    def _onRosterSet(self, iq):
    331348        if iq.handled or \
Note: See TracChangeset for help on using the changeset viewer.