0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-09-28 19:58:53 +02:00

modules/client/sync/rooms/timeline: Fix timeline limited flag condition; minor cleanup.

This commit is contained in:
Jason Volk 2020-10-17 21:00:37 -07:00
parent 6fce2adc69
commit e0cc786a9d

View file

@ -227,7 +227,7 @@ ircd::m::sync::room_timeline_polylog(data &data)
// events // events
assert(data.room); assert(data.room);
bool limited{false}, ret{false}; bool limited{true}, ret{false};
m::event::id::buf prev m::event::id::buf prev
{ {
_room_timeline_polylog_events(data, *data.room, limited, ret) _room_timeline_polylog_events(data, *data.room, limited, ret)
@ -288,15 +288,15 @@ ircd::m::sync::_room_timeline_polylog_events(data &data,
continue; continue;
if(event_idx < data.range.first) if(event_idx < data.range.first)
{
limited = false;
break; break;
}
if(limit > 1) prefetched += limit > 1 && m::prefetch(event_idx);
prefetched += m::prefetch(event_idx);
++i; ++i;
} }
limited = i > limit;
if(i > 1 && !it) if(i > 1 && !it)
it.seek(event_idx); it.seek(event_idx);