X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fpleroma%2Fweb%2Fnodeinfo%2Fnodeinfo_controller.ex;h=e4396da319c3ba3d1c938a6b0b164b5efe69302d;hb=7d8f4d0d5077bdd9182d726cb5473d1465aaeab9;hp=03c35cc2a25fa89a62f7cf74171583940e9c13e2;hpb=e84fee5b8624c8909ddd8a7e0d99c6beea4f54d0;p=akkoma
diff --git a/lib/pleroma/web/nodeinfo/nodeinfo_controller.ex b/lib/pleroma/web/nodeinfo/nodeinfo_controller.ex
index 03c35cc2a..e4396da31 100644
--- a/lib/pleroma/web/nodeinfo/nodeinfo_controller.ex
+++ b/lib/pleroma/web/nodeinfo/nodeinfo_controller.ex
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2019 Pleroma Authors
+# Copyright © 2017-2020 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.Nodeinfo.NodeinfoController do
@@ -33,12 +33,16 @@ defmodule Pleroma.Web.Nodeinfo.NodeinfoController do
# under software.
def raw_nodeinfo do
stats = Stats.get_stats()
-
- quarantined = Config.get([:instance, :quarantined_instances], [])
+ exclusions = Config.get([:instance, :mrf_transparency_exclusions], [])
+
+ quarantined =
+ Config.get([:instance, :quarantined_instances], [])
+ |> Enum.filter(fn x -> !Enum.member?(exclusions, x) end)
staff_accounts =
User.all_superusers()
|> Enum.map(fn u -> u.ap_id end)
+ |> Enum.filter(fn u -> not Enum.member?(Config.get([:instance, :staff_transparency]), u) end)
federation_response =
if Config.get([:instance, :mrf_transparency]) do
@@ -46,10 +50,10 @@ defmodule Pleroma.Web.Nodeinfo.NodeinfoController do
data
|> Map.merge(%{quarantined_instances: quarantined})
- |> Map.put(:enabled, Config.get([:instance, :federating]))
else
%{}
end
+ |> Map.put(:enabled, Config.get([:instance, :federating]))
features =
[
@@ -60,6 +64,7 @@ defmodule Pleroma.Web.Nodeinfo.NodeinfoController do
"pleroma_explicit_addressing",
"shareable_emoji_packs",
"multifetch",
+ "pleroma:api/v1/notifications:include_types_filter",
if Config.get([:media_proxy, :enabled]) do
"media_proxy"
end,
@@ -74,7 +79,8 @@ defmodule Pleroma.Web.Nodeinfo.NodeinfoController do
end,
if Config.get([:instance, :safe_dm_mentions]) do
"safe_dm_mentions"
- end
+ end,
+ "pleroma_emoji_reactions"
]
|> Enum.filter(& &1)
@@ -92,9 +98,9 @@ defmodule Pleroma.Web.Nodeinfo.NodeinfoController do
openRegistrations: Config.get([:instance, :registrations_open]),
usage: %{
users: %{
- total: stats.user_count || 0
+ total: Map.get(stats, :user_count, 0)
},
- localPosts: stats.status_count || 0
+ localPosts: Map.get(stats, :status_count, 0)
},
metadata: %{
nodeName: Config.get([:instance, :name]),