Skip to content
Snippets Groups Projects
Commit 8f98d970 authored by rinpatch's avatar rinpatch
Browse files

Fix recipient count in hellthread policy

parent 1ce1b7b5
No related branches found
No related tags found
No related merge requests found
......@@ -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"])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment