Change path from nodeinfo to metadata->features
authorEkaterina Vaartis <vaartis@cock.li>
Wed, 18 Sep 2019 15:09:57 +0000 (18:09 +0300)
committerEkaterina Vaartis <vaartis@cock.li>
Wed, 18 Sep 2019 21:16:34 +0000 (00:16 +0300)
lib/pleroma/web/pleroma_api/emoji_api_controller.ex
test/web/emoji_api_controller_test.exs

index bc163909587d4b0720a4e8fbecec0588131cd8b4..391c317e7197c302574c35d5a6dfdd34ebcf8b6d 100644 (file)
@@ -152,7 +152,7 @@ keeping it in cache for #{div(cache_ms, 1000)}s")
       |> Tesla.get!()
       |> Map.get(:body)
       |> Jason.decode!()
-      |> Map.get("features")
+      |> get_in(["metadata", "features"])
       |> Enum.member?("shareable_emoji_packs")
 
     if shareable_packs_available do
index 1af4d3720e88f40565a3cd7fbfb99c5a8ce667b2..297dc092f2930315e660bc70b0bd394d9513d142 100644 (file)
@@ -55,10 +55,10 @@ defmodule Pleroma.Web.PleromaAPI.EmojiAPIControllerTest do
 
     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,