aboutsummaryrefslogtreecommitdiff
path: root/plugins/openpgp/src/manager.vala
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2017-03-16 16:28:32 +0100
committerfiaxh <git@mx.ax.lt>2017-03-16 19:46:22 +0100
commit6f3eee1430b1e3bdb22b8c532f8b609015d01bfb (patch)
tree13453938a7583d2d304bd9425c43a21e13f0c476 /plugins/openpgp/src/manager.vala
parentaf49a47cf6c5933a9bcc21f2b7bb20d85be37483 (diff)
downloaddino-6f3eee1430b1e3bdb22b8c532f8b609015d01bfb.tar.gz
dino-6f3eee1430b1e3bdb22b8c532f8b609015d01bfb.zip
Improve when to send chat state notifications
Diffstat (limited to 'plugins/openpgp/src/manager.vala')
-rw-r--r--plugins/openpgp/src/manager.vala10
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