diff --git a/clientapi/routing/account_data.go b/clientapi/routing/account_data.go index a6477fdea..a2c1596e0 100644 --- a/clientapi/routing/account_data.go +++ b/clientapi/routing/account_data.go @@ -148,15 +148,15 @@ func SaveReadMarker( fullUserID, err := spec.NewUserID(device.UserID, true) if err != nil { return util.JSONResponse{ - Code: http.StatusForbidden, - JSON: spec.Forbidden("userID doesn't have power level to change visibility"), + Code: http.StatusBadRequest, + JSON: spec.BadJSON("userID for this device is invalid"), } } senderID, err := rsAPI.QuerySenderIDForUser(req.Context(), roomID, *fullUserID) if err != nil { return util.JSONResponse{ - Code: http.StatusForbidden, - JSON: spec.Forbidden("userID doesn't have power level to change visibility"), + Code: http.StatusBadRequest, + JSON: spec.Unknown("failed to find senderID for this user"), } } diff --git a/clientapi/routing/directory.go b/clientapi/routing/directory.go index 516a158e1..e9fc8e466 100644 --- a/clientapi/routing/directory.go +++ b/clientapi/routing/directory.go @@ -317,15 +317,15 @@ func SetVisibility( fullUserID, err := spec.NewUserID(dev.UserID, true) if err != nil { return util.JSONResponse{ - Code: http.StatusForbidden, - JSON: spec.Forbidden("userID doesn't have power level to change visibility"), + Code: http.StatusBadRequest, + JSON: spec.BadJSON("userID for this device is invalid"), } } senderID, err := rsAPI.QuerySenderIDForUser(req.Context(), roomID, *fullUserID) if err != nil { return util.JSONResponse{ - Code: http.StatusForbidden, - JSON: spec.Forbidden("userID doesn't have power level to change visibility"), + Code: http.StatusBadRequest, + JSON: spec.Unknown("failed to find senderID for this user"), } }