From 8d8dcf5af67ad89c328e67dc2c3469ef90283d9a Mon Sep 17 00:00:00 2001 From: fiaxh Date: Mon, 11 Oct 2021 23:08:50 +0200 Subject: Fix compiler warnings ('[GtkChild] fields must be declared as `unowned'') --- plugins/omemo/src/logic/decrypt.vala | 4 +-- plugins/omemo/src/ui/contact_details_dialog.vala | 40 ++++++++++++------------ plugins/omemo/src/ui/manage_key_dialog.vala | 26 +++++++-------- 3 files changed, 35 insertions(+), 35 deletions(-) (limited to 'plugins/omemo') diff --git a/plugins/omemo/src/logic/decrypt.vala b/plugins/omemo/src/logic/decrypt.vala index cfbb9c58..561e557b 100644 --- a/plugins/omemo/src/logic/decrypt.vala +++ b/plugins/omemo/src/logic/decrypt.vala @@ -129,13 +129,13 @@ namespace Dino.Plugins.Omemo { string identity_key = Base64.encode(msg.identity_key.serialize()); bool ok = update_db_for_prekey(identity_id, identity_key, from_jid, sid); - if (!ok) return null; + if (!ok) throw new GLib.Error(-1, 0, "Failed updating db for prekey"); debug("Starting new session for decryption with device from %s/%d", from_jid.to_string(), sid); SessionCipher cipher = store.create_session_cipher(address); key = cipher.decrypt_pre_key_signal_message(msg); // TODO: Finish session - } else { + } else { debug("Continuing session for decryption with device from %s/%d", from_jid.to_string(), sid); SignalMessage msg = Plugin.get_context().deserialize_signal_message(encrypted_key); SessionCipher cipher = store.create_session_cipher(address); diff --git a/plugins/omemo/src/ui/contact_details_dialog.vala b/plugins/omemo/src/ui/contact_details_dialog.vala index b3f8bc45..b268cc13 100644 --- a/plugins/omemo/src/ui/contact_details_dialog.vala +++ b/plugins/omemo/src/ui/contact_details_dialog.vala @@ -20,26 +20,26 @@ public class ContactDetailsDialog : Gtk.Dialog { private Signal.Store store; private Set displayed_ids = new HashSet(); - [GtkChild] private Label automatically_accept_new_label; - [GtkChild] private Label automatically_accept_new_descr; - [GtkChild] private Label own_key_label; - [GtkChild] private Label new_keys_label; - [GtkChild] private Label associated_keys_label; - [GtkChild] private Label inactive_expander_label; - - [GtkChild] private Box own_fingerprint_container; - [GtkChild] private Label own_fingerprint_label; - [GtkChild] private Box new_keys_container; - [GtkChild] private ListBox new_keys_listbox; - [GtkChild] private Box keys_container; - [GtkChild] private ListBox keys_listbox; - [GtkChild] private Expander inactive_keys_expander; - [GtkChild] private ListBox inactive_keys_listbox; - [GtkChild] private Switch auto_accept_switch; - [GtkChild] private Button copy_button; - [GtkChild] private Button show_qrcode_button; - [GtkChild] private Image qrcode_image; - [GtkChild] private Popover qrcode_popover; + [GtkChild] private unowned Label automatically_accept_new_label; + [GtkChild] private unowned Label automatically_accept_new_descr; + [GtkChild] private unowned Label own_key_label; + [GtkChild] private unowned Label new_keys_label; + [GtkChild] private unowned Label associated_keys_label; + [GtkChild] private unowned Label inactive_expander_label; + + [GtkChild] private unowned Box own_fingerprint_container; + [GtkChild] private unowned Label own_fingerprint_label; + [GtkChild] private unowned Box new_keys_container; + [GtkChild] private unowned ListBox new_keys_listbox; + [GtkChild] private unowned Box keys_container; + [GtkChild] private unowned ListBox keys_listbox; + [GtkChild] private unowned Expander inactive_keys_expander; + [GtkChild] private unowned ListBox inactive_keys_listbox; + [GtkChild] private unowned Switch auto_accept_switch; + [GtkChild] private unowned Button copy_button; + [GtkChild] private unowned Button show_qrcode_button; + [GtkChild] private unowned Image qrcode_image; + [GtkChild] private unowned Popover qrcode_popover; construct { // If we set the strings in the .ui file, they don't get translated diff --git a/plugins/omemo/src/ui/manage_key_dialog.vala b/plugins/omemo/src/ui/manage_key_dialog.vala index d2b69992..9bdaaaee 100644 --- a/plugins/omemo/src/ui/manage_key_dialog.vala +++ b/plugins/omemo/src/ui/manage_key_dialog.vala @@ -6,23 +6,23 @@ namespace Dino.Plugins.Omemo { [GtkTemplate (ui = "/im/dino/Dino/omemo/manage_key_dialog.ui")] public class ManageKeyDialog : Gtk.Dialog { - [GtkChild] private HeaderBar headerbar; - [GtkChild] private Stack manage_stack; + [GtkChild] private unowned HeaderBar headerbar; + [GtkChild] private unowned Stack manage_stack; - [GtkChild] private Button cancel_button; - [GtkChild] private Button ok_button; + [GtkChild] private unowned Button cancel_button; + [GtkChild] private unowned Button ok_button; - [GtkChild] private Label main_desc_label; - [GtkChild] private ListBox main_action_list; + [GtkChild] private unowned Label main_desc_label; + [GtkChild] private unowned ListBox main_action_list; - [GtkChild] private Image confirm_image; - [GtkChild] private Label confirm_title_label; - [GtkChild] private Label confirm_desc_label; + [GtkChild] private unowned Image confirm_image; + [GtkChild] private unowned Label confirm_title_label; + [GtkChild] private unowned Label confirm_desc_label; - [GtkChild] private Label verify_label; - [GtkChild] private Label compare_fingerprint_label; - [GtkChild] private Button verify_yes_button; - [GtkChild] private Button verify_no_button; + [GtkChild] private unowned Label verify_label; + [GtkChild] private unowned Label compare_fingerprint_label; + [GtkChild] private unowned Button verify_yes_button; + [GtkChild] private unowned Button verify_no_button; private Row device; private Database db; -- cgit v1.2.3-54-g00ecf