0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-25 08:12:37 +01:00

ircd:Ⓜ️:room: Optimize internal(room) query pattern.

This commit is contained in:
Jason Volk 2020-10-31 08:28:22 -07:00
parent c56b4a4ee9
commit 8a078b78fd

View file

@ -953,13 +953,21 @@ ircd::m::internal(const id::room &room_id)
if(!my(room))
return false;
if(!exists(room))
return false;
const room::state state
{
room
};
if(!creator(room, me()))
return false;
const auto create_idx
{
state.get(std::nothrow, "m.room.create", "")
};
return true;
return m::query(std::nothrow, create_idx, "sender", []
(const string_view &sender)
{
return sender == me();
});
}
bool