From bae082f4370c37c4aca0afc303b2d98b22582a34 Mon Sep 17 00:00:00 2001 From: Nathan Fritz Date: Thu, 15 Jul 2010 11:53:35 -0700 Subject: [PATCH] fixed updateRoster and delRosterItem --- sleekxmpp/__init__.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sleekxmpp/__init__.py b/sleekxmpp/__init__.py index ccb4352..35df620 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."""