object: return the deleted object as well
authorWilliam Pitcock <nenolod@dereferenced.org>
Thu, 1 Nov 2018 07:47:50 +0000 (07:47 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Thu, 1 Nov 2018 07:47:50 +0000 (07:47 +0000)
lib/pleroma/object.ex
lib/pleroma/web/activity_pub/activity_pub.ex

index 8f96fd8fb31b624295347b0014c8b4deae8d6089..fddf3845031dd1db697b79bbd0767c876e0497cd 100644 (file)
@@ -57,7 +57,7 @@ defmodule Pleroma.Object do
     with Repo.delete(object),
          Repo.delete_all(Activity.all_non_create_by_object_ap_id_q(id)),
          {:ok, true} <- Cachex.del(:user_cache, "object:#{id}") do
-      :ok
+      {:ok, object}
     end
   end
 end
index 48ae36ebd58fb4802d30a9fd498f3d91e01a09ce..32c14995f3312ba4630eb777801fa210596710ad 100644 (file)
@@ -273,7 +273,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
       "to" => [user.follower_address, "https://www.w3.org/ns/activitystreams#Public"]
     }
 
-    with Object.delete(object),
+    with {:ok, _} <- Object.delete(object),
          {:ok, activity} <- insert(data, local),
          :ok <- maybe_federate(activity),
          {:ok, _actor} <- User.decrease_note_count(user) do