mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-10 16:33:11 -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 {
|
||||
response.PrevBatch = strconv.Itoa(int(offset) - 1)
|
||||
}
|
||||
if response.Estimate > int64(limit) {
|
||||
response.NextBatch = strconv.Itoa(int(offset) + int(limit))
|
||||
nextIndex := 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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue