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