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
b380bfa7
Commit
b380bfa7
authored
Feb 11, 2020
by
Maxime Buquet
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure devicelist and bundles are published after receiving precondition-not-met
Signed-off-by:
Maxime “pep” Buquet
<
pep@bouah.net
>
parent
fc8349a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
+17
-4
slixmpp_omemo/__init__.py
slixmpp_omemo/__init__.py
+17
-4
No files found.
slixmpp_omemo/__init__.py
View file @
b380bfa7
...
...
@@ -299,7 +299,7 @@ class XEP_0384(BasePlugin):
form
,
)
async
def
_generate_bundle_iq
(
self
)
->
Iq
:
async
def
_generate_bundle_iq
(
self
,
publish_options
:
bool
=
True
)
->
Iq
:
bundle
=
self
.
_omemo
.
public_bundle
.
serialize
(
self
.
omemo_backend
)
jid
=
self
.
xmpp
.
boundjid
...
...
@@ -328,7 +328,7 @@ class XEP_0384(BasePlugin):
prekeys
.
append
(
prekey
)
payload
[
'prekeys'
]
=
prekeys
if
publish_options
:
if
publish_options
and
publish_options
:
options
=
_make_publish_options_form
({
'pubsub#persist_items'
:
True
,
'pubsub#access_model'
:
'open'
,
...
...
@@ -354,7 +354,13 @@ class XEP_0384(BasePlugin):
'Trying to configure manually..'
)
# TODO: We should attempt setting this node to the same
# access_model as the devicelist node for completness.
await
self
.
_set_node_config
(
OMEMO_BUNDLES_NS
)
try
:
await
self
.
_set_node_config
(
OMEMO_BUNDLES_NS
)
except
IqError
:
log
.
debug
(
'Failed to set node to persistent after precondition-not-met'
)
raise
iq
=
await
self
.
_generate_bundle_iq
(
publish_options
=
False
)
await
iq
.
send
()
async
def
_fetch_bundle
(
self
,
jid
:
str
,
device_id
:
int
)
->
Optional
[
ExtendedPublicBundle
]:
node
=
'%s:%d'
%
(
OMEMO_BUNDLES_NS
,
device_id
)
...
...
@@ -456,7 +462,14 @@ class XEP_0384(BasePlugin):
log
.
debug
(
'The node we tried to publish was already '
'existing with a different configuration. '
'Trying to configure manually..'
)
await
self
.
_set_node_config
(
OMEMO_DEVICES_NS
)
try
:
await
self
.
_set_node_config
(
OMEMO_DEVICES_NS
)
except
IqError
:
log
.
debug
(
'Failed to set node to persistent after precondition-not-met'
)
raise
await
self
.
xmpp
[
'xep_0060'
].
publish
(
own_jid
.
bare
,
OMEMO_DEVICES_NS
,
payload
=
payload
,
)
def
get_device_list
(
self
,
jid
:
JID
)
->
List
[
str
]:
"""Return active device ids. Always contains our own device id."""
...
...
Maxime Buquet
@ppjet
mentioned in issue
#6 (closed)
·
Feb 10, 2020
mentioned in issue
#6 (closed)
mentioned in issue #6
Toggle commit list
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