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)
rsAPI.PerformJoin(req.Context(), &joinReq, &joinRes)
if joinRes.Error != nil {
joinRes.Error.RemoteCode = http.StatusForbidden
done <- joinRes.Error.JSONResponse()
} else {
done <- util.JSONResponse{

View file

@ -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"),
}
}