mirror of
https://github.com/matrix-construct/construct
synced 2024-10-03 22:28:52 +02:00
modules/client/rooms/context: Omit pagination tokens for ends of iteration.
This commit is contained in:
parent
79782958fc
commit
811e4f8c03
1 changed files with 6 additions and 2 deletions
|
@ -132,11 +132,13 @@ get__context(client &client,
|
|||
array.append(event);
|
||||
}
|
||||
|
||||
if(before)
|
||||
if(before && limit > 0)
|
||||
--before;
|
||||
|
||||
if(before)
|
||||
start = before.event_id();
|
||||
else
|
||||
start = {};
|
||||
}
|
||||
|
||||
json::stack::member
|
||||
|
@ -166,11 +168,13 @@ get__context(client &client,
|
|||
array.append(event);
|
||||
}
|
||||
|
||||
if(after)
|
||||
if(after && limit > 0)
|
||||
++after;
|
||||
|
||||
if(after)
|
||||
end = after.event_id();
|
||||
else
|
||||
end = {};
|
||||
}
|
||||
|
||||
json::stack::member
|
||||
|
|
Loading…
Reference in a new issue