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/Cache_p.h | |
parent | Error Handling and some fixes (diff) | |
download | nheko-6fae36abc404ffb7e6ae29c9edceda5231400f0a.tar.xz |
[WIP] Add Caching for users
Diffstat (limited to 'src/Cache_p.h')
-rw-r--r-- | src/Cache_p.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Cache_p.h b/src/Cache_p.h index 61d91b0c..cf4416ce 100644 --- a/src/Cache_p.h +++ b/src/Cache_p.h @@ -54,6 +54,15 @@ public: mtx::presence::PresenceState presenceState(const std::string &user_id); std::string statusMessage(const std::string &user_id); + // user cache stores user keys + UserCache getUserCache(const std::string &user_id); + int setUserCache(const std::string &user_id, const UserCache &body); + int deleteUserCache(const std::string &user_id); + + // device verified cache + DeviceVerifiedCache getVerifiedCache(const std::string &user_id); + int setVerifiedCache(const std::string &user_id, const DeviceVerifiedCache &body); + static void removeDisplayName(const QString &room_id, const QString &user_id); static void removeAvatarUrl(const QString &room_id, const QString &user_id); @@ -510,6 +519,16 @@ private: return lmdb::dbi::open(txn, "presence", MDB_CREATE); } + lmdb::dbi getUserCacheDb(lmdb::txn &txn) + { + return lmdb::dbi::open(txn, std::string("user_cache").c_str(), MDB_CREATE); + } + + lmdb::dbi getDeviceVerifiedDb(lmdb::txn &txn) + { + return lmdb::dbi::open(txn, std::string("verified").c_str(), MDB_CREATE); + } + //! Retrieves or creates the database that stores the open OLM sessions between our device //! and the given curve25519 key which represents another device. //! |