summary refs log tree commit diff
path: root/src/Cache_p.h
diff options
context:
space:
mode:
authorDeepBlueV7.X <nicolas.werner@hotmail.de>2020-09-17 07:36:37 +0200
committerGitHub <noreply@github.com>2020-09-17 07:36:37 +0200
commitc62db00e6f440b4dbd9f257618e5040164bf10f1 (patch)
treee55bf8fcce1dc1af585c1116a6f87caa1d428d44 /src/Cache_p.h
parentMerge pull request #283 from trilene/voip (diff)
parentActually use room account data (diff)
downloadnheko-c62db00e6f440b4dbd9f257618e5040164bf10f1.tar.xz
Merge pull request #284 from Nheko-Reborn/hidden-events
Hidden events backend
Diffstat (limited to 'src/Cache_p.h')
-rw-r--r--src/Cache_p.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Cache_p.h b/src/Cache_p.h

index d3ec6ee0..c57995a2 100644 --- a/src/Cache_p.h +++ b/src/Cache_p.h
@@ -289,6 +289,14 @@ private: const std::string &room_id, const mtx::responses::Timeline &res); + //! retrieve a specific event from account data + //! pass empty room_id for global account data + std::optional<mtx::events::collections::RoomAccountDataEvents> + getAccountData(lmdb::txn &txn, mtx::events::EventType type, const std::string &room_id); + bool isHiddenEvent(lmdb::txn &txn, + mtx::events::collections::TimelineEvents e, + const std::string &room_id); + //! Remove a room from the cache. // void removeLeftRoom(lmdb::txn &txn, const std::string &room_id); template<class T> @@ -498,6 +506,12 @@ private: return lmdb::dbi::open(txn, std::string(room_id + "/state").c_str(), MDB_CREATE); } + lmdb::dbi getAccountDataDb(lmdb::txn &txn, const std::string &room_id) + { + return lmdb::dbi::open( + txn, std::string(room_id + "/account_data").c_str(), MDB_CREATE); + } + lmdb::dbi getMembersDb(lmdb::txn &txn, const std::string &room_id) { return lmdb::dbi::open(txn, std::string(room_id + "/members").c_str(), MDB_CREATE);