Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
gajim-plugins
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Evert Mouw
gajim-plugins
Commits
dc73a142
Commit
dc73a142
authored
8 years ago
by
Philipp Hörist
Browse files
Options
Downloads
Patches
Plain Diff
Improve handling of empty/invalid devicelists
parent
1a41a5fa
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
omemo/__init__.py
+8
-3
8 additions, 3 deletions
omemo/__init__.py
with
8 additions
and
3 deletions
omemo/__init__.py
+
8
−
3
View file @
dc73a142
...
...
@@ -732,9 +732,13 @@ class OmemoPlugin(GajimPlugin):
devices_list
=
list
(
set
(
unpack_device_list_update
(
event
.
stanza
,
event
.
conn
.
name
)))
contact_jid
=
gajim
.
get_jid_without_resource
(
event
.
fjid
)
if
len
(
devices_list
)
==
0
:
log
.
error
(
account
+
'
=> Received empty or invalid Devicelist from:
'
+
contact_jid
)
return
False
contact_jid
=
gajim
.
get_jid_without_resource
(
event
.
fjid
)
state
=
self
.
get_omemo_state
(
account
)
my_jid
=
gajim
.
get_jid_from_account
(
account
)
...
...
@@ -1068,15 +1072,16 @@ class OmemoPlugin(GajimPlugin):
state
=
self
.
get_omemo_state
(
account
)
if
successful
(
stanza
):
log
.
info
(
account
+
'
=> Devicelistquery was successful
'
)
devices_list
=
list
(
set
(
unpack_device_list_update
(
stanza
,
account
)))
if
len
(
devices_list
)
==
0
:
log
.
error
(
account
+
'
=> Devicelistquery was NOT successful
'
)
self
.
publish_own_devices_list
(
account
)
return
False
contact_jid
=
stanza
.
getAttr
(
'
from
'
)
if
contact_jid
==
my_jid
:
state
.
set_own_devices
(
devices_list
)
state
.
store
.
sessionStore
.
setActiveState
(
devices_list
,
my_jid
)
log
.
info
(
account
+
'
=> Devicelistquery was successful
'
)
# remove contact from list, so on send button pressed
# we query for bundle and build a session
if
contact_jid
in
self
.
query_for_bundles
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment