commit: 2a176b64d5508e2a2e329644a8c6fdace993c952
parent d99306593aaf5f1a430f85a7614eaf28898cd7e1
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Mon, 1 Mar 2021 22:02:07 +0100
Revert "Transmogrifier: Check object/activity existance for incoming Delete/Undo"
This reverts commit 686453917fdbea9cd23c3d7ba73af8f888b07286.
Diffstat:
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/lib/pleroma/web/activity_pub/transmogrifier.ex b/lib/pleroma/web/activity_pub/transmogrifier.ex
@@ -514,13 +514,10 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
%{"type" => "Delete"} = data,
_options
) do
- with {_, %Object{}} <- {:normalize, Object.normalize(data["object"], false)},
- {:ok, activity, _} <- Pipeline.common_pipeline(data, local: false) do
+ with {:ok, activity, _} <-
+ Pipeline.common_pipeline(data, local: false) do
{:ok, activity}
else
- {:normalize, nil} ->
- {:error, "Unknown object to Delete"}
-
{:error, {:validate, _}} = e ->
# Check if we have a create activity for this
with {:ok, object_id} <- ObjectValidators.ObjectID.cast(data["object"]),
@@ -561,17 +558,13 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
def handle_incoming(
%{
"type" => "Undo",
- "object" => %{"type" => type, "id" => act_id}
+ "object" => %{"type" => type}
} = data,
_options
)
when type in ["Like", "EmojiReact", "Announce", "Block"] do
- with {_, %Activity{}} <- {:normalize, Activity.get_by_id(act_id)},
- {:ok, activity, _} <- Pipeline.common_pipeline(data, local: false) do
+ with {:ok, activity, _} <- Pipeline.common_pipeline(data, local: false) do
{:ok, activity}
- else
- {:normalize, nil} -> {:error, "Unknown activity to Undo"}
- e -> e
end
end
@@ -589,7 +582,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
|> Map.put("object", data)
|> handle_incoming(options)
else
- nil -> {:error, "Unknown activity to Undo"}
+ _e -> :error
end
end