commit: 3ae928f3fc3e34b918e15ae05e84bdee1b6c1a9f
parent ec77dd623c642a858c4e7229d4a6596003e64c4e
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Fri, 24 Mar 2023 09:09:41 +0100
Object.Fetcher: Hook to MRF.id_filter
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/lib/pleroma/object/fetcher.ex b/lib/pleroma/object/fetcher.ex
@@ -168,6 +168,7 @@ defmodule Pleroma.Object.Fetcher do
Logger.debug("Fetching object #{id} via AP")
with {:scheme, true} <- {:scheme, String.starts_with?(id, "http")},
+ {_, true} <- {:mrf, MRF.id_filter(id)},
{:ok, body} <- get_object(id),
{:ok, data} <- safe_json_decode(body),
:ok <- Containment.contain_origin_from_id(id, data) do
@@ -183,6 +184,9 @@ defmodule Pleroma.Object.Fetcher do
{:error, e} ->
{:error, e}
+ {:mrf, false} ->
+ {:error, {:reject, "Filtered by id"}}
+
e ->
{:error, e}
end