Show verification status next to messages

This commit is contained in:
Nicolas Werner 2021-05-07 12:19:46 +02:00
parent 7333de19da
commit 0d0709ccd3
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
14 changed files with 108 additions and 22 deletions

View file

@ -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