0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 18:22:50 +01:00

modules/client/rooms/messages: Fix pagination token related.

This commit is contained in:
Jason Volk 2019-04-18 15:11:48 -07:00
parent 8428774a25
commit 02bb466898

View file

@ -135,12 +135,12 @@ get__messages(client &client,
m::event::id::buf start
{
page.dir == 'b'? page.from : m::event::id::buf{}
page.from
};
m::event::id::buf end
{
page.dir == 'b'? page.to : m::event::id::buf{}
page.to
};
json::stack::array chunk
@ -152,11 +152,7 @@ get__messages(client &client,
for(; it; page.dir == 'b'? --it : ++it)
{
const m::event &event{*it};
if(page.dir != 'b')
start = at<"event_id"_>(event);
else
end = at<"event_id"_>(event);
end = at<"event_id"_>(event);
if(hit > page.limit || miss >= size_t(max_filter_miss))
break;