diff options
author | mathieui <mathieui@mathieui.net> | 2019-02-23 14:07:15 +0100 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2019-02-23 14:07:15 +0100 |
commit | 628b357b0683ccb371d9874c7e15a68c02afde2a (patch) | |
tree | b8530d952e0d2217be079b009c2be657dc62311a | |
parent | e9f2f503b83671ae4f66ae8e82967c4256acac7d (diff) | |
parent | 88260cc240bad15c77c32c86013cf545a6a2f78d (diff) | |
download | slixmpp-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.py | 5 |
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'] |