Fix response to /rooms/{roomId}/join #607

This commit is contained in:
behouba 2019-01-17 19:56:32 +04:00
parent ad700396e6
commit 72057ac2c1
2 changed files with 9 additions and 1 deletions

View file

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

View file

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