From a1325d5fd9b540017cbffbb73db85ee9fa9f12d0 Mon Sep 17 00:00:00 2001 From: Ekaterina Vaartis Date: Wed, 18 Sep 2019 18:09:57 +0300 Subject: [PATCH] Change path from nodeinfo to metadata->features --- lib/pleroma/web/pleroma_api/emoji_api_controller.ex | 2 +- test/web/emoji_api_controller_test.exs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/pleroma/web/pleroma_api/emoji_api_controller.ex b/lib/pleroma/web/pleroma_api/emoji_api_controller.ex index bc1639095..391c317e7 100644 --- a/lib/pleroma/web/pleroma_api/emoji_api_controller.ex +++ b/lib/pleroma/web/pleroma_api/emoji_api_controller.ex @@ -152,7 +152,7 @@ def download_from(conn, %{"instance_address" => address, "pack_name" => name} = |> Tesla.get!() |> Map.get(:body) |> Jason.decode!() - |> Map.get("features") + |> get_in(["metadata", "features"]) |> Enum.member?("shareable_emoji_packs") if shareable_packs_available do diff --git a/test/web/emoji_api_controller_test.exs b/test/web/emoji_api_controller_test.exs index 1af4d3720..297dc092f 100644 --- a/test/web/emoji_api_controller_test.exs +++ b/test/web/emoji_api_controller_test.exs @@ -55,10 +55,10 @@ test "downloading shared & unshared packs from another instance via download_fro mock(fn %{method: :get, url: "https://old-instance/nodeinfo/2.1.json"} -> - json(%{features: []}) + json(%{metadata: %{features: []}}) %{method: :get, url: "https://example.com/nodeinfo/2.1.json"} -> - json(%{features: ["shareable_emoji_packs"]}) + json(%{metadata: %{features: ["shareable_emoji_packs"]}}) %{ method: :get,