Transmogrifier: Actually store who deleted a note.
[akkoma] / lib / pleroma / web / activity_pub / activity_pub.ex
index 3a0c382ca9f2b2ca9946436a7f4be26eee5da24b..f785744556825a2e30c08f8e31dff99522f2efec 100644 (file)
@@ -412,19 +412,21 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
   def delete(%Object{data: %{"id" => id, "actor" => actor}} = object, options \\ []) do
     local = Keyword.get(options, :local, true)
     activity_id = Keyword.get(options, :activity_id, nil)
+    actor = Keyword.get(options, :actor, actor)
 
     user = User.get_cached_by_ap_id(actor)
     to = (object.data["to"] || []) ++ (object.data["cc"] || [])
 
     with {:ok, object, activity} <- Object.delete(object),
-         data <- %{
-           "type" => "Delete",
-           "actor" => actor,
-           "object" => id,
-           "to" => to,
-           "deleted_activity_id" => activity && activity.id
-         }
-         |> maybe_put("id", activity_id),
+         data <-
+           %{
+             "type" => "Delete",
+             "actor" => actor,
+             "object" => id,
+             "to" => to,
+             "deleted_activity_id" => activity && activity.id
+           }
+           |> maybe_put("id", activity_id),
          {:ok, activity} <- insert(data, local, false),
          stream_out_participations(object, user),
          _ <- decrease_replies_count_if_reply(object),