mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-11 02:28:45 +00:00
19 lines
453 B
Elixir
19 lines
453 B
Elixir
defmodule Pleroma.Web.ActivityPub.MRF.HellthreadPolicy do
|
|
@behaviour Pleroma.Web.ActivityPub.MRF
|
|
|
|
@impl true
|
|
def filter(%{"type" => "Create"} = object) do
|
|
threshold = Pleroma.Config.get([:mrf_hellthread, :threshold])
|
|
recipients = (object["to"] || []) ++ (object["cc"] || [])
|
|
|
|
if length(recipients) > threshold do
|
|
{:reject, nil}
|
|
else
|
|
{:ok, object}
|
|
end
|
|
end
|
|
|
|
@impl true
|
|
def filter(object), do: {:ok, object}
|
|
end
|