Reject key requests for users that are not members of the room
This commit is contained in:
parent
a823a43686
commit
5dfd26abc5
3 changed files with 24 additions and 0 deletions
|
|
@ -1714,6 +1714,19 @@ Cache::getMembers(const std::string &room_id, std::size_t startIndex, std::size_
|
|||
return members;
|
||||
}
|
||||
|
||||
bool
|
||||
Cache::isRoomMember(const std::string &user_id, const std::string &room_id)
|
||||
{
|
||||
auto txn = lmdb::txn::begin(env_);
|
||||
auto db = getMembersDb(txn, room_id);
|
||||
|
||||
lmdb::val value;
|
||||
bool res = lmdb::dbi_get(txn, db, lmdb::val(user_id), value);
|
||||
txn.commit();
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
void
|
||||
Cache::saveTimelineMessages(lmdb::txn &txn,
|
||||
const std::string &room_id,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue