ActivityDraft: mention the OP of a quoted post

This commit is contained in:
Alex Gleason 2022-01-23 15:46:44 -06:00 committed by tusooa
commit 54a9897938
No known key found for this signature in database
GPG key ID: 42AEC43D48433C51
2 changed files with 23 additions and 8 deletions

View file

@ -807,6 +807,18 @@ defmodule Pleroma.Web.CommonAPITest do
quote_post = Object.normalize(quote_post)
assert quote_post.data["quoteUrl"] == quoted.data["id"]
# The OP is mentioned
assert quoted.data["actor"] in quote_post.data["to"]
end
test "quote posting with explicit addressing doesn't mention the OP" do
user = insert(:user)
{:ok, quoted} = CommonAPI.post(user, %{status: "Hello world"})
{:ok, quote_post} = CommonAPI.post(user, %{status: "nice post", quote_id: quoted.id, to: []})
assert Object.normalize(quote_post).data["to"] == [Pleroma.Constants.as_public()]
end
end