aboutsummaryrefslogtreecommitdiff
path: root/plugins/omemo/src/trust_manager.vala
diff options
context:
space:
mode:
authorSamuel Hand <samuel.hand@openmailbox.org>2018-07-28 19:03:52 +0100
committerSamuel Hand <samuel.hand@openmailbox.org>2018-07-28 19:03:52 +0100
commit5d32a0ec3d85295f2286fbbab650c852b13a437c (patch)
tree0242ac68df81c71bf12ce03b61c6afdb0a75d684 /plugins/omemo/src/trust_manager.vala
parent7e156b3a7510eaad212dfe0c72dc8aba8bda0e57 (diff)
downloaddino-5d32a0ec3d85295f2286fbbab650c852b13a437c.tar.gz
dino-5d32a0ec3d85295f2286fbbab650c852b13a437c.zip
Fix omemo not being available on first startup
Diffstat (limited to 'plugins/omemo/src/trust_manager.vala')
-rw-r--r--plugins/omemo/src/trust_manager.vala5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/omemo/src/trust_manager.vala b/plugins/omemo/src/trust_manager.vala
index 408faed8..7e17e5ea 100644
--- a/plugins/omemo/src/trust_manager.vala
+++ b/plugins/omemo/src/trust_manager.vala
@@ -118,8 +118,9 @@ public class TrustManager {
public Gee.List<int32> get_trusted_devices(Account account, Jid jid) {
Gee.List<int32> devices = new ArrayList<int32>();
- foreach (Row device in db.identity_meta.with_address(account.id, jid.to_string()).with(db.identity_meta.trust_level, "!=", Database.IdentityMetaTable.TrustLevel.UNKNOWN).with(db.identity_meta.trust_level, "!=", Database.IdentityMetaTable.TrustLevel.UNTRUSTED).without_null(db.identity_meta.identity_key_public_base64)) {
- devices.add(device[db.identity_meta.device_id]);
+ foreach (Row device in db.identity_meta.with_address(account.id, jid.to_string()).with(db.identity_meta.trust_level, "!=", Database.IdentityMetaTable.TrustLevel.UNTRUSTED)) {
+ if(device[db.identity_meta.trust_level] != Database.IdentityMetaTable.TrustLevel.UNKNOWN || device[db.identity_meta.identity_key_public_base64] == null)
+ devices.add(device[db.identity_meta.device_id]);
}
return devices;
}