Commit a7f07bb6 authored by Karen Konou's avatar Karen Konou
Browse files

Implement kaniini's tweaks

parent c7617941
Pipeline #5644 passed with stages
in 3 minutes and 22 seconds
......@@ -2,13 +2,17 @@ defmodule Pleroma.Web.ActivityPub.MRF.HellthreadPolicy do
@behaviour Pleroma.Web.ActivityPub.MRF
@impl true
def filter(object) do
policy = Pleroma.Config.get(:mrf_hellthread)
def filter(%{"type" => "Create"} = object) do
threshold = Pleroma.Config.get([:mrf_hellthread, :threshold])
recipients = (object["to"] || []) ++ (object["cc"] || [])
if length(object["to"]) + length(object["cc"]) > Keyword.get(policy, :threshold) do
if length(recipients) > threshold do
{:reject, nil}
{:ok, object}
@impl true
def filter(object), do: {:ok, object}
Supports Markdown
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