remove fake activity marker, dont wrap if already an activity
Some checks are pending
ci/woodpecker/pr/build-amd64 Pipeline is pending approval
ci/woodpecker/pr/build-arm64 Pipeline is pending approval
ci/woodpecker/pr/docs Pipeline is pending approval
ci/woodpecker/pr/lint Pipeline is pending approval
ci/woodpecker/pr/test Pipeline is pending approval

This commit is contained in:
TudbuT 2024-11-03 21:28:00 +01:00
parent 2709dd40ef
commit 3e4424684f
2 changed files with 3 additions and 4 deletions

View file

@ -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"])

View file

@ -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