Philipp Hörist pushed to branch master at gajim / gajim

Commits:
93af68f8 by Philipp Hörist at 2018-04-14T10:34:58+02:00
Dont show error when receiving invalid avatars

Fixes #9022

- - - - -


1 changed file:

- gajim/common/pep.py


Changes:

=====================================
gajim/common/pep.py
=====================================
--- a/gajim/common/pep.py
+++ b/gajim/common/pep.py
@@ -483,6 +483,10 @@ class AvatarNotificationPEP(AbstractPEP):
     def _extract_info(self, items):
         self.avatar = None
         for item in items.getTags('item'):
+            metadata = item.getTag('metadata')
+            if metadata is None:
+                app.log('avatar').warning('Invalid avatar stanza:\n%s', items)
+                break
             info = item.getTag('metadata').getTag('info')
             if info is not None:
                 self.avatar = info.getAttrs()
@@ -494,7 +498,7 @@ class AvatarNotificationPEP(AbstractPEP):
         con = app.connections[account]
         if self.avatar is None:
             # Remove avatar
-            app.log('avatar').debug('Remove (Pubsub): %s', jid)
+            app.log('avatar').info('Remove (Pubsub): %s', jid)
             app.contacts.set_avatar(account, jid, None)
             own_jid = con.get_own_jid().getStripped()
             app.logger.set_avatar_sha(own_jid, jid, None)



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/93af68f81c646bca0bd294e83ca27ce9ffc19856

---
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/93af68f81c646bca0bd294e83ca27ce9ffc19856
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list
Commits@gajim.org
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to