Fix return codes

This commit is contained in:
Neil Alexander 2021-11-09 11:05:44 +00:00
parent 831f3b9307
commit 35bc2e98e6
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
2 changed files with 2 additions and 3 deletions

View file

@ -81,7 +81,6 @@ func JoinRoomByIDOrAlias(
defer close(done) defer close(done)
rsAPI.PerformJoin(req.Context(), &joinReq, &joinRes) rsAPI.PerformJoin(req.Context(), &joinReq, &joinRes)
if joinRes.Error != nil { if joinRes.Error != nil {
joinRes.Error.RemoteCode = http.StatusForbidden
done <- joinRes.Error.JSONResponse() done <- joinRes.Error.JSONResponse()
} else { } else {
done <- util.JSONResponse{ done <- util.JSONResponse{

View file

@ -322,8 +322,8 @@ func attemptMakeJoinForRestrictedMembership(
logger.Error("No room matching join rule memberships found") logger.Error("No room matching join rule memberships found")
return util.JSONResponse{ return util.JSONResponse{
Code: http.StatusBadRequest, Code: http.StatusForbidden,
JSON: jsonerror.UnableToAuthoriseJoin("You are not joined to any allowed rooms"), JSON: jsonerror.Forbidden("You are not joined to any allowed rooms"),
} }
} }