mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-12 09:23:09 -06:00
Fix computation of next public rooms batch
This commit is contained in:
parent
90ea505dbe
commit
1cdea0fd02
|
|
@ -70,8 +70,9 @@ func GetPublicRooms(
|
||||||
if offset > 0 {
|
if offset > 0 {
|
||||||
response.PrevBatch = strconv.Itoa(int(offset) - 1)
|
response.PrevBatch = strconv.Itoa(int(offset) - 1)
|
||||||
}
|
}
|
||||||
if response.Estimate > int64(limit) {
|
nextIndex := int(offset) + int(limit)
|
||||||
response.NextBatch = strconv.Itoa(int(offset) + int(limit))
|
if response.Estimate > int64(nextIndex) {
|
||||||
|
response.NextBatch = strconv.Itoa(nextIndex)
|
||||||
}
|
}
|
||||||
|
|
||||||
if response.Chunk, err = publicRoomDatabase.GetPublicRooms(offset, limit, request.Filter.SearchTerms); err != nil {
|
if response.Chunk, err = publicRoomDatabase.GetPublicRooms(offset, limit, request.Filter.SearchTerms); err != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue