changeset 449:6c21a5a44b54

chat: show a padlock icon to indicate if message is e2e encrypted or not: if a unencrypted message is received in encrypted context, the icon will be red to indicate the problem.
author Goffi <goffi@goffi.org>
date Mon, 23 Mar 2020 16:52:08 +0100
parents 20a807443c3f
children ff5516adc1f5
files cagou/plugins/plugin_wid_chat.kv
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/cagou/plugins/plugin_wid_chat.kv	Sun Mar 22 14:10:59 2020 +0100
+++ b/cagou/plugins/plugin_wid_chat.kv	Mon Mar 23 16:52:08 2020 +0100
@@ -139,6 +139,13 @@
                 markup: True
                 valign: 'middle'
                 text: u"[b]{}[/b], {}".format(escape(root.nick), root.time_text)
+            Symbol:
+                size_hint_x: None
+                width: self.height
+                id: encrypted
+                symbol: 'lock-filled' if root.mess_data.encrypted else 'lock-open'
+                font_size: self.height - dp(3)
+                color: (1, 0, 0, 1) if not root.mess_data.encrypted and root.chat.encrypted else (0.55,0.55,0.55,1)
             Label:
                 id: delivery
                 color: C.COLOR_BTN_LIGHT