Commit c2faae70 authored by Karen Konou's avatar Karen Konou
Browse files

Adjust delete activity audience to match the deleted object

parent 6a69ece4
Pipeline #8671 passed with stages
in 3 minutes and 14 seconds
......@@ -309,16 +309,13 @@ def unfollow(follower, followed, activity_id \\ nil, local \\ true) do
def delete(%Object{data: %{"id" => id, "actor" => actor}} = object, local \\ true) do
user = User.get_cached_by_ap_id(actor)
to =
object.data["to"] || [] ++ object.data["cc"] ||
[] ++ [user.follower_address, "https://www.w3.org/ns/activitystreams#Public"]
to = object.data["to"] || [] ++ object.data["cc"] || []
data = %{
"type" => "Delete",
"actor" => actor,
"object" => id,
"to" => Enum.uniq(to)
"to" => to
}
with {:ok, _} <- Object.delete(object),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment