diff options
Diffstat (limited to 'sleekxmpp/__init__.py')
-rw-r--r-- | sleekxmpp/__init__.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sleekxmpp/__init__.py b/sleekxmpp/__init__.py index ccb43522..df0af09c 100644 --- a/sleekxmpp/__init__.py +++ b/sleekxmpp/__init__.py @@ -146,10 +146,16 @@ class ClientXMPP(basexmpp, XMLStream): def updateRoster(self, jid, name=None, subscription=None, groups=[]): """Add or change a roster item.""" iq = self.Iq().setValues({'type': 'set'}) - iq['roster'] = {jid: {'name': name, 'subscription': subscription, 'groups': groups}} + iq['roster']['items'] = {jid: {'name': name, 'subscription': subscription, 'groups': groups}} #self.send(iq, self.Iq().setValues({'id': iq['id']})) r = iq.send() return r['type'] == 'result' + + def delRosterItem(self, jid): + iq = self.Iq() + iq['type'] = 'set' + iq['roster']['items'] = {jid: {'subscription': 'remove'}} + return iq.send()['type'] == 'result' def getRoster(self): """Request the roster be sent.""" |