diff options
author | fiaxh <git@lightrise.org> | 2024-08-19 12:16:40 +0200 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2024-08-19 12:28:45 +0200 |
commit | 1431426581595686aff19300c80af91e814661bd (patch) | |
tree | a081c999653fbc9bbbc88353faebf2146a0be137 /plugins/omemo | |
parent | dc57561dcffda62d01618c72e0bbf5c5a45c2114 (diff) | |
download | dino-1431426581595686aff19300c80af91e814661bd.tar.gz dino-1431426581595686aff19300c80af91e814661bd.zip |
Omemo: Connect listener only once on account added
Diffstat (limited to 'plugins/omemo')
-rw-r--r-- | plugins/omemo/src/logic/manager.vala | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/omemo/src/logic/manager.vala b/plugins/omemo/src/logic/manager.vala index 5552e212..ba02bab5 100644 --- a/plugins/omemo/src/logic/manager.vala +++ b/plugins/omemo/src/logic/manager.vala @@ -66,6 +66,7 @@ public class Manager : StreamInteractionModule, Object { this.trust_manager = trust_manager; this.encryptors = encryptors; + stream_interactor.account_added.connect(on_account_added); stream_interactor.stream_negotiated.connect(on_stream_negotiated); stream_interactor.get_module(MessageProcessor.IDENTITY).pre_message_send.connect(on_pre_message_send); stream_interactor.get_module(RosterManager.IDENTITY).mutual_subscription.connect(on_mutual_subscription); @@ -182,6 +183,12 @@ public class Manager : StreamInteractionModule, Object { StreamModule module = stream_interactor.module_manager.get_module(account, StreamModule.IDENTITY); if (module != null) { module.request_user_devicelist.begin(stream, account.bare_jid); + } + } + + private void on_account_added(Account account) { + StreamModule module = stream_interactor.module_manager.get_module(account, StreamModule.IDENTITY); + if (module != null) { module.device_list_loaded.connect((jid, devices) => on_device_list_loaded(account, jid, devices)); module.bundle_fetched.connect((jid, device_id, bundle) => on_bundle_fetched(account, jid, device_id, bundle)); module.bundle_fetch_failed.connect((jid) => continue_message_sending(account, jid)); |