Adjust delete activity audience to match the deleted object

This commit is contained in:
Karen Konou 2019-03-07 12:26:03 +01:00
parent 6a69ece437
commit c2faae70df

View File

@ -309,16 +309,13 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub 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),