From 853dfa2d6f0d1300b096f0c6a12ca179208f5287 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Sat, 28 Mar 2020 19:55:22 +0100 Subject: Visually mark unencrypted messages if conversation is encrypted --- .../conversation_item_skeleton.vala | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'main/src/ui/conversation_content_view') diff --git a/main/src/ui/conversation_content_view/conversation_item_skeleton.vala b/main/src/ui/conversation_content_view/conversation_item_skeleton.vala index b4cd766f..8c59dde7 100644 --- a/main/src/ui/conversation_content_view/conversation_item_skeleton.vala +++ b/main/src/ui/conversation_content_view/conversation_item_skeleton.vala @@ -124,6 +124,13 @@ public class ItemMetaDataHeader : Box { } } } + if (item.encryption == Encryption.NONE) { + conversation.notify["encryption"].connect(update_unencrypted_icon); + update_unencrypted_icon(); + } + + this.add(received_image); + if (item.display_time != null) { update_time(); } @@ -132,6 +139,20 @@ public class ItemMetaDataHeader : Box { update_received_mark(); } + private void update_unencrypted_icon() { + if (conversation.encryption != Encryption.NONE) { + encryption_image = new Image() { opacity=0.4, visible = true }; + encryption_image.set_from_icon_name("dino-changes-allowed-symbolic", ICON_SIZE_HEADER); + encryption_image.tooltip_text = _("Unencrypted"); + this.add(encryption_image); + this.reorder_child(encryption_image, 3); + Util.force_error_color(encryption_image); + } else if (encryption_image != null) { + encryption_image.destroy(); + encryption_image = null; + } + } + private void update_time() { time_label.label = get_relative_time(item.display_time.to_local()).to_string(); -- cgit v1.2.3-54-g00ecf