Commit 92362e1e authored by Karen Konou's avatar Karen Konou

Implement large thread filter

parent 61a88a67
......@@ -163,6 +163,8 @@ config :pleroma, :mrf_rejectnonpublic,
allow_followersonly: false,
allow_direct: false
config :pleroma, :mrf_hellthreadmitigation, threshold: 10
config :pleroma, :mrf_simple,
media_removal: [],
media_nsfw: [],
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}
{:ok, object}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment