From ace5aeb80e28822635b80176ec39daab3cffdfa1 Mon Sep 17 00:00:00 2001 From: mathieui Date: Thu, 4 Feb 2021 21:30:55 +0100 Subject: [PATCH] XEP-0153: Fix a bug that would add muc elements to inbound presence --- slixmpp/plugins/xep_0153/vcard_avatar.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/slixmpp/plugins/xep_0153/vcard_avatar.py b/slixmpp/plugins/xep_0153/vcard_avatar.py index cf10283a..0492042d 100644 --- a/slixmpp/plugins/xep_0153/vcard_avatar.py +++ b/slixmpp/plugins/xep_0153/vcard_avatar.py @@ -152,13 +152,14 @@ class XEP_0153(BasePlugin): self.xmpp['xep_0054'].get_vcard(jid=jid.bare, ifrom=ifrom, callback=callback) - def _recv_presence(self, pres): + def _recv_presence(self, pres: Presence): try: - if pres['muc']['affiliation']: + if pres.get_plugin('muc', check=True): # Don't process vCard avatars for MUC occupants # since they all share the same bare JID. return - except: pass + except: + pass if not pres.match('presence/vcard_temp_update'): self.api['set_hash'](pres['from'], args=None)