Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Yuki
gajim-plugins
Commits
13c9ba9b
Commit
13c9ba9b
authored
Nov 15, 2017
by
Philipp Hörist
Browse files
[omemo] Fix activating groupchat
parent
a86c0a2b
Changes
2
Hide whitespace changes
Inline
Side-by-side
omemo/omemoplugin.py
View file @
13c9ba9b
...
...
@@ -154,7 +154,8 @@ class OmemoPlugin(GajimPlugin):
def
activate_encryption
(
self
,
chat_control
):
if
isinstance
(
chat_control
,
GroupchatControl
):
if
chat_control
.
room_jid
not
in
self
.
groupchat
:
omemo_con
=
self
.
connections
[
chat_control
.
account
]
if
chat_control
.
room_jid
not
in
omemo_con
.
groupchat
:
dialogs
.
ErrorDialog
(
_
(
'Bad Configuration'
),
_
(
'To use OMEMO in a Groupchat, the Groupchat should be'
...
...
@@ -210,8 +211,8 @@ class OmemoPlugin(GajimPlugin):
room
=
chat_control
.
room_jid
missing
=
True
own_jid
=
app
.
get_jid_from_account
(
account
)
for
nick
in
self
.
groupchat
[
room
]:
real_jid
=
self
.
groupchat
[
room
][
nick
]
for
nick
in
con
.
groupchat
[
room
]:
real_jid
=
con
.
groupchat
[
room
][
nick
]
if
real_jid
==
own_jid
:
continue
if
not
self
.
connections
[
account
].
are_keys_missing
(
real_jid
):
...
...
@@ -233,12 +234,13 @@ class OmemoPlugin(GajimPlugin):
def
new_fingerprints_available
(
self
,
chat_control
):
jid
=
chat_control
.
contact
.
jid
account
=
chat_control
.
account
con
=
self
.
connections
[
account
]
omemo
=
self
.
get_omemo
(
account
)
if
isinstance
(
chat_control
,
GroupchatControl
):
room_jid
=
chat_control
.
room_jid
if
room_jid
in
self
.
groupchat
:
for
nick
in
self
.
groupchat
[
room_jid
]:
real_jid
=
self
.
groupchat
[
room_jid
][
nick
]
if
room_jid
in
con
.
groupchat
:
for
nick
in
con
.
groupchat
[
room_jid
]:
real_jid
=
con
.
groupchat
[
room_jid
][
nick
]
fingerprints
=
omemo
.
store
.
\
getNewFingerprints
(
real_jid
)
if
fingerprints
:
...
...
omemo/ui.py
View file @
13c9ba9b
...
...
@@ -208,22 +208,10 @@ class OMEMOConfigDialog(GajimPluginConfigDialog):
def
on_yes
(
checked
,
identity_key
):
state
.
store
.
setTrust
(
identity_key
,
State
.
TRUSTED
)
try
:
if
self
.
plugin
.
ui_list
[
account
]:
self
.
plugin
.
ui_list
[
account
][
jid
].
\
refresh_auth_lock_icon
()
except
:
log
.
debug
(
'UI not available'
)
self
.
update_context_list
()
def
on_no
(
identity_key
):
state
.
store
.
setTrust
(
identity_key
,
State
.
UNTRUSTED
)
try
:
if
jid
in
self
.
plugin
.
ui_list
[
account
]:
self
.
plugin
.
ui_list
[
account
][
jid
].
\
refresh_auth_lock_icon
()
except
:
log
.
debug
(
'UI not available'
)
self
.
update_context_list
()
for
path
in
paths
:
...
...
@@ -373,6 +361,7 @@ class FingerprintWindow(Gtk.Dialog):
self
.
windowinstances
=
windowinstances
self
.
account
=
self
.
contact
.
account
.
name
self
.
plugin
=
plugin
self
.
con
=
plugin
.
connections
[
self
.
account
]
self
.
omemostate
=
self
.
plugin
.
get_omemo
(
self
.
account
)
self
.
own_jid
=
app
.
get_jid_from_account
(
self
.
account
)
Gtk
.
Dialog
.
__init__
(
self
,
...
...
@@ -498,8 +487,8 @@ class FingerprintWindow(Gtk.Dialog):
trust_str
=
{
0
:
'False'
,
1
:
'True'
,
2
:
'Undecided'
}
if
self
.
groupchat
and
self
.
notebook
.
get_current_page
()
==
0
:
contact_jids
=
[]
for
nick
in
self
.
plugi
n
.
groupchat
[
contact_jid
]:
real_jid
=
self
.
plugi
n
.
groupchat
[
contact_jid
][
nick
]
for
nick
in
self
.
co
n
.
groupchat
[
contact_jid
]:
real_jid
=
self
.
co
n
.
groupchat
[
contact_jid
][
nick
]
if
real_jid
==
self
.
own_jid
:
continue
contact_jids
.
append
(
real_jid
)
...
...
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