From 6fae36abc404ffb7e6ae29c9edceda5231400f0a Mon Sep 17 00:00:00 2001 From: CH Chethan Reddy <40890937+Chethan2k1@users.noreply.github.com> Date: Sun, 28 Jun 2020 21:01:34 +0530 Subject: [WIP] Add Caching for users --- src/CacheCryptoStructs.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src/CacheCryptoStructs.h') 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 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 device_verified; +}; + +void +to_json(nlohmann::json &j, const DeviceVerifiedCache &info); +void +from_json(const nlohmann::json &j, DeviceVerifiedCache &info); -- cgit 1.5.1