X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fweb%2Fmastodon_api%2Fviews%2Finstance_view.ex;h=ef208062bdb121f12ecd77be6c5d5d38979d4587;hb=bd9c9136f9c25ed36b443f0a1985926e1420de7b;hp=f62b52a6433b5dd9984a4c2e0c26dcef6fb98d05;hpb=f4028c908c56736b88caa5edb71f5aad21244de1;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 f62b52a64..ef208062b 100644 --- a/lib/pleroma/web/mastodon_api/views/instance_view.ex +++ b/lib/pleroma/web/mastodon_api/views/instance_view.ex @@ -95,22 +95,19 @@ defmodule Pleroma.Web.MastodonAPI.InstanceView do {:ok, data} = MRF.describe() data - |> Map.merge(%{ - quarantined_instances: - quarantined - |> Enum.map(fn {instance, _reason} -> instance end) - }) + |> 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.merge(%{ - quarantined_instances_info: %{ - "quarantined_instances" => - quarantined - |> Enum.map(fn {instance, reason} -> {instance, %{"reason" => reason}} end) - |> Enum.into(%{}) - } + |> Map.put(:quarantined_instances_info, %{ + "quarantined_instances" => + quarantined + |> Enum.map(fn {instance, reason} -> {instance, %{"reason" => reason}} end) + |> Map.new() }) else %{}