summary refs log tree commit diff
path: root/src/Olm.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-05-07 12:19:46 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2021-05-07 17:01:57 +0200
commit0d0709ccd37ef2f689c9d22a20994ce8d423e18b (patch)
tree110a1e0692184d34a3535dce1f8d3d99c1d70194 /src/Olm.cpp
parentTranslated using Weblate (Spanish) (diff)
downloadnheko-0d0709ccd37ef2f689c9d22a20994ce8d423e18b.tar.xz
Show verification status next to messages
Diffstat (limited to 'src/Olm.cpp')
-rw-r--r--src/Olm.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/Olm.cpp b/src/Olm.cpp

index b218ba2c..d08c1b3e 100644 --- a/src/Olm.cpp +++ b/src/Olm.cpp
@@ -939,7 +939,6 @@ decryptEvent(const MegolmSessionIndex &index, } // TODO: Lookup index,event_id,origin_server_ts tuple for replay attack errors - // TODO: Verify sender_key std::string msg_str; try { @@ -976,6 +975,17 @@ decryptEvent(const MegolmSessionIndex &index, return {std::nullopt, std::nullopt, std::move(te.data)}; } +crypto::Trust +calculate_trust(const std::string &user_id, const std::string &curve25519) +{ + auto status = cache::client()->verificationStatus(user_id); + crypto::Trust trustlevel = crypto::Trust::Unverified; + if (status.verified_device_keys.count(curve25519)) + trustlevel = status.verified_device_keys.at(curve25519); + + return trustlevel; +} + //! Send encrypted to device messages, targets is a map from userid to device ids or {} for all //! devices void