Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Maxime Buquet
slixmpp
Commits
88260cc2
Unverified
Commit
88260cc2
authored
Feb 23, 2019
by
Maxime Buquet
Browse files
xep_0380: Add add_eme method
Signed-off-by:
Maxime “pep” Buquet
<
pep@bouah.net
>
parent
e9f2f503
Changes
1
Hide whitespace changes
Inline
Side-by-side
slixmpp/plugins/xep_0380/eme.py
View file @
88260cc2
...
...
@@ -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'
]
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment