0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-05-28 15:53:46 +02:00

ircd:Ⓜ️:room::events: Comment on ctors; minor assertions.

This commit is contained in:
Jason Volk 2022-07-09 14:10:28 -07:00
parent 94e4891187
commit 11f878209f
2 changed files with 16 additions and 5 deletions

View file

@ -89,14 +89,18 @@ struct ircd::m::room::events
bool prefetch(const string_view &event_prop);
bool prefetch(); // uses supplied fetch::opts.
// Seeks to closest event in the room by depth; room.event_id ignored.
events(const m::room &,
const uint64_t &depth,
const event::fetch::opts *const & = nullptr);
// Seeks to event_id; null iteration when not found; seekless when empty.
events(const m::room &,
const event::id &,
const event::fetch::opts *const & = nullptr);
// Seeks to latest event in the room unless room.event_id given. Null
// iteration when given and not found.
events(const m::room &,
const event::fetch::opts *const & = nullptr);

View file

@ -246,11 +246,14 @@ ircd::m::room::events::events(const m::room &room,
}
{
assert(room.room_id);
const bool found
{
room.event_id?
seek(room.event_id):
seek()
};
if(room.event_id)
seek(room.event_id);
else
seek();
assert(found == bool(*this));
}
ircd::m::room::events::events(const m::room &room,
@ -267,8 +270,12 @@ ircd::m::room::events::events(const m::room &room,
}
{
assert(room.room_id);
const bool found
{
seek(event_id)
};
seek(event_id);
assert(found == bool(*this));
}
ircd::m::room::events::events(const m::room &room,