mirror of
https://github.com/matrix-construct/construct
synced 2025-01-13 16:33:53 +01:00
ircd:Ⓜ️:room::events: Comment on ctors; minor assertions.
This commit is contained in:
parent
94e4891187
commit
11f878209f
2 changed files with 16 additions and 5 deletions
|
@ -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);
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue