diff options
author | fiaxh <git@mx.ax.lt> | 2017-03-16 16:28:32 +0100 |
---|---|---|
committer | fiaxh <git@mx.ax.lt> | 2017-03-16 19:46:22 +0100 |
commit | 6f3eee1430b1e3bdb22b8c532f8b609015d01bfb (patch) | |
tree | 13453938a7583d2d304bd9425c43a21e13f0c476 /plugins | |
parent | af49a47cf6c5933a9bcc21f2b7bb20d85be37483 (diff) | |
download | dino-6f3eee1430b1e3bdb22b8c532f8b609015d01bfb.tar.gz dino-6f3eee1430b1e3bdb22b8c532f8b609015d01bfb.zip |
Improve when to send chat state notifications
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/openpgp/src/manager.vala | 10 |
1 files changed, 6 insertions, 4 deletions
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 |