Fix recipient count in hellthread policy
This commit is contained in:
parent
1ce1b7b58d
commit
8f98d970c1
|
@ -12,14 +12,14 @@ defp delist_message(message, threshold) when threshold > 0 do
|
||||||
follower_collection? = Enum.member?(message["to"] ++ message["cc"], follower_collection)
|
follower_collection? = Enum.member?(message["to"] ++ message["cc"], follower_collection)
|
||||||
|
|
||||||
message =
|
message =
|
||||||
case recipients = get_recipient_count(message) do
|
case get_recipient_count(message) do
|
||||||
{:public, _}
|
{:public, recipients}
|
||||||
when follower_collection? and recipients > threshold ->
|
when follower_collection? and recipients > threshold ->
|
||||||
message
|
message
|
||||||
|> Map.put("to", [follower_collection])
|
|> Map.put("to", [follower_collection])
|
||||||
|> Map.put("cc", ["https://www.w3.org/ns/activitystreams#Public"])
|
|> Map.put("cc", ["https://www.w3.org/ns/activitystreams#Public"])
|
||||||
|
|
||||||
{:public, _} when recipients > threshold ->
|
{:public, recipients} when recipients > threshold ->
|
||||||
message
|
message
|
||||||
|> Map.put("to", [])
|
|> Map.put("to", [])
|
||||||
|> Map.put("cc", ["https://www.w3.org/ns/activitystreams#Public"])
|
|> Map.put("cc", ["https://www.w3.org/ns/activitystreams#Public"])
|
||||||
|
|
Loading…
Reference in New Issue