Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slixmpp-omemo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
6
Issues
6
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
poezio
slixmpp-omemo
Commits
e893e6ae
Verified
Commit
e893e6ae
authored
Aug 27, 2019
by
Maxime Buquet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change decrypt_message API. Don't take the entire message anymore
Signed-off-by:
Maxime “pep” Buquet
<
pep@bouah.net
>
parent
2b633526
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
slixmpp_omemo/__init__.py
slixmpp_omemo/__init__.py
+10
-5
No files found.
slixmpp_omemo/__init__.py
View file @
e893e6ae
...
...
@@ -414,11 +414,16 @@ class XEP_0384(BasePlugin):
def
is_encrypted
(
self
,
msg
:
Message
)
->
bool
:
return
msg
.
xml
.
find
(
'{%s}encrypted'
%
OMEMO_BASE_NS
)
is
not
None
def
decrypt_message
(
self
,
msg
:
Message
,
allow_untrusted
:
bool
=
False
)
->
Optional
[
str
]:
header
=
msg
[
'omemo_encrypted'
][
'header'
]
payload
=
b64dec
(
msg
[
'omemo_encrypted'
][
'payload'
][
'value'
])
jid
=
msg
[
'from'
].
bare
def
decrypt_message
(
self
,
encrypted
:
Encrypted
,
sender
:
JID
,
allow_untrusted
:
bool
=
False
,
)
->
Optional
[
str
]:
header
=
encrypted
[
'header'
]
payload
=
b64dec
(
encrypted
[
'payload'
][
'value'
])
jid
=
sender
sid
=
int
(
header
[
'sid'
])
key
=
header
.
xml
.
find
(
"{%s}key[@rid='%s']"
%
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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