0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-05-23 21:33:44 +02:00

ircd:Ⓜ️ Fix the existential room test.

This commit is contained in:
Jason Volk 2019-09-15 18:06:55 -07:00
parent 0f00468bb8
commit 8fe92eea9b

View file

@ -1233,7 +1233,21 @@ ircd::m::exists(const id::room &room_id)
dbs::room_events.begin(room_id)
};
return bool(it);
if(!it)
return false;
const auto &[depth, event_idx]
{
dbs::room_events_key(it->first)
};
if(likely(depth < 2UL))
return true;
if(my_host(room_id.host()) && creator(room_id, m::me))
return true;
return false;
}
bool