From: rinpatch Date: Wed, 18 Sep 2019 16:59:23 +0000 (+0300) Subject: Do not refetch local objects X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=40c7d6fa173b4c32e6cec9a85f67c050ce20bd25;p=akkoma Do not refetch local objects --- diff --git a/lib/pleroma/object/fetcher.ex b/lib/pleroma/object/fetcher.ex index fecc97c5e..91e6b6dca 100644 --- a/lib/pleroma/object/fetcher.ex +++ b/lib/pleroma/object/fetcher.ex @@ -48,10 +48,12 @@ defmodule Pleroma.Object.Fetcher do end 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} else + {:local, true} -> object e -> {:error, e} end end