Tidy up a bit

This commit is contained in:
Neil Alexander 2020-01-20 16:06:25 +00:00
parent 490c40f5f3
commit 54838a7b7a
2 changed files with 4 additions and 12 deletions

View file

@ -82,5 +82,4 @@ func SetupSyncAPIComponent(
}
routing.Setup(base.APIMux, requestPool, syncDB, deviceDB, federation, queryAPI, cfg)
//routing.Setup(base.APIMux, requestPool, syncDB, deviceDB)
}

View file

@ -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
}