From 54838a7b7a4e71c5e9ea9609e5489be4297cab02 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Mon, 20 Jan 2020 16:06:25 +0000 Subject: [PATCH] Tidy up a bit --- syncapi/syncapi.go | 1 - syncapi/types/types.go | 15 ++++----------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/syncapi/syncapi.go b/syncapi/syncapi.go index 81987f5f1..ecf532ca2 100644 --- a/syncapi/syncapi.go +++ b/syncapi/syncapi.go @@ -82,5 +82,4 @@ func SetupSyncAPIComponent( } routing.Setup(base.APIMux, requestPool, syncDB, deviceDB, federation, queryAPI, cfg) - //routing.Setup(base.APIMux, requestPool, syncDB, deviceDB) } diff --git a/syncapi/types/types.go b/syncapi/types/types.go index 08a0239b6..1abb9b5a5 100644 --- a/syncapi/types/types.go +++ b/syncapi/types/types.go @@ -160,17 +160,6 @@ type Response struct { } `json:"rooms"` } -/* - -func NewResponse(pos StreamPosition) *Response { - res := Response{} - // Fill next_batch with a pagination token. Since this is a response to a sync request, we can assume - // we'll always return a stream token. - res.NextBatch = NewPaginationTokenFromTypeAndPosition(PaginationTokenTypeStream, pos).String() -} - -*/ - // NewResponse creates an empty response with initialised maps. func NewResponse(pos SyncPosition) *Response { res := Response{ @@ -189,6 +178,10 @@ func NewResponse(pos SyncPosition) *Response { res.AccountData.Events = make([]gomatrixserverlib.ClientEvent, 0) res.Presence.Events = make([]gomatrixserverlib.ClientEvent, 0) + // Fill next_batch with a pagination token. Since this is a response to a sync request, we can assume + // we'll always return a stream token. + res.NextBatch = NewPaginationTokenFromTypeAndPosition(PaginationTokenTypeStream, pos).String() + return &res }