mirror of
https://github.com/correl/SleekXMPP.git
synced 2024-11-27 19:19:54 +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,10 +146,17 @@ class ClientXMPP(basexmpp, XMLStream):
|
||||||
def updateRoster(self, jid, name=None, subscription=None, groups=[]):
|
def updateRoster(self, jid, name=None, subscription=None, groups=[]):
|
||||||
"""Add or change a roster item."""
|
"""Add or change a roster item."""
|
||||||
iq = self.Iq().setValues({'type': 'set'})
|
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']}))
|
#self.send(iq, self.Iq().setValues({'id': iq['id']}))
|
||||||
|
return
|
||||||
r = iq.send()
|
r = iq.send()
|
||||||
return r['type'] == 'result'
|
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):
|
def getRoster(self):
|
||||||
"""Request the roster be sent."""
|
"""Request the roster be sent."""
|
||||||
|
|
Loading…
Reference in a new issue