diff options
| author | Marvin W <git@larma.de> | 2026-10-04 14:42:16 +0200 |
|---|---|---|
| committer | Marvin W <git@larma.de> | 2026-10-23 16:59:59 +0200 |
| commit | dba577f39c489b9db29960f2bf5cc78ac4f29d7b (patch) | |
| tree | a8354c9fc328c1442d5e8c5c2adec4b428c92f44 /plugins/openpgp/src/plugin.vala | |
| parent | 2413442905e31f34cb0f77c9167003b3725760fe (diff) | |
Move OMEMO, OpenPGP and RTP plugins into main/libdino
Diffstat (limited to 'plugins/openpgp/src/plugin.vala')
| -rw-r--r-- | plugins/openpgp/src/plugin.vala | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/plugins/openpgp/src/plugin.vala b/plugins/openpgp/src/plugin.vala deleted file mode 100644 index 32542c21..00000000 --- a/plugins/openpgp/src/plugin.vala +++ /dev/null @@ -1,52 +0,0 @@ -using Gee; - -using Dino.Entities; - -extern const string GETTEXT_PACKAGE; -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 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_interactor, db); - this.contact_details_provider = new ContactDetailsProvider(app.stream_interactor); - - app.plugin_registry.register_encryption_list_entry(list_entry); - app.plugin_registry.register_encryption_preferences_entry(new PgpPreferencesEntry(this)); - app.plugin_registry.register_contact_details_entry(contact_details_provider); - app.stream_interactor.module_manager.initialize_account_modules.connect(on_initialize_account_modules); - - Manager.start(app.stream_interactor, db); - app.stream_interactor.get_module(FileManager.IDENTITY).add_file_encryptor(new PgpFileEncryptor(app.stream_interactor)); - app.stream_interactor.get_module(FileManager.IDENTITY).add_file_decryptor(new PgpFileDecryptor()); - JingleFileHelperRegistry.instance.add_encryption_helper(Encryption.PGP, new JingleFileEncryptionHelperTransferOnly()); - - internationalize(GETTEXT_PACKAGE, app.search_path_generator.get_locale_path(GETTEXT_PACKAGE, LOCALE_INSTALL_DIR)); - } - - public void shutdown() { } - - private void on_initialize_account_modules(Account account, ArrayList<Xmpp.XmppStreamModule> modules) { - string signed_data = ""; - string? sig = db.get_account_signature(account, signed_data); - bool sig_was_unknown = sig == null; - Module module = new Module(db.get_account_key(account), ref signed_data, ref sig); - if (sig_was_unknown && sig != null) { - db.set_account_signature(account, signed_data, sig); - } - this.modules[account] = module; - modules.add(module); - } -} - -} |
