diff options
author | lambda <pleromagit@rogerbraun.net> | 2019-02-17 16:57:57 +0000 |
---|---|---|
committer | lambda <pleromagit@rogerbraun.net> | 2019-02-17 16:57:57 +0000 |
commit | ae84af4ad0de85e0d586f3db733e924f55877c14 (patch) | |
tree | eb3e5fc884513c590208bd7f3557d563e67f86f7 /lib | |
parent | 3b141194715e362d65482672d00b10991d102fa2 (diff) | |
parent | d0a94f98e030dd700c56e8cc4576fb45cf449f53 (diff) | |
download | pleroma-ae84af4ad0de85e0d586f3db733e924f55877c14.tar.gz |
Merge branch 'fix/hellthread-policy-recipient-check' into 'develop'
Fix recipient count in hellthread policy
See merge request pleroma/pleroma!836
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/activity_pub/mrf/hellthread_policy.ex | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/pleroma/web/activity_pub/mrf/hellthread_policy.ex b/lib/pleroma/web/activity_pub/mrf/hellthread_policy.ex index 8ab1dd4e5..6736f3cb9 100644 --- a/lib/pleroma/web/activity_pub/mrf/hellthread_policy.ex +++ b/lib/pleroma/web/activity_pub/mrf/hellthread_policy.ex @@ -12,14 +12,14 @@ defmodule Pleroma.Web.ActivityPub.MRF.HellthreadPolicy do follower_collection? = Enum.member?(message["to"] ++ message["cc"], follower_collection) message = - case recipients = get_recipient_count(message) do - {:public, _} + case get_recipient_count(message) do + {:public, recipients} when follower_collection? and recipients > threshold -> message |> Map.put("to", [follower_collection]) |> Map.put("cc", ["https://www.w3.org/ns/activitystreams#Public"]) - {:public, _} when recipients > threshold -> + {:public, recipients} when recipients > threshold -> message |> Map.put("to", []) |> Map.put("cc", ["https://www.w3.org/ns/activitystreams#Public"]) |