Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
gajim
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Marcin Mielniczuk
gajim
Commits
f40a8902
Verified
Commit
f40a8902
authored
Aug 15, 2019
by
Marcin Mielniczuk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Address the review
parent
37587c40
Pipeline
#4044
passed with stages
in 2 minutes and 54 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
39 deletions
+15
-39
gajim/chat_control.py
gajim/chat_control.py
+0
-9
gajim/chat_control_base.py
gajim/chat_control_base.py
+1
-0
gajim/conversation_textview.py
gajim/conversation_textview.py
+14
-21
gajim/groupchat_control.py
gajim/groupchat_control.py
+0
-9
No files found.
gajim/chat_control.py
View file @
f40a8902
...
...
@@ -207,15 +207,6 @@ class ChatControl(ChatControlBase):
self
.
session
=
session
# Enable encryption if needed
fprs
=
{}
if
self
.
encryption
is
not
None
:
enc_plugin
=
app
.
plugin_manager
.
encryption_plugins
[
self
.
encryption
]
fprs
=
enc_plugin
.
get_fingerprints
(
acct
,
self
.
contact
.
jid
,
groupchat
=
False
)
self
.
conv_textview
.
set_encryption
(
self
.
encryption
,
fprs
)
self
.
no_autonegotiation
=
False
self
.
add_actions
()
self
.
update_ui
()
...
...
gajim/chat_control_base.py
View file @
f40a8902
...
...
@@ -353,6 +353,7 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
self
.
handlers
[
id_
]
=
parent_win
.
window
self
.
encryption
=
self
.
get_encryption_state
()
self
.
conv_textview
.
set_encryption
(
self
.
encryption
)
# PluginSystem: adding GUI extension point for ChatControlBase
# instance object (also subclasses, eg. ChatControl or GroupchatControl)
...
...
gajim/conversation_textview.py
View file @
f40a8902
...
...
@@ -29,7 +29,7 @@ import queue
import
urllib
import
logging
from
calendar
import
timegm
from
typing
import
Optional
,
Tuple
,
Dict
from
typing
import
Optional
,
Tuple
from
gi.repository
import
Gtk
from
gi.repository
import
Pango
...
...
@@ -221,8 +221,7 @@ class ConversationTextview(GObject.GObject):
self
.
account
=
account
self
.
_cursor_changed
=
False
self
.
last_time_printout
=
0
self
.
encryption_enabled
=
False
self
.
fingerprint_trust
=
{}
# type: Dict[str, Trust]
self
.
encryption
=
None
style
=
self
.
tv
.
get_style_context
()
style
.
add_class
(
'gajim-conversation-font'
)
...
...
@@ -368,13 +367,8 @@ class ConversationTextview(GObject.GObject):
app
.
css_config
.
get_value
(
'.gajim-highlight-message'
,
StyleAttr
.
COLOR
))
self
.
tv
.
update_tags
()
def
set_encryption
(
self
,
encryption
:
Optional
[
str
],
fingerprints
:
Optional
[
Dict
[
str
,
Trust
]]
=
None
)
->
None
:
self
.
encryption_enabled
=
encryption
is
not
None
if
self
.
encryption_enabled
and
fingerprints
is
not
None
:
self
.
fingerprint_trust
=
fingerprints
def
set_encryption
(
self
,
encryption
:
Optional
[
str
])
->
None
:
self
.
encryption
=
encryption
def
scroll_to_end
(
self
,
force
=
False
):
if
self
.
autoscroll
or
force
:
...
...
@@ -1147,9 +1141,10 @@ class ConversationTextview(GObject.GObject):
def
print_encryption_status
(
self
,
iter_
,
additional_data
):
details
=
self
.
_get_encryption_details
(
additional_data
)
enc_plugin
=
app
.
plugin_manager
.
encryption_plugins
[
self
.
encryption
]
if
details
is
None
:
# Message was not encrypted
if
not
self
.
encryption_enabled
:
if
self
.
encryption
is
None
:
return
icon
=
'channel-insecure-symbolic'
color
=
'unencrypted-color'
...
...
@@ -1158,19 +1153,17 @@ class ConversationTextview(GObject.GObject):
name
,
fingerprint
,
trust
=
details
tooltip
=
_
(
'Encrypted (
%
s)'
)
%
(
name
)
# If a new fingerprint was added, but we may not have it in our dict
# until the textview is reloaded
if
fingerprint
in
self
.
fingerprint_trust
:
current_trust
=
self
.
fingerprint_trust
[
fingerprint
]
icon
,
trust_tooltip
,
color
=
TRUST_SYMBOL_DATA
[
current_trust
]
elif
trust
is
None
:
# First try to query the current trust.
# If unknown, fall back to the message original trust.
current_trust
=
enc_plugin
.
get_fingerprint_trust
(
self
.
account
,
fingerprint
)
fpr_trust
=
current_trust
or
trust
if
fpr_trust
is
not
None
:
icon
,
trust_tooltip
,
color
=
TRUST_SYMBOL_DATA
[
fpr_trust
]
tooltip
=
'
%
s
\n
%
s'
%
(
tooltip
,
trust_tooltip
)
else
:
# The encryption plugin did not pass trust information
icon
=
'channel-secure-symbolic'
color
=
'encrypted-color'
else
:
# Fallback to the original trust
icon
,
trust_tooltip
,
color
=
TRUST_SYMBOL_DATA
[
trust
]
tooltip
=
'
%
s
\n
%
s'
%
(
tooltip
,
trust_tooltip
)
if
fingerprint
is
not
None
:
fingerprint
=
format_fingerprint
(
fingerprint
)
...
...
gajim/groupchat_control.py
View file @
f40a8902
...
...
@@ -263,15 +263,6 @@ class GroupchatControl(ChatControlBase):
self
.
control_id
)
# Encryption
fprs
=
{}
if
self
.
encryption
is
not
None
:
enc_plugin
=
app
.
plugin_manager
.
encryption_plugins
[
self
.
encryption
]
fprs
=
enc_plugin
.
get_fingerprints
(
acct
,
self
.
contact
.
jid
,
groupchat
=
True
)
self
.
conv_textview
.
set_encryption
(
self
.
encryption
,
fprs
)
self
.
lock_image
=
self
.
xml
.
get_object
(
'lock_image'
)
self
.
authentication_button
=
self
.
xml
.
get_object
(
'authentication_button'
)
...
...
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