AP C2S: Use common pipelin for deletes.
authorlain <lain@soykaf.club>
Thu, 30 Apr 2020 14:49:41 +0000 (16:49 +0200)
committerlain <lain@soykaf.club>
Thu, 30 Apr 2020 14:49:41 +0000 (16:49 +0200)
lib/pleroma/web/activity_pub/activity_pub_controller.ex

index d625530ecb575586986e22735544299733fe498a..e68d0763e99140da64af86f0736d66354b6fbf8a 100644 (file)
@@ -414,7 +414,8 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubController do
   defp handle_user_activity(%User{} = user, %{"type" => "Delete"} = params) do
     with %Object{} = object <- Object.normalize(params["object"]),
          true <- user.is_moderator || user.ap_id == object.data["actor"],
-         {:ok, delete} <- ActivityPub.delete(object) do
+         {:ok, delete_data, _} <- Builder.delete(user, object.data["id"]),
+         {:ok, delete, _} <- Pipeline.common_pipeline(delete_data, local: true) do
       {:ok, delete}
     else
       _ -> {:error, dgettext("errors", "Can't delete object")}