mirror of
https://github.com/correl/SleekXMPP.git
synced 2024-11-24 03:00:15 +00:00
fixed updateRoster and delRosterItem
This commit is contained in:
parent
a38735cb2a
commit
bae082f437
1 changed files with 8 additions and 1 deletions
|
@ -146,11 +146,18 @@ 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."""
|
||||
iq = self.Iq().setValues({'type': 'get'}).enable('roster').send()
|
||||
|
|
Loading…
Reference in a new issue