logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git
commit: 3dd6f6585985a085c1c2f2243501323864dcac2d
parent 03e14e759db47633cce320285d93d8c1f3bde65c
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Fri, 24 Mar 2023 09:09:41 +0100

Object.Fetcher: Hook to MRF.id_filter

Diffstat:

Mlib/pleroma/object/fetcher.ex4++++
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/lib/pleroma/object/fetcher.ex b/lib/pleroma/object/fetcher.ex @@ -145,6 +145,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 @@ -160,6 +161,9 @@ defmodule Pleroma.Object.Fetcher do {:error, e} -> {:error, e} + {:mrf, false} -> + {:error, {:reject, "Filtered by id"}} + e -> {:error, e} end