summaryrefslogtreecommitdiff
path: root/sleekxmpp/clientxmpp.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2010-10-26 23:47:17 -0400
committerLance Stout <lancestout@gmail.com>2010-11-17 01:49:19 -0500
commit673545c7e48d86b02f811ad239ed317e4bca0bbc (patch)
tree4a9d99fdb23b5ba0bc168b371a029b353256b54b /sleekxmpp/clientxmpp.py
parent45991e47eeab97f0411139c5b1627ac6350de3d0 (diff)
downloadslixmpp-673545c7e48d86b02f811ad239ed317e4bca0bbc.tar.gz
slixmpp-673545c7e48d86b02f811ad239ed317e4bca0bbc.tar.bz2
slixmpp-673545c7e48d86b02f811ad239ed317e4bca0bbc.tar.xz
slixmpp-673545c7e48d86b02f811ad239ed317e4bca0bbc.zip
First pass at integrating the new roster manager.
Diffstat (limited to 'sleekxmpp/clientxmpp.py')
-rw-r--r--sleekxmpp/clientxmpp.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/sleekxmpp/clientxmpp.py b/sleekxmpp/clientxmpp.py
index 1c600812..8b8f05f6 100644
--- a/sleekxmpp/clientxmpp.py
+++ b/sleekxmpp/clientxmpp.py
@@ -66,7 +66,7 @@ class ClientXMPP(BaseXMPP):
when calling register_plugins.
escape_quotes -- Deprecated.
"""
- BaseXMPP.__init__(self, 'jabber:client')
+ BaseXMPP.__init__(self, jid, 'jabber:client')
# To comply with PEP8, method names now use underscores.
# Deprecated method names are re-mapped for backwards compatibility.
@@ -75,7 +75,6 @@ class ClientXMPP(BaseXMPP):
self.getRoster = self.get_roster
self.registerFeature = self.register_feature
- self.set_jid(jid)
self.password = password
self.escape_quotes = escape_quotes
self.plugin_config = plugin_config
@@ -421,13 +420,13 @@ class ClientXMPP(BaseXMPP):
"""
if iq['type'] == 'set' or (iq['type'] == 'result' and request):
for jid in iq['roster']['items']:
- if not jid in self.roster:
- self.roster[jid] = {'groups': [],
- 'name': '',
- 'subscription': 'none',
- 'presence': {},
- 'in_roster': True}
- self.roster[jid].update(iq['roster']['items'][jid])
+ item = iq['roster']['items'][jid]
+ roster = self.rosters[iq['to'].bare]
+ roster[jid]['name'] = item['name']
+ roster[jid]['groups'] = item['groups']
+ roster[jid]['from'] = item['subscription'] in ['from', 'both']
+ roster[jid]['to'] = item['subscription'] in ['to', 'both']
+ roster[jid]['pending_out'] = (item['ask'] == 'subscribe')
self.event("roster_update", iq)
if iq['type'] == 'set':