api/statuses: allow quoting local statuses locally
All checks were successful
ci/woodpecker/pr/test/2 Pipeline was successful
ci/woodpecker/pr/test/1 Pipeline was successful

This commit is contained in:
Oneric 2026-02-07 00:00:00 +00:00
commit fd87664b9e
2 changed files with 18 additions and 3 deletions

View file

@ -147,6 +147,7 @@ defmodule Pleroma.Web.CommonAPI.ActivityDraft do
quoting_visibility = CommonAPI.get_quoted_visibility(quoting)
quoting_visibility in ["public", "unlisted"] or
(quoting_visibility == "local" && quote_visibility == quoting_visibility) or
(quoting_visibility == "private" && quote_visibility == quoting_visibility &&
actor == quoted_author)
end
@ -171,7 +172,7 @@ defmodule Pleroma.Web.CommonAPI.ActivityDraft do
draft,
dgettext(
"errors",
"You can only quote public or unlisted statuses and your own private posts"
"You cannot quote this status at all or not with the intended visibility"
)
)
end

View file

@ -2542,7 +2542,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
assert %{
"error" =>
"You can only quote public or unlisted statuses and your own private posts"
"You cannot quote this status at all or not with the intended visibility"
} =
conn
|> put_req_header("content-type", "application/json")
@ -2572,7 +2572,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
assert %{
"error" =>
"You can only quote public or unlisted statuses and your own private posts"
"You cannot quote this status at all or not with the intended visibility"
} =
conn
|> put_req_header("content-type", "application/json")
@ -2584,6 +2584,20 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
|> json_response_and_validate_schema(422)
end
test "posting a quote, quoting a local post locally", %{conn: conn} do
other = insert(:user)
{:ok, local_status} = CommonAPI.post(other, %{status: "epsilon", visibility: "local"})
conn
|> put_req_header("content-type", "application/json")
|> post("/api/v1/statuses", %{
"status" => "greater than zero",
"visibility" => "local",
"quoted_status_id" => local_status.id
})
|> json_response_and_validate_schema(200)
end
test "posting a quote, after quote, the status gets deleted", %{conn: conn} do
user = insert(:user)