Commit a0c71551 authored by mathieui's avatar mathieui

Fix a traceback with broken roster items

only happens with buggy servers (hello ejabberd)
parent cf37785e
...@@ -3378,11 +3378,16 @@ class Core(object): ...@@ -3378,11 +3378,16 @@ class Core(object):
The roster was received. The roster was received.
""" """
for item in iq['roster']: for item in iq['roster']:
jid = item['jid'] try:
if item['subscription'] == 'remove': jid = item['jid']
del roster[jid] except InvalidJID:
jid = item._get_attr('jid', '')
log.error('Invalid JID: "%s"', jid, exc_info=True)
else: else:
roster.update_contact_groups(jid) if item['subscription'] == 'remove':
del roster[jid]
if isinstance(self.current_tab(), tabs.RosterInfoTab): if isinstance(self.current_tab(), tabs.RosterInfoTab):
self.refresh_window() self.refresh_window()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment