summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2019-02-23 14:07:15 +0100
committermathieui <mathieui@mathieui.net>2019-02-23 14:07:15 +0100
commit628b357b0683ccb371d9874c7e15a68c02afde2a (patch)
treeb8530d952e0d2217be079b009c2be657dc62311a
parente9f2f503b83671ae4f66ae8e82967c4256acac7d (diff)
parent88260cc240bad15c77c32c86013cf545a6a2f78d (diff)
downloadslixmpp-628b357b0683ccb371d9874c7e15a68c02afde2a.tar.gz
slixmpp-628b357b0683ccb371d9874c7e15a68c02afde2a.tar.bz2
slixmpp-628b357b0683ccb371d9874c7e15a68c02afde2a.tar.xz
slixmpp-628b357b0683ccb371d9874c7e15a68c02afde2a.zip
Merge branch 'eme-add-method' into 'master'
xep_0380: Add add_eme method See merge request poezio/slixmpp!11
-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']