MRF.SimplePolicy: Add id_filter/1

This commit is contained in:
Haelwenn (lanodan) Monnier 2023-03-24 09:16:25 +01:00
commit 0fa13c5535
No known key found for this signature in database
2 changed files with 27 additions and 0 deletions

View file

@ -191,6 +191,18 @@ defmodule Pleroma.Web.ActivityPub.MRF.SimplePolicy do
|> MRF.instance_list_from_tuples()
end
@impl true
def id_filter(id) do
host_info = URI.parse(id)
with {:ok, _} <- check_accept(host_info, %{}),
{:ok, _} <- check_reject(host_info, %{}) do
true
else
_ -> false
end
end
@impl true
def filter(%{"type" => "Delete", "actor" => actor} = activity) do
%{host: actor_host} = URI.parse(actor)