Merge branch 'develop' into 'develop'
[akkoma] / lib / pleroma / web / nodeinfo / nodeinfo_controller.ex
index 2ea75cf16bfbb11bccd396bcd8833d64900ddfb6..44c11f40a35efaec656778044a7b70c5762e1737 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",
@@ -127,6 +132,7 @@ defmodule Pleroma.Web.Nodeinfo.NodeinfoController do
           banner: Keyword.get(instance, :banner_upload_limit),
           background: Keyword.get(instance, :background_upload_limit)
         },
+        invitesEnabled: Keyword.get(instance, :invites_enabled, false),
         features: features
       }
     }