Ticket #56: patch

File patch, 809 bytes (added by nathan, 11 years ago)
  • xmppim.py

     
    668668        return iq.send()
    669669
    670670
     671    def addItem(self, entity):
     672        """
     673        Add an item to the contact list.
     674
     675        @param entity: The contact to add the roster item for.
     676        @type entity: L{JID<twisted.words.protocols.jabber.jid.JID>}
     677        @rtype: L{twisted.internet.defer.Deferred}
     678        """
     679        iq = IQ(self.xmlstream, 'set')
     680        iq.addElement((NS_ROSTER, 'query'))
     681        item = iq.query.addElement('item')
     682        item['jid'] = entity.full()
     683        return iq.send()
     684
     685
    671686    def _onRosterSet(self, iq):
    672687        if iq.handled or \
    673688           iq.hasAttribute('from') and iq['from'] != self.xmlstream: