Add tests, change default config values, fix a bug

This commit is contained in:
Karen Konou 2019-02-15 12:47:50 +01:00
commit d943c90249
3 changed files with 59 additions and 7 deletions

View file

@ -47,14 +47,16 @@ defmodule Pleroma.Web.ActivityPub.MRF.HellthreadPolicy do
follower_collection = User.get_cached_by_ap_id(message["actor"]).follower_address
if Enum.member?(recipients, "https://www.w3.org/ns/activitystreams#Public") do
recipients
|> List.delete("https://www.w3.org/ns/activitystreams#Public")
|> List.delete(follower_collection)
recipients =
recipients
|> List.delete("https://www.w3.org/ns/activitystreams#Public")
|> List.delete(follower_collection)
{:public, length(recipients)}
else
recipients
|> List.delete(follower_collection)
recipients =
recipients
|> List.delete(follower_collection)
{:not_public, length(recipients)}
end