From 457785b286c31fda28898fb755a1f9ae448da65d Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sat, 26 Nov 2016 16:41:48 +0000 Subject: [PATCH] XEP-0380: Add a helper to test for the presence of an EME tag. --- slixmpp/plugins/xep_0380/eme.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/slixmpp/plugins/xep_0380/eme.py b/slixmpp/plugins/xep_0380/eme.py index 7ff09f65..abdd3e88 100644 --- a/slixmpp/plugins/xep_0380/eme.py +++ b/slixmpp/plugins/xep_0380/eme.py @@ -55,6 +55,9 @@ class XEP_0380(BasePlugin): def session_bind(self, jid): self.xmpp.plugin['xep_0030'].add_feature(Encryption.namespace) + def has_eme(self, msg): + return msg.xml.find('{%s}encryption' % Encryption.namespace) is not None + def replace_body_with_eme(self, msg): eme = msg['eme'] namespace = eme['namespace']