Various changes needed for AP refactor
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -55,6 +55,10 @@ defmodule Mobilizon.Federation.ActivityPub.Actor do
|
||||
{:error, "Can't make a local actor from URL"}
|
||||
else
|
||||
case Fetcher.fetch_and_prepare_actor_from_url(url) do
|
||||
# Just in case
|
||||
{:ok, {:error, _e}} ->
|
||||
raise ArgumentError, message: "Failed to make actor from url #{url}"
|
||||
|
||||
{:ok, data} ->
|
||||
Actors.upsert_actor(data, preload)
|
||||
|
||||
@@ -67,7 +71,7 @@ defmodule Mobilizon.Federation.ActivityPub.Actor do
|
||||
{:error, :http_error}
|
||||
|
||||
{:error, e} ->
|
||||
Logger.warn("Failed to make actor from url")
|
||||
Logger.warn("Failed to make actor from url #{url}")
|
||||
{:error, e}
|
||||
end
|
||||
end
|
||||
|
||||
@@ -476,6 +476,7 @@ defmodule Mobilizon.Federation.ActivityPub.Utils do
|
||||
"type" => "Update",
|
||||
"to" => object["to"],
|
||||
"cc" => object["cc"],
|
||||
"attributedTo" => object["attributedTo"] || object["actor"],
|
||||
"actor" => object["actor"],
|
||||
"object" => object,
|
||||
"id" => object["id"] <> "/activity"
|
||||
|
||||
Reference in New Issue
Block a user