mirror of
https://github.com/matrix-construct/construct
synced 2024-12-28 08:24:08 +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
|
bool
|
||||||
ircd::m::exists(const id::room &room_id)
|
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)
|
if(!it)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
const auto &[depth, event_idx]
|
if(likely(it.depth() < 2UL))
|
||||||
{
|
|
||||||
dbs::room_events_key(it->first)
|
|
||||||
};
|
|
||||||
|
|
||||||
if(likely(depth < 2UL))
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if(my_host(room_id.host()) && creator(room_id, m::me))
|
if(my_host(room_id.host()) && creator(room_id, m::me))
|
||||||
|
|
Loading…
Reference in a new issue