From 6f3eee1430b1e3bdb22b8c532f8b609015d01bfb Mon Sep 17 00:00:00 2001 From: fiaxh Date: Thu, 16 Mar 2017 16:28:32 +0100 Subject: Improve when to send chat state notifications --- plugins/openpgp/src/manager.vala | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'plugins') diff --git a/plugins/openpgp/src/manager.vala b/plugins/openpgp/src/manager.vala index 4fe50939..0941362e 100644 --- a/plugins/openpgp/src/manager.vala +++ b/plugins/openpgp/src/manager.vala @@ -67,12 +67,14 @@ namespace Dino.Plugins.OpenPgp { } private void on_jid_key_received(Account account, Jid jid, string key_id) { - if (!pgp_key_ids.has_key(jid) || pgp_key_ids[jid] != key_id) { - if (!MucManager.get_instance(stream_interactor).is_groupchat_occupant(jid, account)) { - db.set_contact_key(jid.bare_jid, key_id); + lock (pgp_key_ids) { + if (!pgp_key_ids.has_key(jid) || pgp_key_ids[jid] != key_id) { + if (!MucManager.get_instance(stream_interactor).is_groupchat_occupant(jid, account)) { + db.set_contact_key(jid.bare_jid, key_id); + } } + pgp_key_ids[jid] = key_id; } - pgp_key_ids[jid] = key_id; } } } \ No newline at end of file -- cgit v1.2.3-70-g09d2