summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime “pep” Buquet <pep@bouah.net>2019-02-23 12:54:56 +0000
committerMaxime “pep” Buquet <pep@bouah.net>2019-02-23 12:54:56 +0000
commit88260cc240bad15c77c32c86013cf545a6a2f78d (patch)
treeb8530d952e0d2217be079b009c2be657dc62311a
parente9f2f503b83671ae4f66ae8e82967c4256acac7d (diff)
downloadslixmpp-88260cc240bad15c77c32c86013cf545a6a2f78d.tar.gz
slixmpp-88260cc240bad15c77c32c86013cf545a6a2f78d.tar.bz2
slixmpp-88260cc240bad15c77c32c86013cf545a6a2f78d.tar.xz
slixmpp-88260cc240bad15c77c32c86013cf545a6a2f78d.zip
xep_0380: Add add_eme method
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
-rw-r--r--slixmpp/plugins/xep_0380/eme.py5
1 files changed, 5 insertions, 0 deletions
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']