Commit 93af68f8 authored by Philipp Hörist's avatar Philipp Hörist

Dont show error when receiving invalid avatars

Fixes #9022
parent 9f0eaf9d
......@@ -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)
info = item.getTag('metadata').getTag('info')
if info is not None:
self.avatar = info.getAttrs()
......@@ -494,7 +498,7 @@ def _on_receive(self, jid, account):
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)
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