Adjust delete activity audience to match the deleted object
This commit is contained in:
parent
6a69ece437
commit
c2faae70df
1 changed files with 2 additions and 5 deletions
|
@ -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),
|
||||
|
|
Loading…
Reference in a new issue