+ mrf_user_allowlist =
+ Config.get([:mrf_user_allowlist], [])
+ |> Enum.into(%{}, fn {k, v} -> {k, length(v)} end)
+
+ mrf_transparency = Keyword.get(instance, :mrf_transparency)
+
+ federation_response =
+ if mrf_transparency do
+ %{
+ mrf_policies: mrf_policies,
+ mrf_simple: mrf_simple,
+ mrf_user_allowlist: mrf_user_allowlist,
+ quarantined_instances: quarantined
+ }
+ else
+ %{}
+ end
+
+ features =
+ [
+ "pleroma_api",
+ "mastodon_api",
+ "mastodon_api_streaming",
+ if Keyword.get(media_proxy, :enabled) do
+ "media_proxy"
+ end,
+ if Keyword.get(gopher, :enabled) do
+ "gopher"
+ end,
+ if Keyword.get(chat, :enabled) do
+ "chat"
+ end,
+ if Keyword.get(suggestions, :enabled) do
+ "suggestions"
+ end,
+ if Keyword.get(instance, :allow_relay) do
+ "relay"
+ end
+ ]
+ |> Enum.filter(& &1)
+
+ %{