mirror of
https://git.pleroma.social/sjw/pleroma.git
synced 2024-12-26 22:55:12 +01:00
Remove doubled 'to' recipients.
This commit is contained in:
parent
8141024259
commit
df71c142cf
@ -24,7 +24,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
|
||||
|
||||
activity = %{
|
||||
"type" => "Create",
|
||||
"to" => to,
|
||||
"to" => to |> Enum.uniq,
|
||||
"actor" => actor.ap_id,
|
||||
"object" => object,
|
||||
"published" => published,
|
||||
|
@ -40,6 +40,13 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
|
||||
end
|
||||
end
|
||||
|
||||
describe "create activities" do
|
||||
test "removes doubled 'to' recipients" do
|
||||
{:ok, activity} = ActivityPub.create(["user1", "user1", "user2"], %User{ap_id: "1"}, "", %{})
|
||||
assert activity.data["to"] == ["user1", "user2"]
|
||||
end
|
||||
end
|
||||
|
||||
describe "fetch activities for recipients" do
|
||||
test "retrieve the activities for certain recipients" do
|
||||
{:ok, activity_one} = ActivityBuilder.insert(%{"to" => ["someone"]})
|
||||
|
Loading…
Reference in New Issue
Block a user