aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorkaniini <ariadne@dereferenced.org>2019-07-13 19:06:54 +0000
committerkaniini <ariadne@dereferenced.org>2019-07-13 19:06:54 +0000
commit592411e4fe8a1cf39064e3dd5f9312ed5cdcd22e (patch)
tree0367556f3e87497fe7cff80f70a519cd9e0e6e86 /lib
parentf4c001062e51c207bf84f56473ddf6120e3b50fb (diff)
parent0cc638b96874312bce29e477a0ce6e46a92142bf (diff)
downloadpleroma-592411e4fe8a1cf39064e3dd5f9312ed5cdcd22e.tar.gz
Merge branch 'feature/mrf-transparency-filter' into 'develop'
nodeinfo: implement MRF transparency exclusions See merge request pleroma/pleroma!1412
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/nodeinfo/nodeinfo_controller.ex6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/pleroma/web/nodeinfo/nodeinfo_controller.ex b/lib/pleroma/web/nodeinfo/nodeinfo_controller.ex
index cd9a4f4a8..a1d7fcc7d 100644
--- a/lib/pleroma/web/nodeinfo/nodeinfo_controller.ex
+++ b/lib/pleroma/web/nodeinfo/nodeinfo_controller.ex
@@ -34,8 +34,11 @@ defmodule Pleroma.Web.Nodeinfo.NodeinfoController do
def raw_nodeinfo do
stats = Stats.get_stats()
+ exclusions = Config.get([:instance, :mrf_transparency_exclusions])
+
mrf_simple =
Config.get(:mrf_simple)
+ |> Enum.map(fn {k, v} -> {k, Enum.reject(v, fn v -> v in exclusions end)} end)
|> Enum.into(%{})
# This horror is needed to convert regex sigils to strings
@@ -86,7 +89,8 @@ defmodule Pleroma.Web.Nodeinfo.NodeinfoController do
mrf_simple: mrf_simple,
mrf_keyword: mrf_keyword,
mrf_user_allowlist: mrf_user_allowlist,
- quarantined_instances: quarantined
+ quarantined_instances: quarantined,
+ exclusions: length(exclusions) > 0
}
else
%{}