diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/activity_pub/mrf/hellthread_policy.ex | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/pleroma/web/activity_pub/mrf/hellthread_policy.ex b/lib/pleroma/web/activity_pub/mrf/hellthread_policy.ex new file mode 100644 index 000000000..0e0918126 --- /dev/null +++ b/lib/pleroma/web/activity_pub/mrf/hellthread_policy.ex @@ -0,0 +1,15 @@ +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
\ No newline at end of file |