From 26e970a4d4e835cc879fc8cc5a0604fb50e67ce3 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Tue, 22 Oct 2019 01:23:43 +0200 Subject: Colapse inactive keys in OMEMO keys dialog --- plugins/omemo/src/ui/own_notifications.vala | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'plugins/omemo/src/ui/own_notifications.vala') diff --git a/plugins/omemo/src/ui/own_notifications.vala b/plugins/omemo/src/ui/own_notifications.vala index f882d03a..7ff10e30 100644 --- a/plugins/omemo/src/ui/own_notifications.vala +++ b/plugins/omemo/src/ui/own_notifications.vala @@ -15,23 +15,16 @@ public class OwnNotifications { this.plugin = plugin; this.account = account; stream_interactor.module_manager.get_module(account, StreamModule.IDENTITY).bundle_fetched.connect_after((jid, device_id, bundle) => { - if (jid.equals(account.bare_jid) && has_new_devices(account.bare_jid)) { + if (jid.equals(account.bare_jid) && plugin.has_new_devices(account, account.bare_jid)) { display_notification(); } }); - if (has_new_devices(account.bare_jid)) { + if (plugin.has_new_devices(account, account.bare_jid)) { display_notification(); } } - public bool has_new_devices(Jid jid) { - int identity_id = plugin.db.identity.get_id(account.id); - if (identity_id < 0) return false; - - return plugin.db.identity_meta.get_new_devices(identity_id, jid.bare_jid.to_string()).count() > 0; - } - private void display_notification() { Notification notification = new Notification(_("OMEMO trust decision required")); notification.set_default_action_and_target_value("app.own-keys", new Variant.int32(account.id)); -- cgit v1.2.3-54-g00ecf