diff options
author | CH Chethan Reddy <40890937+Chethan2k1@users.noreply.github.com> | 2020-06-28 21:01:34 +0530 |
---|---|---|
committer | CH Chethan Reddy <40890937+Chethan2k1@users.noreply.github.com> | 2020-07-30 22:10:27 +0530 |
commit | 6fae36abc404ffb7e6ae29c9edceda5231400f0a (patch) | |
tree | bce50b744fd917e393848813d8206668f48bd190 /src/CacheCryptoStructs.h | |
parent | Error Handling and some fixes (diff) | |
download | nheko-6fae36abc404ffb7e6ae29c9edceda5231400f0a.tar.xz |
[WIP] Add Caching for users
Diffstat (limited to 'src/CacheCryptoStructs.h')
-rw-r--r-- | src/CacheCryptoStructs.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/CacheCryptoStructs.h b/src/CacheCryptoStructs.h index 14c9c86b..7344aef9 100644 --- a/src/CacheCryptoStructs.h +++ b/src/CacheCryptoStructs.h @@ -65,3 +65,33 @@ struct OlmSessionStorage std::mutex group_outbound_mtx; std::mutex group_inbound_mtx; }; + +struct UserCache +{ + //! user_id of the user + std::string user_id; + //! this stores if the user is verified (with cross-signing) + bool is_user_verified = false; + //! list of verified device_ids with cross-signing + std::vector<std::string> cross_verified; + //! map of public key key_ids and their public_key + mtx::responses::QueryKeys keys; +}; + +void +to_json(nlohmann::json &j, const UserCache &info); +void +from_json(const nlohmann::json &j, UserCache &info); + +struct DeviceVerifiedCache +{ + //! user_id of the user + std::string user_id; + //! list of verified device_ids with device-verification + std::vector<std::string> device_verified; +}; + +void +to_json(nlohmann::json &j, const DeviceVerifiedCache &info); +void +from_json(const nlohmann::json &j, DeviceVerifiedCache &info); |