aboutsummaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2020-04-05 14:45:59 +0200
committerfiaxh <git@lightrise.org>2020-04-05 16:14:49 +0200
commit8f7595418890cc2dac62dc4903405c49e61176d2 (patch)
tree36e716c3307b2e1c82468eba9348619f7b7bf2b1 /main
parent871ff33ac79f3d17b0260b8bfcd27780038edd6d (diff)
downloaddino-8f7595418890cc2dac62dc4903405c49e61176d2.tar.gz
dino-8f7595418890cc2dac62dc4903405c49e61176d2.zip
Fix unencrypted message warning when switching between encryptions
Diffstat (limited to 'main')
-rw-r--r--main/src/ui/conversation_content_view/conversation_item_skeleton.vala22
1 files changed, 11 insertions, 11 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 fe6c2dee..ef880063 100644
--- a/main/src/ui/conversation_content_view/conversation_item_skeleton.vala
+++ b/main/src/ui/conversation_content_view/conversation_item_skeleton.vala
@@ -105,7 +105,7 @@ public class ItemMetaDataHeader : Box {
[GtkChild] public Label dot_label;
[GtkChild] public Label time_label;
public Image received_image = new Image() { opacity=0.4 };
- public Image? encryption_image = null;
+ public Image? unencrypted_image = null;
public static IconSize ICON_SIZE_HEADER = Gtk.icon_size_register("im.dino.Dino.HEADER_ICON", 17, 12);
@@ -156,16 +156,16 @@ public class ItemMetaDataHeader : Box {
}
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;
+ if (conversation.encryption != Encryption.NONE && unencrypted_image == null) {
+ unencrypted_image = new Image() { opacity=0.4, visible = true };
+ unencrypted_image.set_from_icon_name("dino-changes-allowed-symbolic", ICON_SIZE_HEADER);
+ unencrypted_image.tooltip_text = _("Unencrypted");
+ this.add(unencrypted_image);
+ this.reorder_child(unencrypted_image, 3);
+ Util.force_error_color(unencrypted_image);
+ } else if (conversation.encryption == Encryption.NONE && unencrypted_image != null) {
+ unencrypted_image.destroy();
+ unencrypted_image = null;
}
}