Fix delete-by_ap_id to expect not only embeded objects
authorrinpatch <rinpatch@sdf.org>
Wed, 17 Apr 2019 13:35:01 +0000 (16:35 +0300)
committerrinpatch <rinpatch@sdf.org>
Wed, 17 Apr 2019 13:35:01 +0000 (16:35 +0300)
lib/pleroma/activity.ex

index 478d163564bc2a4788d711d600218edbfb8e90b4..9043530c9caebfb5fbdc93cc937464210a145a5a 100644 (file)
@@ -230,6 +230,7 @@ defmodule Pleroma.Activity do
     |> Repo.delete_all()
     |> elem(1)
     |> Enum.find(fn
+      %{data: %{"type" => "Create", "object" => ap_id}} when is_binary(ap_id) -> ap_id == id
       %{data: %{"type" => "Create", "object" => %{"id" => ap_id}}} -> ap_id == id
       _ -> nil
     end)