summaryrefslogtreecommitdiff
path: root/sleekxmpp/__init__.py
diff options
context:
space:
mode:
authorNathan Fritz <nathan@andyet.net>2010-07-15 11:53:35 -0700
committerNathan Fritz <nathan@andyet.net>2010-07-15 11:53:35 -0700
commitbae082f4370c37c4aca0afc303b2d98b22582a34 (patch)
tree3229ca136307e0f8a213a15f8a2f241124d325d3 /sleekxmpp/__init__.py
parenta38735cb2adabb75f110669d5425bf389cfc7ab7 (diff)
downloadslixmpp-bae082f4370c37c4aca0afc303b2d98b22582a34.tar.gz
slixmpp-bae082f4370c37c4aca0afc303b2d98b22582a34.tar.bz2
slixmpp-bae082f4370c37c4aca0afc303b2d98b22582a34.tar.xz
slixmpp-bae082f4370c37c4aca0afc303b2d98b22582a34.zip
fixed updateRoster and delRosterItem
Diffstat (limited to 'sleekxmpp/__init__.py')
-rw-r--r--sleekxmpp/__init__.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/sleekxmpp/__init__.py b/sleekxmpp/__init__.py
index ccb43522..35df6206 100644
--- a/sleekxmpp/__init__.py
+++ b/sleekxmpp/__init__.py
@@ -146,10 +146,17 @@ 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']}))
+ return
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."""