diff options
author | fiaxh <git@lightrise.org> | 2022-10-08 13:19:03 +0200 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2022-10-09 11:48:58 +0200 |
commit | 85342ee2eb2aa3e6d7599c503d17c00d861bafcb (patch) | |
tree | 7a529dbb0794f8fa1bbc584137164ff630d150dd /main/src/ui/conversation_view_controller.vala | |
parent | 21ab48e09aa6b0ade8f25bdc93f89f8d3aa462e7 (diff) | |
download | dino-85342ee2eb2aa3e6d7599c503d17c00d861bafcb.tar.gz dino-85342ee2eb2aa3e6d7599c503d17c00d861bafcb.zip |
Fix drag and drop uploading
Diffstat (limited to 'main/src/ui/conversation_view_controller.vala')
-rw-r--r-- | main/src/ui/conversation_view_controller.vala | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/main/src/ui/conversation_view_controller.vala b/main/src/ui/conversation_view_controller.vala index a2ac2655..50c0dcdb 100644 --- a/main/src/ui/conversation_view_controller.vala +++ b/main/src/ui/conversation_view_controller.vala @@ -154,20 +154,20 @@ public class ConversationViewController : Object { conversation_topic = null; } - private void update_file_upload_status() { - stream_interactor.get_module(FileManager.IDENTITY).is_upload_available.begin(conversation, (_, res) => { - bool upload_available = stream_interactor.get_module(FileManager.IDENTITY).is_upload_available.end(res); - chat_input_controller.set_file_upload_active(upload_available); - if (conversation.account.bare_jid.to_string().has_prefix("f")) { - if (drop_event_controller.widget == null) { - view.add_controller(drop_event_controller); - } - } else { - if (drop_event_controller.widget != null) { - view.remove_controller(drop_event_controller); - } + private async void update_file_upload_status() { + if (conversation == null) return; + + bool upload_available = yield stream_interactor.get_module(FileManager.IDENTITY).is_upload_available(conversation); + chat_input_controller.set_file_upload_active(upload_available); + if (upload_available && overlay_dialog == null) { + if (drop_event_controller.widget == null) { + view.add_controller(drop_event_controller); } - }); + } else { + if (drop_event_controller.widget != null) { + view.remove_controller(drop_event_controller); + } + } } private void update_conversation_display_name() { |