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:
parent
c56b4a4ee9
commit
8a078b78fd
1 changed files with 13 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue