0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-16 17:08:20 +02:00

ircd:Ⓜ️:dbs: Assert room_id in room_state_key creations.

ircd:Ⓜ️:room::messages: Assert room_id in ctor.
This commit is contained in:
Jason Volk 2019-08-16 02:05:34 -07:00
parent 34c1b13fa3
commit 6e8111f25f
2 changed files with 7 additions and 0 deletions

View file

@ -3068,6 +3068,7 @@ ircd::m::dbs::room_state_key(const mutable_buffer &out_,
{
mutable_buffer out{out_};
consume(out, copy(out, room_id));
assert(room_id);
if(likely(defined(type)))
{

View file

@ -1695,6 +1695,8 @@ ircd::m::room::messages::messages(const m::room &room,
event::fetch::default_opts
}
{
assert(room.room_id);
if(room.event_id)
seek(room.event_id);
else
@ -1714,6 +1716,8 @@ ircd::m::room::messages::messages(const m::room &room,
event::fetch::default_opts
}
{
assert(room.room_id);
seek(event_id);
}
@ -1730,6 +1734,8 @@ ircd::m::room::messages::messages(const m::room &room,
event::fetch::default_opts
}
{
assert(room.room_id);
// As a special convenience for the ctor only, if the depth=0 and
// nothing is found another attempt is made for depth=1 for synapse
// rooms which start at depth=1.