You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
akkoma-cachapa/lib/pleroma/web/activity_pub/mrf/hellthread_policy.ex

15 lines
343 B

defmodule Pleroma.Web.ActivityPub.MRF.HellthreadPolicy do
@behaviour Pleroma.Web.ActivityPub.MRF
@impl true
def filter(object) do
policy = Pleroma.Config.get(:mrf_hellthread)
6 years ago
if length(object["to"]) + length(object["cc"]) > Keyword.get(policy, :threshold) do
{:reject, nil}
else
{:ok, object}
end
end
6 years ago
end