commit: 23be24b92fa4f868b814b2c6927f2a6a69fa882d
parent 9f79df75082cfc563ce7816a1839800aa22ec350
Author: Mark Felder <feld@feld.me>
Date: Thu, 12 Jun 2025 21:37:50 -0700
Fix federation issue where Public visibility information in cc field was lost when sent to remote servers, causing posts to appear with inconsistent visibility across instances
Diffstat:
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/changelog.d/preserve-public-cc.fix b/changelog.d/preserve-public-cc.fix
@@ -0,0 +1 @@
+Fix federation issue where Public visibility information in cc field was lost when sent to remote servers, causing posts to appear with inconsistent visibility across instances
diff --git a/lib/pleroma/web/activity_pub/publisher.ex b/lib/pleroma/web/activity_pub/publisher.ex
@@ -93,7 +93,20 @@ defmodule Pleroma.Web.ActivityPub.Publisher do
{:ok, data} = Transmogrifier.prepare_outgoing(activity.data)
- cc = Map.get(params, :cc, [])
+ param_cc = Map.get(params, :cc, [])
+
+ original_cc = Map.get(data, "cc", [])
+
+ public_address = Pleroma.Constants.as_public()
+
+ # Avoid overriding explicitly set cc values for specific recipients.
+ # e.g., this ensures unlisted posts are visible to users on other servers.
+ cc =
+ if public_address in original_cc and param_cc == [] do
+ [public_address]
+ else
+ param_cc
+ end
json =
data