mirror of
https://github.com/matrix-construct/construct
synced 2024-12-27 16:04:15 +01:00
ircd:Ⓜ️ Use room::events for exists(room_id) impl.
This commit is contained in:
parent
839ca6f000
commit
b0c386d54a
1 changed files with 3 additions and 8 deletions
|
@ -1241,20 +1241,15 @@ ircd::m::internal(const id::room &room_id)
|
|||
bool
|
||||
ircd::m::exists(const id::room &room_id)
|
||||
{
|
||||
const auto it
|
||||
const m::room::events it
|
||||
{
|
||||
dbs::room_events.begin(room_id)
|
||||
room_id, 0UL
|
||||
};
|
||||
|
||||
if(!it)
|
||||
return false;
|
||||
|
||||
const auto &[depth, event_idx]
|
||||
{
|
||||
dbs::room_events_key(it->first)
|
||||
};
|
||||
|
||||
if(likely(depth < 2UL))
|
||||
if(likely(it.depth() < 2UL))
|
||||
return true;
|
||||
|
||||
if(my_host(room_id.host()) && creator(room_id, m::me))
|
||||
|
|
Loading…
Reference in a new issue