X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fweb%2Fnodeinfo%2Fnodeinfo.ex;h=6a0112d2a2c1304874f8b54c2155dfd4a7c5a0b1;hb=37c37090fab4c6efa138f35f6e2ec7d77a50644b;hp=d26b7c938e23b967162322b12318db1e28134653;hpb=26f710b9e36d286ee34dd679fdaf99e39d8c0bf2;p=akkoma
diff --git a/lib/pleroma/web/nodeinfo/nodeinfo.ex b/lib/pleroma/web/nodeinfo/nodeinfo.ex
index d26b7c938..6a0112d2a 100644
--- a/lib/pleroma/web/nodeinfo/nodeinfo.ex
+++ b/lib/pleroma/web/nodeinfo/nodeinfo.ex
@@ -1,64 +1,25 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors
+# Copyright © 2017-2021 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.Nodeinfo.Nodeinfo do
alias Pleroma.Config
alias Pleroma.Stats
alias Pleroma.User
- alias Pleroma.Web.ActivityPub.MRF
alias Pleroma.Web.Federator.Publisher
+ alias Pleroma.Web.MastodonAPI.InstanceView
# returns a nodeinfo 2.0 map, since 2.1 just adds a repository field
# under software.
def get_nodeinfo("2.0") do
stats = Stats.get_stats()
- quarantined = Config.get([:instance, :quarantined_instances], [])
-
staff_accounts =
User.all_superusers()
|> Enum.map(fn u -> u.ap_id end)
- federation_response =
- if Config.get([:instance, :mrf_transparency]) do
- {:ok, data} = MRF.describe()
-
- data
- |> Map.merge(%{quarantined_instances: quarantined})
- else
- %{}
- end
- |> Map.put(:enabled, Config.get([:instance, :federating]))
-
- features =
- [
- "pleroma_api",
- "mastodon_api",
- "mastodon_api_streaming",
- "polls",
- "pleroma_explicit_addressing",
- "shareable_emoji_packs",
- "multifetch",
- "pleroma:api/v1/notifications:include_types_filter",
- if Config.get([:media_proxy, :enabled]) do
- "media_proxy"
- end,
- if Config.get([:gopher, :enabled]) do
- "gopher"
- end,
- if Config.get([:chat, :enabled]) do
- "chat"
- end,
- if Config.get([:instance, :allow_relay]) do
- "relay"
- end,
- if Config.get([:instance, :safe_dm_mentions]) do
- "safe_dm_mentions"
- end,
- "pleroma_emoji_reactions"
- ]
- |> Enum.filter(& &1)
+ federation = InstanceView.federation()
+ features = InstanceView.features()
%{
version: "2.0",
@@ -86,7 +47,7 @@ defmodule Pleroma.Web.Nodeinfo.Nodeinfo do
enabled: false
},
staffAccounts: staff_accounts,
- federation: federation_response,
+ federation: federation,
pollLimits: Config.get([:instance, :poll_limits]),
postFormats: Config.get([:instance, :allowed_post_formats]),
uploadLimits: %{