dereference iq stanza only once for roster processing

This commit is contained in:
Jay Farrimond 2012-07-06 13:50:15 -07:00 committed by Lance Stout
parent 6819b57353
commit 4a4a03858e

View file

@ -270,8 +270,9 @@ class ClientXMPP(BaseXMPP):
roster = self.client_roster roster = self.client_roster
if iq['roster']['ver']: if iq['roster']['ver']:
roster.version = iq['roster']['ver'] roster.version = iq['roster']['ver']
for jid in iq['roster']['items']: items = iq['roster']['items']
item = iq['roster']['items'][jid] for jid in items:
item = items[jid]
roster[jid]['name'] = item['name'] roster[jid]['name'] = item['name']
roster[jid]['groups'] = item['groups'] roster[jid]['groups'] = item['groups']
roster[jid]['from'] = item['subscription'] in ['from', 'both'] roster[jid]['from'] = item['subscription'] in ['from', 'both']