From fe6d2ecc970008f99f9d948b86e5da07e80c2a29 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Thu, 12 Jun 2025 22:33:57 -0700 Subject: [PATCH] Test for unlisted but Publisher param_cc is not empty --- .../web/activity_pub/publisher_test.exs | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/pleroma/web/activity_pub/publisher_test.exs b/test/pleroma/web/activity_pub/publisher_test.exs index 7bc571595..b7ff0ed5f 100644 --- a/test/pleroma/web/activity_pub/publisher_test.exs +++ b/test/pleroma/web/activity_pub/publisher_test.exs @@ -546,6 +546,28 @@ defmodule Pleroma.Web.ActivityPub.PublisherTest do {:ok, decoded} = Jason.decode(prepared.json) assert @as_public in decoded["cc"] + + # maybe we also have another inbox in cc + # during Publishing + activity = + insert(:note_activity, + user: user, + data_attrs: %{ + "cc" => [@as_public], + "to" => [user.follower_address] + } + ) + + prepared = + Publisher.prepare_one(%{ + inbox: "https://remote.instance/users/someone/inbox", + activity_id: activity.id, + cc: ["https://remote.instance/users/someone_else/inbox"] + }) + + {:ok, decoded} = Jason.decode(prepared.json) + + assert decoded["cc"] == [@as_public, "https://remote.instance/users/someone_else/inbox"] end test "public address in cc parameter is preserved" do