WIP: Add backfilling of posts #846

Draft
tudbut wants to merge 19 commits from tudbut/akkoma:develop into develop
3 changed files with 5 additions and 4 deletions
Showing only changes of commit 2afa62cf3c - Show all commits

View file

@ -19,7 +19,7 @@ def cast(object) when is_binary(object) do
def cast(%{"id" => object}), do: cast(object)
def cast(o), do: {:error, o}
def cast(_), do: :error
def dump(data), do: {:ok, data}

View file

@ -215,7 +215,8 @@ defp prepare_activity_params(data) do
"type" => "Create",
# Should we seriously keep this attributedTo thing?
"actor" => data["actor"] || data["attributedTo"],
"object" => data
"object" => data,
"_akkoma_fake" => true,
}
|> Maps.put_if_present("to", data["to"])
|> Maps.put_if_present("cc", data["cc"])

View file

@ -637,10 +637,10 @@ defp handle_incoming_normalised(
end
end
defp handle_incoming_normalised(%{"object" => o}, options),
defp handle_incoming_normalised(%{"object" => o, "_akkoma_fake" => true}, options),
do: handle_incoming_normalised(o, options)
defp handle_incoming_normalised(o, _), do: {:error, {:unknown_object_class, o}}
defp handle_incoming_normalised(o, _), do: :error
@spec get_obj_helper(String.t(), Keyword.t()) :: {:ok, Object.t()} | nil
def get_obj_helper(id, options \\ []) do