diff options
author | fiaxh <git@mx.ax.lt> | 2017-08-14 13:48:43 +0200 |
---|---|---|
committer | fiaxh <git@mx.ax.lt> | 2017-08-14 22:38:17 +0200 |
commit | 3ddc53e683b9cdacff7184f3aa805b431edebcdb (patch) | |
tree | 5d9a3ed994ae9193789c7115c294aa9866930074 /plugins/openpgp/src/plugin.vala | |
parent | b0264b3e0034ddd9ea76d0e13bb4c3c709ba3b3e (diff) | |
download | dino-3ddc53e683b9cdacff7184f3aa805b431edebcdb.tar.gz dino-3ddc53e683b9cdacff7184f3aa805b431edebcdb.zip |
openpgp: contact details provider (fingerprint), colored fingerprints, fix shown availability
Diffstat (limited to 'plugins/openpgp/src/plugin.vala')
-rw-r--r-- | plugins/openpgp/src/plugin.vala | 59 |
1 files changed, 31 insertions, 28 deletions
diff --git a/plugins/openpgp/src/plugin.vala b/plugins/openpgp/src/plugin.vala index a585b206..edf19c96 100644 --- a/plugins/openpgp/src/plugin.vala +++ b/plugins/openpgp/src/plugin.vala @@ -7,36 +7,39 @@ extern const string LOCALE_INSTALL_DIR; namespace Dino.Plugins.OpenPgp { - public class Plugin : Plugins.RootInterface, Object { - public Dino.Application app; - public Database db; - public HashMap<Account, Module> modules = new HashMap<Account, Module>(Account.hash_func, Account.equals_func); - - private EncryptionListEntry list_entry; - private AccountSettingsEntry settings_entry; - - public void registered(Dino.Application app) { - this.app = app; - this.db = new Database(Path.build_filename(Application.get_storage_dir(), "pgp.db")); - this.list_entry = new EncryptionListEntry(app.stream_interaction); - this.settings_entry = new AccountSettingsEntry(this); - - app.plugin_registry.register_encryption_list_entry(list_entry); - app.plugin_registry.register_account_settings_entry(settings_entry); - app.stream_interaction.module_manager.initialize_account_modules.connect(on_initialize_account_modules); - - Manager.start(app.stream_interaction, db); - - internationalize(GETTEXT_PACKAGE, app.search_path_generator.get_locale_path(GETTEXT_PACKAGE, LOCALE_INSTALL_DIR)); - } +public class Plugin : Plugins.RootInterface, Object { + public Dino.Application app; + public Database db; + public HashMap<Account, Module> modules = new HashMap<Account, Module>(Account.hash_func, Account.equals_func); + + private EncryptionListEntry list_entry; + private AccountSettingsEntry settings_entry; + private ContactDetailsProvider contact_details_provider; + + public void registered(Dino.Application app) { + this.app = app; + this.db = new Database(Path.build_filename(Application.get_storage_dir(), "pgp.db")); + this.list_entry = new EncryptionListEntry(app.stream_interaction); + this.settings_entry = new AccountSettingsEntry(this); + this.contact_details_provider = new ContactDetailsProvider(app.stream_interaction); + + app.plugin_registry.register_encryption_list_entry(list_entry); + app.plugin_registry.register_account_settings_entry(settings_entry); + app.plugin_registry.register_contact_details_entry(contact_details_provider); + app.stream_interaction.module_manager.initialize_account_modules.connect(on_initialize_account_modules); + + Manager.start(app.stream_interaction, db); + + internationalize(GETTEXT_PACKAGE, app.search_path_generator.get_locale_path(GETTEXT_PACKAGE, LOCALE_INSTALL_DIR)); + } - public void shutdown() { } + public void shutdown() { } - private void on_initialize_account_modules(Account account, ArrayList<Xmpp.Core.XmppStreamModule> modules) { - Module module = new Module(db.get_account_key(account)); - this.modules[account] = module; - modules.add(module); - } + private void on_initialize_account_modules(Account account, ArrayList<Xmpp.Core.XmppStreamModule> modules) { + Module module = new Module(db.get_account_key(account)); + this.modules[account] = module; + modules.add(module); } +} } |