diff options
author | Marvin W <git@larma.de> | 2018-11-10 08:05:14 -0600 |
---|---|---|
committer | Marvin W <git@larma.de> | 2018-11-10 08:05:14 -0600 |
commit | dfb75e2cda1eb9edbbdd9ea88c131d9cb31742ed (patch) | |
tree | d3c1ae4251844239eb46e57c8eacf03466aed608 /plugins/omemo/src/plugin.vala | |
parent | 559bbc5ca3ad5d44ea949788005a29fe9d86a232 (diff) | |
parent | 65a12021bc7abbf5ddea068ffe9b4715cfc34f0b (diff) | |
download | dino-dfb75e2cda1eb9edbbdd9ea88c131d9cb31742ed.tar.gz dino-dfb75e2cda1eb9edbbdd9ea88c131d9cb31742ed.zip |
Merge PR #413 "Improvements to the OMEMO plugin"
Diffstat (limited to 'plugins/omemo/src/plugin.vala')
-rw-r--r-- | plugins/omemo/src/plugin.vala | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/plugins/omemo/src/plugin.vala b/plugins/omemo/src/plugin.vala index b9ce500d..ab22651f 100644 --- a/plugins/omemo/src/plugin.vala +++ b/plugins/omemo/src/plugin.vala @@ -28,6 +28,9 @@ public class Plugin : RootInterface, Object { public EncryptionListEntry list_entry; public AccountSettingsEntry settings_entry; public ContactDetailsProvider contact_details_provider; + public DeviceNotificationPopulator device_notification_populator; + public OwnNotifications own_notifications; + public TrustManager trust_manager; public void registered(Dino.Application app) { ensure_context(); @@ -36,13 +39,29 @@ public class Plugin : RootInterface, Object { this.list_entry = new EncryptionListEntry(this); this.settings_entry = new AccountSettingsEntry(this); this.contact_details_provider = new ContactDetailsProvider(this); + this.device_notification_populator = new DeviceNotificationPopulator(this, this.app.stream_interactor); + this.trust_manager = new TrustManager(this.app.stream_interactor, this.db); this.app.plugin_registry.register_encryption_list_entry(list_entry); this.app.plugin_registry.register_account_settings_entry(settings_entry); this.app.plugin_registry.register_contact_details_entry(contact_details_provider); + this.app.plugin_registry.register_notification_populator(device_notification_populator); this.app.stream_interactor.module_manager.initialize_account_modules.connect((account, list) => { list.add(new StreamModule()); + this.own_notifications = new OwnNotifications(this, this.app.stream_interactor, account); }); - Manager.start(this.app.stream_interactor, db); + Manager.start(this.app.stream_interactor, db, trust_manager); + + SimpleAction own_keys_action = new SimpleAction("own-keys", VariantType.INT32); + own_keys_action.activate.connect((variant) => { + foreach(Dino.Entities.Account account in this.app.stream_interactor.get_accounts()) { + if(account.id == variant.get_int32()) { + ContactDetailsDialog dialog = new ContactDetailsDialog(this, account, account.bare_jid); + dialog.set_transient_for((this.app as Gtk.Application).get_active_window()); + dialog.present(); + } + } + }); + this.app.add_action(own_keys_action); string locales_dir; if (app.search_path_generator != null) { |