mirror of
https://github.com/correl/SleekXMPP.git
synced 2024-11-24 03:00:15 +00:00
Fixed error in updateRoster when the name keyword parameter is left out.
The Roster stanza object builds item elements manually, and did not handle the case where the name attribute is set to None, which would crash SleekXMPP.
This commit is contained in:
parent
1ef112966b
commit
797e92a6a3
1 changed files with 3 additions and 1 deletions
|
@ -23,7 +23,9 @@ class Roster(ElementBase):
|
||||||
if 'subscription' in items[jid]:
|
if 'subscription' in items[jid]:
|
||||||
item.attrib['subscription'] = items[jid]['subscription']
|
item.attrib['subscription'] = items[jid]['subscription']
|
||||||
if 'name' in items[jid]:
|
if 'name' in items[jid]:
|
||||||
item.attrib['name'] = items[jid]['name']
|
name = items[jid]['name']
|
||||||
|
if name is not None:
|
||||||
|
item.attrib['name'] = name
|
||||||
if 'groups' in items[jid]:
|
if 'groups' in items[jid]:
|
||||||
for group in items[jid]['groups']:
|
for group in items[jid]['groups']:
|
||||||
groupxml = ET.Element('{jabber:iq:roster}group')
|
groupxml = ET.Element('{jabber:iq:roster}group')
|
||||||
|
|
Loading…
Reference in a new issue