made toggleable, added docs

This commit is contained in:
Karen Konou 2019-02-03 20:27:28 +01:00
parent 0ef0ae35ab
commit 10130fa7d6
2 changed files with 4 additions and 3 deletions
docs
lib/pleroma/web/activity_pub/mrf

View file

@ -148,7 +148,8 @@ This section is used to configure Pleroma-FE, unless ``:managed_config`` in ``:i
* `allow_direct`: whether to allow direct messages * `allow_direct`: whether to allow direct messages
## :mrf_hellthread ## :mrf_hellthread
* `threshold`: Number of mentioned users after which the message gets discarded as spam * `delist_threshold`: Number of mentioned users after which the message gets delisted. Set to 0 to disable.
* `reject_threshold`: Number of mentioned users after which the messaged gets rejected. Set to 0 to disable.
## :media_proxy ## :media_proxy
* `enabled`: Enables proxying of remote media to the instances proxy * `enabled`: Enables proxying of remote media to the instances proxy

View file

@ -13,10 +13,10 @@ def filter(%{"type" => "Create"} = object) do
recipients = (object["to"] || []) ++ (object["cc"] || []) recipients = (object["to"] || []) ++ (object["cc"] || [])
cond do cond do
length(recipients) > reject_threshold -> length(recipients) > reject_threshold and reject_threshold != 0 ->
{:reject, nil} {:reject, nil}
length(recipients) > delist_threshold -> length(recipients) > delist_threshold and delist_threshold != 0 ->
if Enum.member?(object["to"], "https://www.w3.org/ns/activitystreams#Public") or if Enum.member?(object["to"], "https://www.w3.org/ns/activitystreams#Public") or
Enum.member?(object["cc"], "https://www.w3.org/ns/activitystreams#Public") do Enum.member?(object["cc"], "https://www.w3.org/ns/activitystreams#Public") do
object object