federated_timeline_removal: [],
report_removal: [],
reject: [],
- silence: [],
+ followers_only: [],
accept: [],
avatar_removal: [],
banner_removal: [],
end
end
- describe "when :silence" do
+ describe "when :followers_only" do
test "is empty" do
- Config.put([:mrf_simple, :silence], [])
+ Config.put([:mrf_simple, :followers_only], [])
{_, ftl_message} = build_ftl_actor_and_message()
local_message = build_local_message()
"cc" => [actor.follower_address, "http://foo.bar/qux"]
}
+ dm_activity = %{
+ "actor" => actor.ap_id,
+ "to" => [
+ following_user.ap_id,
+ non_following_user.ap_id
+ ],
+ "cc" => []
+ }
+
actor_domain =
activity
|> Map.fetch!("actor")
|> URI.parse()
|> Map.fetch!(:host)
- Config.put([:mrf_simple, :silence], [actor_domain])
+ Config.put([:mrf_simple, :followers_only], [actor_domain])
assert {:ok, new_activity} = SimplePolicy.filter(activity)
- assert actor.follower_address in new_activity["to"]
+ assert actor.follower_address in new_activity["cc"]
assert following_user.ap_id in new_activity["to"]
refute "https://www.w3.org/ns/activitystreams#Public" in new_activity["to"]
refute "https://www.w3.org/ns/activitystreams#Public" in new_activity["cc"]
refute non_following_user.ap_id in new_activity["to"]
refute non_following_user.ap_id in new_activity["cc"]
+
+ assert {:ok, new_dm_activity} = SimplePolicy.filter(dm_activity)
+ assert new_dm_activity["to"] == [following_user.ap_id]
+ assert new_dm_activity["cc"] == []
end
end