0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 15:33:54 +01:00

modules/m_breadcrumb_rooms: Update for room::events prefetching interface here.

This commit is contained in:
Jason Volk 2019-09-24 15:42:44 -07:00
parent 8880eadfd5
commit 0d9d5a8c24

View file

@ -93,29 +93,17 @@ ircd::m::handle_breadcrumb_rooms_focus_in(const event &event,
if(!focus_in)
return;
room::events it
const size_t prefetched
{
focus_in
m::room::events::prefetch_viewport(focus_in)
};
ssize_t prefetched(0), i(0);
const ssize_t prefetch_max
{
ssize_t(room::events::viewport_size) / 2
};
for(; it && i < prefetch_max / 2; ++i, --it)
prefetched += m::prefetch(it.event_idx());
log::debug
{
m::log, "Prefetched %zu/%zu viewport:%zu of %s for %s now in focus",
m::log, "Prefetched %zu recent events to focus %s for %s",
prefetched,
i,
prefetch_max,
string_view{focus_in},
at<"sender"_>(event),
rooms.size(),
};
}