Broadcast deleted activity id on deletion to conform to MastoAPI streamig spec
[akkoma] / lib / pleroma / web / activity_pub / activity_pub.ex
index adb42b9abe6c2c2f5b6e2a16627a88fdac570285..2f11f8984a1063db622dd96ace6a9dbb75576459 100644 (file)
@@ -311,14 +311,14 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
     user = User.get_cached_by_ap_id(actor)
     to = object.data["to"] || [] ++ object.data["cc"] || []
 
-    data = %{
-      "type" => "Delete",
-      "actor" => actor,
-      "object" => id,
-      "to" => to
-    }
-
-    with {:ok, _} <- Object.delete(object),
+    with {:ok, object, activity} <- Object.delete(object),
+         data <- %{
+           "type" => "Delete",
+           "actor" => actor,
+           "object" => id,
+           "to" => to,
+           "deleted_activity_id" => activity && activity.id
+         },
          {:ok, activity} <- insert(data, local),
          # Changing note count prior to enqueuing federation task in order to avoid race conditions on updating user.info
          {:ok, _actor} <- decrease_note_count_if_public(user, object),