Commit d66cf4b2 authored by kaniini's avatar kaniini

Merge branch 'fix/mrf-simple' into 'develop'

mrf: simple policy: fix matching imported activitypub and ostatus statuses

Closes #915

See merge request pleroma/pleroma!1205
parents 9f44fa06 79503ce9
Pipeline #12371 passed with stages
in 8 minutes and 35 seconds
......@@ -113,6 +113,7 @@ The format is based on [Keep a Changelog](
- Mastodon API: Exposing default scope of the user to anyone
- Mastodon API: Make `irreversible` field default to `false` [`POST /api/v1/filters`]
- User-Agent is now sent correctly for all HTTP requests.
- MRF: Simple policy now properly delists imported or relayed statuses
## Removed
- Configuration: `config :pleroma, :fe` in favor of the more flexible `config :pleroma, :frontend_configurations`
......@@ -74,8 +74,7 @@ defp check_ftl_removal(%{host: actor_host} = _actor_info, object) do
user <- User.get_cached_by_ap_id(object["actor"]),
true <- "" in object["to"],
true <- user.follower_address in object["cc"] do
true <- "" in object["to"] do
to =
List.delete(object["to"], "") ++
......@@ -145,6 +145,24 @@ test "has a matching host" do
assert SimplePolicy.filter(local_message) == {:ok, local_message}
test "has a matching host but only as:Public in to" do
{_actor, ftl_message} = build_ftl_actor_and_message()
ftl_message_actor_host =
|> Map.fetch!("actor")
|> URI.parse()
|> Map.fetch!(:host)
ftl_message = Map.put(ftl_message, "cc", [])
Config.put([:mrf_simple, :federated_timeline_removal], [ftl_message_actor_host])
assert {:ok, ftl_message} = SimplePolicy.filter(ftl_message)
refute "" in ftl_message["to"]
assert "" in ftl_message["cc"]
defp build_ftl_actor_and_message do
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment