@moduledoc "Block messages with too much mentions (configurable)"
@behaviour Pleroma.Web.ActivityPub.MRF
@moduledoc "Block messages with too much mentions (configurable)"
@behaviour Pleroma.Web.ActivityPub.MRF
when follower_collection? and recipients > threshold ->
message
|> Map.put("to", [follower_collection])
when follower_collection? and recipients > threshold ->
message
|> Map.put("to", [follower_collection])
recipients = (message["to"] || []) ++ (message["cc"] || [])
follower_collection = User.get_cached_by_ap_id(message["actor"]).follower_address
recipients = (message["to"] || []) ++ (message["cc"] || [])
follower_collection = User.get_cached_by_ap_id(message["actor"]).follower_address
|> List.delete(follower_collection)
{:public, length(recipients)}
|> List.delete(follower_collection)
{:public, length(recipients)}