From 0fc9072e5d0ebd90339e2a809ead8ec8b15f6d7e Mon Sep 17 00:00:00 2001 From: Nathan Fritz Date: Fri, 26 Mar 2010 13:55:03 -0700 Subject: fixed bug #16 Roster not updating --- sleekxmpp/stanza/roster.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sleekxmpp/stanza') diff --git a/sleekxmpp/stanza/roster.py b/sleekxmpp/stanza/roster.py index 21aaa161..d8b61a5b 100644 --- a/sleekxmpp/stanza/roster.py +++ b/sleekxmpp/stanza/roster.py @@ -1,10 +1,12 @@ from .. xmlstream.stanzabase import ElementBase, ET, JID +import logging class Roster(ElementBase): namespace = 'jabber:iq:roster' name = 'query' plugin_attrib = 'roster' interfaces = set(('items',)) + sub_interfaces = set() def setItems(self, items): self.delItems() @@ -27,8 +29,8 @@ class Roster(ElementBase): items = {} itemsxml = self.xml.findall('{jabber:iq:roster}item') if itemsxml is not None: - item = {} for itemxml in itemsxml: + item = {} item['name'] = itemxml.get('name', '') item['subscription'] = itemxml.get('subscription', '') item['groups'] = [] @@ -36,7 +38,7 @@ class Roster(ElementBase): if groupsxml is not None: for groupxml in groupsxml: item['groups'].append(groupxml.text) - items[JID(itemxml.get('jid'))] = item + items[itemxml.get('jid')] = item return items def delItems(self): -- cgit v1.2.3