Commit ce7923e1 authored by Philipp Hörist's avatar Philipp Hörist

Remove log and enabled status from lock tooltip

- Log status is a feature that only works with xep-0136 which nobody uses anymore
- Even then we can only trust in the server/user to not log the session
- We should not imply that a client could control if messages are logged on the server or the other end,
 especially as this is about encryption and security we should be as accurate as possible

- The lock image is only shown if a encryption was sucessfully activated, so the enabled flag is unnecessary
parent cf07022c
......@@ -848,46 +848,31 @@ def set_lock_image(self):
encryption_state = {'visible': visible,
'enc_type': self.encryption,
'enc_enabled': False,
'chat_logged': loggable,
'authenticated': False}
'encryption_state' + self.encryption, self, encryption_state)
def _show_lock_image(self, visible, enc_type='', enc_enabled=False,
chat_logged=False, authenticated=False):
def _show_lock_image(self, visible, enc_type='',
Set lock icon visibility and create tooltip
#encryption %s active
status_string = enc_enabled and _('is') or _('is NOT')
#chat session %s be logged
logged_string = chat_logged and _('will') or _('will NOT')
if authenticated:
#About encrypted chat session
authenticated_string = _('and authenticated')
img_path = gtkgui_helpers.get_icon_path('security-high')
#About encrypted chat session
authenticated_string = _('and NOT authenticated')
img_path = gtkgui_helpers.get_icon_path('security-low')
#status will become 'is' or 'is not', authentificaed will become
#'and authentificated' or 'and not authentificated', logged will become
#'will' or 'will not'
tooltip = _('%(type)s encryption %(status)s active %(authenticated)s.\n'
'Your chat session %(logged)s be logged.') % {'type': enc_type,
'status': status_string, 'authenticated': authenticated_string,
'logged': logged_string}
tooltip = _('%(type)s encryption is active %(authenticated)s.') % {'type': enc_type, 'authenticated': authenticated_string}
self.widget_set_visible(self.authentication_button, not visible)
def _on_authentication_button_clicked(self, widget):
......@@ -991,8 +976,8 @@ def print_esession_details(self):
msg = _('E2E encryption disabled')
ChatControlBase.print_conversation_line(self, msg, 'status', '', None)
self._show_lock_image(e2e_is_active, 'E2E', e2e_is_active, self.session and \
self.session.is_loggable(), self.session and self.session.verified_identity)
self._show_lock_image(e2e_is_active, 'E2E',
self.session and self.session.verified_identity)
def print_session_details(self, old_session=None):
if isinstance(self.session, EncryptedStanzaSession) or \
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment