Nodeinfo: remove null features; relay feature.
authorhref <href@random.sh>
Fri, 7 Dec 2018 18:44:45 +0000 (19:44 +0100)
committerhref <href@random.sh>
Fri, 7 Dec 2018 18:44:45 +0000 (19:44 +0100)
lib/pleroma/web/nodeinfo/nodeinfo_controller.ex

index 2ea75cf16bfbb11bccd396bcd8833d64900ddfb6..277dc6ba1bc6fed75af858f88c0d302e88fc0a79 100644 (file)
@@ -71,23 +71,28 @@ defmodule Pleroma.Web.Nodeinfo.NodeinfoController do
         %{}
       end
 
-    features = [
-      "pleroma_api",
-      "mastodon_api",
-      "mastodon_api_streaming",
-      if Keyword.get(media_proxy, :enabled) do
-        "media_proxy"
-      end,
-      if Keyword.get(gopher, :enabled) do
-        "gopher"
-      end,
-      if Keyword.get(chat, :enabled) do
-        "chat"
-      end,
-      if Keyword.get(suggestions, :enabled) do
-        "suggestions"
-      end
-    ]
+    features =
+      [
+        "pleroma_api",
+        "mastodon_api",
+        "mastodon_api_streaming",
+        if Keyword.get(media_proxy, :enabled) do
+          "media_proxy"
+        end,
+        if Keyword.get(gopher, :enabled) do
+          "gopher"
+        end,
+        if Keyword.get(chat, :enabled) do
+          "chat"
+        end,
+        if Keyword.get(suggestions, :enabled) do
+          "suggestions"
+        end,
+        if Keyword.get(instance, :allow_relay) do
+          "relay"
+        end
+      ]
+      |> Enum.filter(& &1)
 
     response = %{
       version: "2.0",