aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/mastodon_api
diff options
context:
space:
mode:
authorIlja <domainepublic@spectraltheorem.be>2020-11-28 10:34:31 +0100
committerHaelwenn (lanodan) Monnier <contact@hacktivis.me>2021-08-06 07:59:53 +0200
commit03030b47c22f4a193e7ddc582574d4a521854025 (patch)
tree1c41ea2bf9a15b07a1a07d7c55085fdb19ed928e /lib/pleroma/web/mastodon_api
parent47fc57bbccbe5df32ef00dda0ee8bdd56b38885f (diff)
downloadpleroma-03030b47c22f4a193e7ddc582574d4a521854025.tar.gz
quarantine instances info
Added a new field in the nodeinfo called quarantined_instances_info This holds an object like `"quarantined_instances_info":{"quarantined_instances":{"quar.inst":{"reason":"whatever reason"}}}}`
Diffstat (limited to 'lib/pleroma/web/mastodon_api')
-rw-r--r--lib/pleroma/web/mastodon_api/views/instance_view.ex10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/pleroma/web/mastodon_api/views/instance_view.ex b/lib/pleroma/web/mastodon_api/views/instance_view.ex
index db40ea3fa..a341ca6f4 100644
--- a/lib/pleroma/web/mastodon_api/views/instance_view.ex
+++ b/lib/pleroma/web/mastodon_api/views/instance_view.ex
@@ -98,7 +98,15 @@ defmodule Pleroma.Web.MastodonAPI.InstanceView do
|> Map.merge(%{
quarantined_instances:
quarantined
- |> Enum.map(fn {instance, reason} -> %{"instance" => instance, "reason" => reason} end)
+ |> Enum.map(fn {instance, _reason} -> instance end)
+ })
+ |> Map.merge(%{
+ quarantined_instances_info: %{
+ "quarantined_instances" =>
+ quarantined
+ |> Enum.map(fn {instance, reason} -> {instance, %{"reason" => reason}} end)
+ |> Enum.into(%{})
+ }
})
else
%{}