From 0b8b98f979cf7e4f0b018f9b319e14bf3366ffcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicole=20Miko=C5=82ajczyk?= Date: Sat, 17 May 2025 16:05:13 +0200 Subject: [PATCH] Add a failing test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nicole Mikołajczyk Signed-off-by: nicole mikołajczyk --- changelog.d/fix-lists-bcc.fix | 1 + .../web/activity_pub/publisher_test.exs | 27 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 changelog.d/fix-lists-bcc.fix diff --git a/changelog.d/fix-lists-bcc.fix b/changelog.d/fix-lists-bcc.fix new file mode 100644 index 000000000..cd819fea3 --- /dev/null +++ b/changelog.d/fix-lists-bcc.fix @@ -0,0 +1 @@ +Fix publisher when publishing to a list of users diff --git a/test/pleroma/web/activity_pub/publisher_test.exs b/test/pleroma/web/activity_pub/publisher_test.exs index a55993978..1f9e0bfe5 100644 --- a/test/pleroma/web/activity_pub/publisher_test.exs +++ b/test/pleroma/web/activity_pub/publisher_test.exs @@ -332,6 +332,33 @@ defmodule Pleroma.Web.ActivityPub.PublisherTest do ) end + test "activity with BCC is published to a list member." do + actor = insert(:user) + {:ok, list} = Pleroma.List.create("list", actor) + list_member = insert(:user, %{local: false}) + + Pleroma.List.follow(list, list_member) + + note_activity = + insert(:note_activity, + # recipients: [follower.ap_id], + data_attrs: %{"bcc" => [list.ap_id]} + ) + + res = Publisher.publish(actor, note_activity) + assert res == :ok + + assert_enqueued( + worker: "Pleroma.Workers.PublisherWorker", + args: %{ + "params" => %{ + inbox: list_member.inbox, + activity_id: note_activity.id + } + } + ) + end + test "publishes a delete activity to peers who signed fetch requests to the create acitvity/object." do fetcher = insert(:user,