summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2021-02-04 21:30:55 +0100
committermathieui <mathieui@mathieui.net>2021-02-05 20:08:16 +0100
commitace5aeb80e28822635b80176ec39daab3cffdfa1 (patch)
treea02830ed1779a09413540893976ebbcbb9b069a8
parent712ac671e14b563375d43607e11d8007e10e05c3 (diff)
downloadslixmpp-ace5aeb80e28822635b80176ec39daab3cffdfa1.tar.gz
slixmpp-ace5aeb80e28822635b80176ec39daab3cffdfa1.tar.bz2
slixmpp-ace5aeb80e28822635b80176ec39daab3cffdfa1.tar.xz
slixmpp-ace5aeb80e28822635b80176ec39daab3cffdfa1.zip
XEP-0153: Fix a bug that would add muc elements to inbound presence
-rw-r--r--slixmpp/plugins/xep_0153/vcard_avatar.py7
1 files 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)