forked from AkkomaGang/akkoma
Do not refetch local objects
This commit is contained in:
parent
644bc1e64a
commit
40c7d6fa17
1 changed files with 3 additions and 1 deletions
|
@ -48,10 +48,12 @@ defp reinject_object(struct, data) do
|
||||||
end
|
end
|
||||||
|
|
||||||
def refetch_object(%Object{data: %{"id" => id}} = object) do
|
def refetch_object(%Object{data: %{"id" => id}} = object) do
|
||||||
with {:ok, data} <- fetch_and_contain_remote_object_from_id(id),
|
with {:local, false} <- {:local, String.starts_with?(id, Pleroma.Web.base_url() <> "/")},
|
||||||
|
{:ok, data} <- fetch_and_contain_remote_object_from_id(id),
|
||||||
{:ok, object} <- reinject_object(object, data) do
|
{:ok, object} <- reinject_object(object, data) do
|
||||||
{:ok, object}
|
{:ok, object}
|
||||||
else
|
else
|
||||||
|
{:local, true} -> object
|
||||||
e -> {:error, e}
|
e -> {:error, e}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue