From 9329b571bbecd76ccdfa5f991c8d66f2ab408af7 Mon Sep 17 00:00:00 2001 From: behouba Date: Fri, 18 Jan 2019 22:30:22 +0400 Subject: [PATCH] Fix response to /rooms/{roomId}/join --- .../matrix-org/dendrite/clientapi/routing/routing.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/github.com/matrix-org/dendrite/clientapi/routing/routing.go b/src/github.com/matrix-org/dendrite/clientapi/routing/routing.go index 1d95ffe72..7f22e69f5 100644 --- a/src/github.com/matrix-org/dendrite/clientapi/routing/routing.go +++ b/src/github.com/matrix-org/dendrite/clientapi/routing/routing.go @@ -95,7 +95,14 @@ func Setup( r0mux.Handle("/rooms/{roomID}/{membership:(?:join|kick|ban|unban|leave|invite)}", common.MakeAuthAPI("membership", authData, func(req *http.Request, device *authtypes.Device) util.JSONResponse { vars := mux.Vars(req) - return SendMembership(req, accountDB, device, vars["roomID"], vars["membership"], cfg, queryAPI, asAPI, producer) + r := SendMembership(req, accountDB, device, vars["roomID"], vars["membership"], cfg, queryAPI, asAPI, producer) + if r.Code == http.StatusOK && vars["membership"] == "join" { + r.JSON = struct { + RoomID string `json:"room_id"` + }{vars["roomID"]} + return r + } + return r }), ).Methods(http.MethodPost, http.MethodOptions) r0mux.Handle("/rooms/{roomID}/send/{eventType}",