From 3e4424684fbe625877d9ea7f738ecf4f6002922e Mon Sep 17 00:00:00 2001 From: TudbuT Date: Sun, 3 Nov 2024 21:28:00 +0100 Subject: [PATCH] remove fake activity marker, dont wrap if already an activity --- lib/pleroma/object/fetcher.ex | 4 +++- lib/pleroma/web/activity_pub/transmogrifier.ex | 3 --- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/pleroma/object/fetcher.ex b/lib/pleroma/object/fetcher.ex index 1815a06e4..228eb604b 100644 --- a/lib/pleroma/object/fetcher.ex +++ b/lib/pleroma/object/fetcher.ex @@ -210,13 +210,15 @@ defp log_fetch_error(id, error) do Logger.error("Object rejected while fetching #{id} #{inspect(error)}") end + # if its already an activity, dont wrap + defp prepare_activity_params(%{"object" => _ } = data), do: data + defp prepare_activity_params(data) do %{ "type" => "Create", # Should we seriously keep this attributedTo thing? "actor" => data["actor"] || data["attributedTo"], "object" => data, - "_akkoma_fake" => true } |> Maps.put_if_present("to", data["to"]) |> Maps.put_if_present("cc", data["cc"]) diff --git a/lib/pleroma/web/activity_pub/transmogrifier.ex b/lib/pleroma/web/activity_pub/transmogrifier.ex index a4f8ca06a..75c1f0f0c 100644 --- a/lib/pleroma/web/activity_pub/transmogrifier.ex +++ b/lib/pleroma/web/activity_pub/transmogrifier.ex @@ -637,9 +637,6 @@ defp handle_incoming_normalised( end end - defp handle_incoming_normalised(%{"object" => o, "_akkoma_fake" => true}, options), - do: handle_incoming_normalised(o, options) - defp handle_incoming_normalised(_, _), do: :error @spec get_obj_helper(String.t(), Keyword.t()) :: {:ok, Object.t()} | nil