From e899668213ee8f7d3566bb5754b488d8633c30c7 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Tue, 10 Sep 2019 20:56:00 +0200 Subject: Add JET support --- main/src/ui/chat_input/view.vala | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'main') diff --git a/main/src/ui/chat_input/view.vala b/main/src/ui/chat_input/view.vala index 74fa044e..24297e6a 100644 --- a/main/src/ui/chat_input/view.vala +++ b/main/src/ui/chat_input/view.vala @@ -57,6 +57,7 @@ public class View : Box { scrolled.vadjustment.notify["upper"].connect_after(on_upper_notify); encryption_widget.get_style_context().add_class("dino-chatinput-button"); + encryption_widget.encryption_changed.connect(update_file_transfer_availability); // Emoji button for emoji picker (recents don't work < 3.22.19, category icons don't work <3.23.2) if (Gtk.get_major_version() >= 3 && Gtk.get_minor_version() >= 24) { @@ -83,15 +84,17 @@ public class View : Box { return this; } - public void initialize_for_conversation(Conversation conversation) { - + private void update_file_transfer_availability() { + bool upload_available = stream_interactor.get_module(FileManager.IDENTITY).is_upload_available(conversation); + file_button.visible = upload_available; + file_separator.visible = upload_available; + } + public void initialize_for_conversation(Conversation conversation) { if (this.conversation != null) entry_cache[this.conversation] = text_input.buffer.text; this.conversation = conversation; - bool upload_available = stream_interactor.get_module(FileManager.IDENTITY).is_upload_available(conversation); - file_button.visible = upload_available; - file_separator.visible = upload_available; + update_file_transfer_availability(); text_input.buffer.text = ""; if (entry_cache.has_key(conversation)) { -- cgit v1.2.3-70-g09d2