diff --git a/clientapi/routing/joinroom.go b/clientapi/routing/joinroom.go index 74b6a93ce..578aaec56 100644 --- a/clientapi/routing/joinroom.go +++ b/clientapi/routing/joinroom.go @@ -81,7 +81,6 @@ func JoinRoomByIDOrAlias( defer close(done) rsAPI.PerformJoin(req.Context(), &joinReq, &joinRes) if joinRes.Error != nil { - joinRes.Error.RemoteCode = http.StatusForbidden done <- joinRes.Error.JSONResponse() } else { done <- util.JSONResponse{ diff --git a/federationapi/routing/join.go b/federationapi/routing/join.go index 1e685940a..0f213048c 100644 --- a/federationapi/routing/join.go +++ b/federationapi/routing/join.go @@ -322,8 +322,8 @@ func attemptMakeJoinForRestrictedMembership( logger.Error("No room matching join rule memberships found") return util.JSONResponse{ - Code: http.StatusBadRequest, - JSON: jsonerror.UnableToAuthoriseJoin("You are not joined to any allowed rooms"), + Code: http.StatusForbidden, + JSON: jsonerror.Forbidden("You are not joined to any allowed rooms"), } }