From 8a0b755c19ef9c896f69de2b1bf22418a3aedf6f Mon Sep 17 00:00:00 2001 From: rinpatch Date: Fri, 8 Feb 2019 13:12:09 +0300 Subject: [PATCH] rename ftl_removal to federated_timeline_removal to keep consistent naming with SimplePolicy --- config/config.exs | 2 +- docs/config.md | 2 +- lib/pleroma/web/activity_pub/mrf/keyword_policy.ex | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/config.exs b/config/config.exs index 223ab0c52..33bb4b015 100644 --- a/config/config.exs +++ b/config/config.exs @@ -240,7 +240,7 @@ config :pleroma, :mrf_simple, config :pleroma, :mrf_keyword, reject: [], - ftl_removal: [], + federated_timeline_removal: [], replace: [] config :pleroma, :rich_media, enabled: true diff --git a/docs/config.md b/docs/config.md index 55d618925..c0eb4ceb4 100644 --- a/docs/config.md +++ b/docs/config.md @@ -153,7 +153,7 @@ This section is used to configure Pleroma-FE, unless ``:managed_config`` in ``:i ## :mrf_keyword * `reject`: A list of patterns which result in message being rejected, each pattern can be a string or a [regular expression](https://hexdocs.pm/elixir/Regex.html) -* `ftl_removal`: A list of patterns which result in message being removed from federated timelines(a.k.a unlisted), each pattern can be a string or a [regular expression](https://hexdocs.pm/elixir/Regex.html) +* `federated_timeline_removal`: A list of patterns which result in message being removed from federated timelines(a.k.a unlisted), each pattern can be a string or a [regular expression](https://hexdocs.pm/elixir/Regex.html) * `replace`: A list of tuples containing `{pattern, replacement`, `pattern` can be a string or a [regular expression](https://hexdocs.pm/elixir/Regex.html) ## :media_proxy diff --git a/lib/pleroma/web/activity_pub/mrf/keyword_policy.ex b/lib/pleroma/web/activity_pub/mrf/keyword_policy.ex index 6e2673e9c..073b86372 100644 --- a/lib/pleroma/web/activity_pub/mrf/keyword_policy.ex +++ b/lib/pleroma/web/activity_pub/mrf/keyword_policy.ex @@ -24,7 +24,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.KeywordPolicy do defp check_ftl_removal(%{"to" => to, "object" => %{"content" => content}} = message) do if "https://www.w3.org/ns/activitystreams#Public" in to and - Enum.any?(Pleroma.Config.get([:mrf_keyword, :ftl_removal]), fn pattern -> + Enum.any?(Pleroma.Config.get([:mrf_keyword, :federated_timeline_removal]), fn pattern -> string_matches?(content, pattern) end) do to = List.delete(to, "https://www.w3.org/ns/activitystreams#Public")