From 72057ac2c1047a34a0c02350700c476a49d74f6b Mon Sep 17 00:00:00 2001 From: behouba Date: Thu, 17 Jan 2019 19:56:32 +0400 Subject: [PATCH] Fix response to /rooms/{roomId}/join #607 --- .../matrix-org/dendrite/clientapi/routing/joinroom.go | 2 +- .../matrix-org/dendrite/clientapi/routing/membership.go | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/github.com/matrix-org/dendrite/clientapi/routing/joinroom.go b/src/github.com/matrix-org/dendrite/clientapi/routing/joinroom.go index 98c7cd6a7..8a027ab87 100644 --- a/src/github.com/matrix-org/dendrite/clientapi/routing/joinroom.go +++ b/src/github.com/matrix-org/dendrite/clientapi/routing/joinroom.go @@ -108,7 +108,7 @@ func (r joinRoomReq) joinRoomByID(roomID string) util.JSONResponse { // A client should only join a room by room ID when it has an invite // to the room. If the server is already in the room then we can // lookup the invite and process the request as a normal state event. - // If the server is not in the room the we will need to look up the + // If the server is not in the room then we will need to look up the // remote server the invite came from in order to request a join event // from that server. queryReq := roomserverAPI.QueryInvitesForUserRequest{ diff --git a/src/github.com/matrix-org/dendrite/clientapi/routing/membership.go b/src/github.com/matrix-org/dendrite/clientapi/routing/membership.go index b308de79a..2cb67c947 100644 --- a/src/github.com/matrix-org/dendrite/clientapi/routing/membership.go +++ b/src/github.com/matrix-org/dendrite/clientapi/routing/membership.go @@ -114,6 +114,14 @@ func SendMembership( return httputil.LogThenError(req, err) } + if membership == "join" { + return util.JSONResponse{ + Code: http.StatusOK, + JSON: struct { + RoomID string `json:"room_id"` + }{roomID}, + } + } return util.JSONResponse{ Code: http.StatusOK, JSON: struct{}{},