From 91c82c5198d1d1b456e3dccbf1501512bfadf757 Mon Sep 17 00:00:00 2001 From: Till Faelligen <2353100+S7evinK@users.noreply.github.com> Date: Thu, 15 Sep 2022 14:44:20 +0200 Subject: [PATCH] Fix next_batch --- syncapi/routing/search.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/syncapi/routing/search.go b/syncapi/routing/search.go index 4b048e2c2..59207a999 100644 --- a/syncapi/routing/search.go +++ b/syncapi/routing/search.go @@ -218,9 +218,10 @@ func Search(req *http.Request, device *api.Device, syncDB storage.Database, fts } } - nb := "" + var nextBatchResult *string = nil if int(result.Total) > nextBatch+len(results) { - nb = strconv.Itoa(len(results) + nextBatch) + nb := strconv.Itoa(len(results) + nextBatch) + nextBatchResult = &nb } res := SearchResponse{ @@ -229,7 +230,7 @@ func Search(req *http.Request, device *api.Device, syncDB storage.Database, fts Count: int(result.Total), Groups: Groups{RoomID: groups}, Results: results, - NextBatch: &nb, + NextBatch: nextBatchResult, Highlights: strings.Split(searchReq.SearchCategories.RoomEvents.SearchTerm, " "), State: stateForRooms, },