From 88260cc240bad15c77c32c86013cf545a6a2f78d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Sat, 23 Feb 2019 12:54:56 +0000 Subject: xep_0380: Add add_eme method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- slixmpp/plugins/xep_0380/eme.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/slixmpp/plugins/xep_0380/eme.py b/slixmpp/plugins/xep_0380/eme.py index 1cc61d8d..65d585b3 100644 --- a/slixmpp/plugins/xep_0380/eme.py +++ b/slixmpp/plugins/xep_0380/eme.py @@ -55,6 +55,11 @@ class XEP_0380(BasePlugin): def has_eme(self, msg): return msg.xml.find('{%s}encryption' % Encryption.namespace) is not None + def add_eme(self, msg: Message, namespace: str) -> Message: + msg['eme']['name'] = self.mechanisms[namespace] + msg['eme']['namespace'] = namespace + return msg + def replace_body_with_eme(self, msg): eme = msg['eme'] namespace = eme['namespace'] -- cgit v1.2.3