diff options
author | Samuel Hand <samuel.hand@openmailbox.org> | 2018-07-09 14:16:23 +0100 |
---|---|---|
committer | Samuel Hand <samuel.hand@openmailbox.org> | 2018-07-09 14:16:23 +0100 |
commit | acbc5710d083e69f887b0b5a15e48b7d10b48190 (patch) | |
tree | 60ee5229c936b5b0b82c162248554645e1798e8e /plugins/omemo/src/manager.vala | |
parent | f3c82094cd5d232226907f61f6d58402f99e10db (diff) | |
download | dino-acbc5710d083e69f887b0b5a15e48b7d10b48190.tar.gz dino-acbc5710d083e69f887b0b5a15e48b7d10b48190.zip |
Enable key management for own keys
Diffstat (limited to 'plugins/omemo/src/manager.vala')
-rw-r--r-- | plugins/omemo/src/manager.vala | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/omemo/src/manager.vala b/plugins/omemo/src/manager.vala index e1f3ee56..2f641196 100644 --- a/plugins/omemo/src/manager.vala +++ b/plugins/omemo/src/manager.vala @@ -98,6 +98,15 @@ public class Manager : StreamInteractionModule, Object { return; } StreamModule module = (!)module_; + + foreach (Row row in db.identity_meta.with_address(conversation.account.id, conversation.account.bare_jid.to_string())){ + if(row[db.identity_meta.trust_level] == Database.IdentityMetaTable.TrustLevel.TRUSTED || row[db.identity_meta.trust_level] == Database.IdentityMetaTable.TrustLevel.VERIFIED){ + module.trust_device(conversation.account.bare_jid, row[db.identity_meta.device_id]); + } else { + module.untrust_device(conversation.account.bare_jid, row[db.identity_meta.device_id]); + } + } + EncryptState enc_state = module.encrypt(message_stanza, conversation.account.bare_jid); MessageState state; lock (message_states) { |