diff options
Diffstat (limited to 'plugins/omemo/src/manager.vala')
-rw-r--r-- | plugins/omemo/src/manager.vala | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/plugins/omemo/src/manager.vala b/plugins/omemo/src/manager.vala index b2226e2a..197ba021 100644 --- a/plugins/omemo/src/manager.vala +++ b/plugins/omemo/src/manager.vala @@ -11,13 +11,14 @@ public class Manager : StreamInteractionModule, Object { private StreamInteractor stream_interactor; private Database db; - private ArrayList<Entities.Message> to_send_after_devicelist = new ArrayList<Entities.Message>(); - private ArrayList<Entities.Message> to_send_after_session = new ArrayList<Entities.Message>(); + private ConcurrentList<Entities.Message> to_send_after_devicelist = new ConcurrentList<Entities.Message>(); + private ConcurrentList<Entities.Message> to_send_after_session = new ConcurrentList<Entities.Message>(); private Manager(StreamInteractor stream_interactor, Database db) { this.stream_interactor = stream_interactor; this.db = db; + stream_interactor.stream_negotiated.connect(on_stream_negotiated); stream_interactor.account_added.connect(on_account_added); MessageManager.get_instance(stream_interactor).pre_message_received.connect(on_pre_message_received); MessageManager.get_instance(stream_interactor).pre_message_send.connect(on_pre_message_send); @@ -68,6 +69,11 @@ public class Manager : StreamInteractionModule, Object { stream_interactor.module_manager.get_module(account, StreamModule.IDENTITY).session_started.connect((jid, device_id) => on_session_started(account, jid)); } + private void on_stream_negotiated(Account account) { + Core.XmppStream stream = stream_interactor.get_stream(account); + stream_interactor.module_manager.get_module(account, StreamModule.IDENTITY).request_user_devicelist(stream, account.bare_jid.to_string()); + } + private void on_session_started(Account account, string jid) { lock(to_send_after_session) { Iterator<Entities.Message> iter = to_send_after_session.iterator(); |