Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F85629565
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
930 B
Referenced Files
None
Subscribers
None
View Options
diff --git a/lib/pleroma/web/activity_pub/mrf/hellthread_policy.ex b/lib/pleroma/web/activity_pub/mrf/hellthread_policy.ex
index d5aa2b988..55d6ff3f0 100644
--- a/lib/pleroma/web/activity_pub/mrf/hellthread_policy.ex
+++ b/lib/pleroma/web/activity_pub/mrf/hellthread_policy.ex
@@ -1,14 +1,18 @@
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}
else
{:ok, object}
end
end
+
+ @impl true
+ def filter(object), do: {:ok, object}
end
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sun, Aug 9, 12:15 AM (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1724070
Default Alt Text
(930 B)
Attached To
Mode
rPUBE pleroma-upstream
Attached
Detach File
Event Timeline
Log In to Comment