summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKaren Konou <konoukaren@gmail.com>2018-12-22 23:18:31 +0100
committerKaren Konou <konoukaren@gmail.com>2018-12-22 23:18:31 +0100
commit92362e1e22a3debfaf3275822519417ee8755a7a (patch)
tree32424228c25a0b5c9c78c5c405627db3d9f5b65a /lib
parent61a88a6757bc557a370888d288f93681cff9668b (diff)
downloadpleroma-92362e1e22a3debfaf3275822519417ee8755a7a.tar.gz
pleroma-92362e1e22a3debfaf3275822519417ee8755a7a.zip
Implement large thread filter
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/activity_pub/mrf/hellthread_policy.ex15
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