diff options
author | fiaxh <git@lightrise.org> | 2020-03-28 19:55:22 +0100 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2020-03-29 20:24:39 +0200 |
commit | 853dfa2d6f0d1300b096f0c6a12ca179208f5287 (patch) | |
tree | 83e56212534585625f1dd9f6e4ac152e97a3cc59 /main/src | |
parent | 1016529c36011ec881820b61778821ae4caa230a (diff) | |
download | dino-853dfa2d6f0d1300b096f0c6a12ca179208f5287.tar.gz dino-853dfa2d6f0d1300b096f0c6a12ca179208f5287.zip |
Visually mark unencrypted messages if conversation is encrypted
Diffstat (limited to 'main/src')
-rw-r--r-- | main/src/ui/conversation_content_view/conversation_item_skeleton.vala | 21 |
1 files changed, 21 insertions, 0 deletions
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(); |