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
This commit is contained in:
parent
9f79df7508
commit
23be24b92f
2 changed files with 15 additions and 1 deletions
1
changelog.d/preserve-public-cc.fix
Normal file
1
changelog.d/preserve-public-cc.fix
Normal file
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue