X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fweb%2Fmastodon_api%2Fviews%2Finstance_view.ex;h=ef208062bdb121f12ecd77be6c5d5d38979d4587;hb=cfb8aa7e59d1f0b89885aebd9c8e299d584119b7;hp=a341ca6f4a4f11eb1a860ff685f22e311664903e;hpb=03030b47c22f4a193e7ddc582574d4a521854025;p=akkoma diff --git a/lib/pleroma/web/mastodon_api/views/instance_view.ex b/lib/pleroma/web/mastodon_api/views/instance_view.ex index a341ca6f4..ef208062b 100644 --- a/lib/pleroma/web/mastodon_api/views/instance_view.ex +++ b/lib/pleroma/web/mastodon_api/views/instance_view.ex @@ -95,18 +95,19 @@ defmodule Pleroma.Web.MastodonAPI.InstanceView do {:ok, data} = MRF.describe() data - |> Map.merge(%{ - quarantined_instances: + |> Map.put( + :quarantined_instances, + Enum.map(quarantined, fn {instance, _reason} -> instance end) + ) + # This is for backwards compatibility. We originally didn't sent + # extra info like a reason why an instance was rejected/quarantined/etc. + # Because we didn't want to break backwards compatibility it was decided + # to add an extra "info" key. + |> Map.put(:quarantined_instances_info, %{ + "quarantined_instances" => quarantined - |> 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(%{}) - } + |> Enum.map(fn {instance, reason} -> {instance, %{"reason" => reason}} end) + |> Map.new() }) else %{}