From 4d7809bb12199a598b531ca3ca019a4bb5a867f7 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Sat, 26 Nov 2022 22:26:25 +0100 Subject: [PATCH] Fix compiler warnings --- libdino/src/service/calls.vala | 1 - libdino/src/service/history_sync.vala | 2 +- libdino/src/service/jingle_file_transfers.vala | 2 -- libdino/src/service/message_processor.vala | 2 +- libdino/src/service/muc_manager.vala | 4 ++-- main/src/ui/chat_input/encryption_button.vala | 1 - .../conversation_item_skeleton.vala | 3 +++ .../conversation_view.vala | 2 -- .../file_image_widget.vala | 1 - main/src/ui/conversation_view.vala | 18 ------------------ main/src/ui/conversation_view_controller.vala | 7 ++++--- plugins/omemo/src/ui/manage_key_dialog.vala | 1 - 12 files changed, 11 insertions(+), 33 deletions(-) diff --git a/libdino/src/service/calls.vala b/libdino/src/service/calls.vala index 35b88866..ebaf8d03 100644 --- a/libdino/src/service/calls.vala +++ b/libdino/src/service/calls.vala @@ -82,7 +82,6 @@ namespace Dino { return (yield get_call_resources(conversation.account, conversation.counterpart)).size > 0 || has_jmi_resources(conversation.counterpart); } else { bool is_private = stream_interactor.get_module(MucManager.IDENTITY).is_private_room(conversation.account, conversation.counterpart); - EntityInfo entity_info = stream_interactor.get_module(EntityInfo.IDENTITY); return is_private && can_initiate_groupcall(conversation.account); } } diff --git a/libdino/src/service/history_sync.vala b/libdino/src/service/history_sync.vala index 08381e44..ed5a04af 100644 --- a/libdino/src/service/history_sync.vala +++ b/libdino/src/service/history_sync.vala @@ -315,7 +315,7 @@ public class Dino.HistorySync { latest_time, latest_id ); } - PageRequestResult page_result = yield fetch_query(account, query_params, range[db.mam_catchup.id]); + yield fetch_query(account, query_params, range[db.mam_catchup.id]); } /** diff --git a/libdino/src/service/jingle_file_transfers.vala b/libdino/src/service/jingle_file_transfers.vala index adf10034..624be607 100644 --- a/libdino/src/service/jingle_file_transfers.vala +++ b/libdino/src/service/jingle_file_transfers.vala @@ -115,8 +115,6 @@ public class JingleFileProvider : FileProvider, Object { } private void on_account_added(Account account) { - XmppStream stream = stream_interactor.get_stream(account); - stream_interactor.module_manager.get_module(account, Xmpp.Xep.JingleFileTransfer.Module.IDENTITY).file_incoming.connect((stream, jingle_file_transfer) => { Conversation? conversation = stream_interactor.get_module(ConversationManager.IDENTITY).get_conversation(jingle_file_transfer.peer.bare_jid, account); if (conversation == null) return; diff --git a/libdino/src/service/message_processor.vala b/libdino/src/service/message_processor.vala index bfecf340..a290132f 100644 --- a/libdino/src/service/message_processor.vala +++ b/libdino/src/service/message_processor.vala @@ -128,7 +128,7 @@ public class MessageProcessor : StreamInteractionModule, Object { // If it's a message from MAM, it's going to be processed by HistorySync which calls run_pipeline_announce later. if (history_sync.process(account, message_stanza)) return; - run_pipeline_announce(account, message_stanza); + run_pipeline_announce.begin(account, message_stanza); } public async void run_pipeline_announce(Account account, Xmpp.MessageStanza message_stanza) { diff --git a/libdino/src/service/muc_manager.vala b/libdino/src/service/muc_manager.vala index 28520ab9..36a5599f 100644 --- a/libdino/src/service/muc_manager.vala +++ b/libdino/src/service/muc_manager.vala @@ -387,7 +387,7 @@ public class MucManager : StreamInteractionModule, Object { } public string? get_own_occupant_id(Account account, Jid muc_jid) { - if (account in own_occupant_ids && muc_jid in own_occupant_ids[account]) { + if (own_occupant_ids.has_key(account) && own_occupant_ids[account].has_key(muc_jid)) { return own_occupant_ids[account][muc_jid]; } return null; @@ -421,7 +421,7 @@ public class MucManager : StreamInteractionModule, Object { } }); stream_interactor.module_manager.get_module(account, Xep.OccupantIds.Module.IDENTITY).received_own_occupant_id.connect( (stream, jid, occupant_id) => { - if (!(account in own_occupant_ids)) { + if (!own_occupant_ids.has_key(account)) { own_occupant_ids[account] = new HashMap(Jid.hash_bare_func, Jid.equals_bare_func); } own_occupant_ids[account][jid] = occupant_id; diff --git a/main/src/ui/chat_input/encryption_button.vala b/main/src/ui/chat_input/encryption_button.vala index 50497ee3..1f991338 100644 --- a/main/src/ui/chat_input/encryption_button.vala +++ b/main/src/ui/chat_input/encryption_button.vala @@ -11,7 +11,6 @@ public class EncryptionButton { private MenuButton menu_button; private Conversation? conversation; - private CheckButton? button_unencrypted; private string? current_icon; private StreamInteractor stream_interactor; private SimpleAction action; 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 21aca876..7113b3b7 100644 --- a/main/src/ui/conversation_content_view/conversation_item_skeleton.vala +++ b/main/src/ui/conversation_content_view/conversation_item_skeleton.vala @@ -43,6 +43,9 @@ public class ConversationItemSkeleton : Plugins.ConversationItemWidgetInterface, this.item = item; this.content_meta_item = item as ContentMetaItem; + item.bind_property("in-edit-mode", this, "item-in-edit-mode"); + this.notify["item-in-edit-mode"].connect(update_edit_mode); + Builder builder = new Builder.from_resource("/im/dino/Dino/conversation_item_widget.ui"); main_grid = (Grid) builder.get_object("main_grid"); main_grid.add_css_class("message-box"); diff --git a/main/src/ui/conversation_content_view/conversation_view.vala b/main/src/ui/conversation_content_view/conversation_view.vala index caeee09a..f0f6e118 100644 --- a/main/src/ui/conversation_content_view/conversation_view.vala +++ b/main/src/ui/conversation_content_view/conversation_view.vala @@ -136,7 +136,6 @@ public class ConversationView : Widget, Plugins.ConversationItemCollection, Plug // Get widget under pointer int h = 0; Widget? w = null; - Plugins.MetaConversationItem? meta_item = null; foreach (Plugins.MetaConversationItem item in meta_items) { Widget widget = widgets[item]; h += widget.get_allocated_height() + widget.margin_top + widget.margin_bottom; @@ -404,7 +403,6 @@ public class ConversationView : Widget, Plugins.ConversationItemCollection, Plug if (lower_item != null) { if (can_merge(item, lower_item)) { - ConversationItemSkeleton lower_skeleton = item_item_skeletons[lower_item]; item_skeleton.show_skeleton = false; } else { item_skeleton.show_skeleton = true; diff --git a/main/src/ui/conversation_content_view/file_image_widget.vala b/main/src/ui/conversation_content_view/file_image_widget.vala index 285e397e..097ac695 100644 --- a/main/src/ui/conversation_content_view/file_image_widget.vala +++ b/main/src/ui/conversation_content_view/file_image_widget.vala @@ -35,7 +35,6 @@ public class FileImageWidget : Box { pixbuf = pixbuf.apply_embedded_orientation(); image.load(pixbuf); - Picture picture = new Picture.for_pixbuf(pixbuf) { can_shrink=true, keep_aspect_ratio=true, halign=Align.START }; Idle.add(load_from_file.callback); return image; diff --git a/main/src/ui/conversation_view.vala b/main/src/ui/conversation_view.vala index 7c93c4ff..128b3bd8 100644 --- a/main/src/ui/conversation_view.vala +++ b/main/src/ui/conversation_view.vala @@ -28,9 +28,6 @@ public class ConversationView : Widget { // conversation_scrolled.set_child(list_view); // list_view.set_factory(get_item_factory()); -// conversation_scrolled.vadjustment.notify["upper"].connect_after(on_upper_notify); -// conversation_scrolled.vadjustment.notify["value"].connect(on_value_notify); - } public void add_overlay_dialog(Widget widget) { @@ -54,21 +51,6 @@ public class ConversationView : Widget { white_revealer.visible = false; } } - - private void on_upper_notify() { - print("on_upper_notify\n"); - if (at_current_content) { - print("on_upper_notify2\n"); - // scroll down -// conversation_scrolled.vadjustment.value = conversation_scrolled.vadjustment.upper - conversation_scrolled.vadjustment.page_size; -// conversation_scrolled.scroll_child(ScrollType.END, false); - } - } - - private void on_value_notify() { - print("on_value_notify\n"); -// at_current_content = false; - } } } diff --git a/main/src/ui/conversation_view_controller.vala b/main/src/ui/conversation_view_controller.vala index 5844ef0a..da94b740 100644 --- a/main/src/ui/conversation_view_controller.vala +++ b/main/src/ui/conversation_view_controller.vala @@ -146,7 +146,7 @@ public class ConversationViewController : Object { view.conversation_frame.initialize_for_conversation(conversation); } - update_file_upload_status(); + update_file_upload_status.begin(); } public void unset_conversation() { @@ -159,6 +159,7 @@ public class ConversationViewController : Object { 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); @@ -246,13 +247,13 @@ public class ConversationViewController : Object { overlay.close.connect(() => { // We don't want drag'n'drop to be active while the overlay is active overlay_dialog = null; - update_file_upload_status(); + update_file_upload_status.begin(); }); view.add_overlay_dialog(overlay.get_widget()); overlay_dialog = overlay.get_widget(); - update_file_upload_status(); + update_file_upload_status.begin(); } private void send_file(File file) { diff --git a/plugins/omemo/src/ui/manage_key_dialog.vala b/plugins/omemo/src/ui/manage_key_dialog.vala index 19f16a59..b47b2008 100644 --- a/plugins/omemo/src/ui/manage_key_dialog.vala +++ b/plugins/omemo/src/ui/manage_key_dialog.vala @@ -6,7 +6,6 @@ namespace Dino.Plugins.Omemo { [GtkTemplate (ui = "/im/dino/Dino/omemo/manage_key_dialog.ui")] public class ManageKeyDialog : Gtk.Dialog { - [GtkChild] private unowned HeaderBar headerbar; [GtkChild] private unowned Stack manage_stack; [GtkChild] private unowned Button cancel_button;