Use structure for response to match with the spec

This commit is contained in:
Brendan Abolivier 2017-08-24 15:00:24 +01:00
parent d2f2841736
commit 81e454c0ba
No known key found for this signature in database
GPG key ID: 8EF1500759F70623

View file

@ -23,9 +23,14 @@ import (
"github.com/matrix-org/dendrite/clientapi/jsonerror"
"github.com/matrix-org/dendrite/common/config"
"github.com/matrix-org/dendrite/roomserver/api"
"github.com/matrix-org/gomatrixserverlib"
"github.com/matrix-org/util"
)
type response struct {
Chunk []gomatrixserverlib.ClientEvent `json:"chunk"`
}
// GetMemberships implements GET /rooms/{roomId}/members
func GetMemberships(
req *http.Request, device *authtypes.Device, roomID string,
@ -50,6 +55,6 @@ func GetMemberships(
return util.JSONResponse{
Code: 200,
JSON: queryRes.JoinEvents,
JSON: response{queryRes.JoinEvents},
}
}