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
487e1cd2
Commit
487e1cd2
authored
9 years ago
by
Bahtiar Gadimov
Browse files
Options
Downloads
Patches
Plain Diff
Replace is_omemo_enabled with an init var
parent
745f56d1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
omemo/__init__.py
+3
-7
3 additions, 7 deletions
omemo/__init__.py
omemo/ui.py
+2
-2
2 additions, 2 deletions
omemo/ui.py
with
5 additions
and
9 deletions
omemo/__init__.py
+
3
−
7
View file @
487e1cd2
...
...
@@ -214,7 +214,9 @@ class OmemoPlugin(GajimPlugin):
jid
=
chat_control
.
contact
.
jid
if
account
not
in
self
.
ui_list
:
self
.
ui_list
[
account
]
=
{}
self
.
ui_list
[
account
][
jid
]
=
Ui
(
self
,
chat_control
)
state
=
self
.
get_omemo_state
(
account
)
omemo_enabled
=
jid
in
state
.
omemo_enabled
self
.
ui_list
[
account
][
jid
]
=
Ui
(
self
,
chat_control
,
omemo_enabled
)
def
are_keys_missing
(
self
,
contact
):
"""
Used by the ui to set the state of the PreKeyButton.
"""
...
...
@@ -420,12 +422,6 @@ class OmemoPlugin(GajimPlugin):
except
:
return
True
@log_calls
(
'
OmemoPlugin
'
)
def
is_omemo_enabled
(
self
,
contact
):
account
=
contact
.
account
.
name
state
=
self
.
get_omemo_state
(
account
)
return
contact
.
jid
in
state
.
omemo_enabled
@log_calls
(
'
OmemoPlugin
'
)
def
omemo_enable_for
(
self
,
contact
):
"""
Used by the ui to enable omemo for a specified contact
"""
...
...
This diff is collapsed.
Click to expand it.
omemo/ui.py
+
2
−
2
View file @
487e1cd2
...
...
@@ -92,7 +92,7 @@ class Ui(object):
last_msg_plain
=
True
def
__init__
(
self
,
plugin
,
chat_control
):
def
__init__
(
self
,
plugin
,
chat_control
,
enabled
):
contact
=
chat_control
.
contact
self
.
prekey_button
=
PreKeyButton
(
plugin
,
contact
)
self
.
checkbox
=
Checkbox
(
plugin
,
chat_control
)
...
...
@@ -101,7 +101,7 @@ class Ui(object):
available
=
plugin
.
has_omemo
(
contact
)
self
.
toggle_omemo
(
available
)
self
.
checkbox
.
set_active
(
plugin
.
is_omemo_enabled
(
contact
)
)
self
.
checkbox
.
set_active
(
enabled
)
self
.
chat_control
=
chat_control
_add_widget
(
self
.
prekey_button
,
chat_control
)
...
...
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