Merge branch 'features/users-raw_bio' into 'develop'
[akkoma] / lib / pleroma / web / mastodon_api / views / instance_view.ex
index a329ffc28e94e263aefa946fbe0babcbbbcc699e..c498fe6326084e5302502a277fc29c145ba00d73 100644 (file)
@@ -23,7 +23,7 @@ defmodule Pleroma.Web.MastodonAPI.InstanceView do
         streaming_api: Pleroma.Web.Endpoint.websocket_url()
       },
       stats: Pleroma.Stats.get_stats(),
-      thumbnail: Pleroma.Web.base_url() <> "/instance/thumbnail.jpeg",
+      thumbnail: instance_thumbnail(),
       languages: ["en"],
       registrations: Keyword.get(instance, :registrations_open),
       # Extra (not present in Mastodon):
@@ -33,6 +33,7 @@ defmodule Pleroma.Web.MastodonAPI.InstanceView do
       avatar_upload_limit: Keyword.get(instance, :avatar_upload_limit),
       background_upload_limit: Keyword.get(instance, :background_upload_limit),
       banner_upload_limit: Keyword.get(instance, :banner_upload_limit),
+      background_image: Keyword.get(instance, :background_image),
       pleroma: %{
         metadata: %{
           features: features(),
@@ -68,7 +69,8 @@ defmodule Pleroma.Web.MastodonAPI.InstanceView do
       if Config.get([:instance, :safe_dm_mentions]) do
         "safe_dm_mentions"
       end,
-      "pleroma_emoji_reactions"
+      "pleroma_emoji_reactions",
+      "pleroma_chat_messages"
     ]
     |> Enum.filter(& &1)
   end
@@ -86,4 +88,9 @@ defmodule Pleroma.Web.MastodonAPI.InstanceView do
     end
     |> Map.put(:enabled, Config.get([:instance, :federating]))
   end
+
+  defp instance_thumbnail do
+    Pleroma.Config.get([:instance, :instance_thumbnail]) ||
+      "#{Pleroma.Web.base_url()}/instance/thumbnail.jpeg"
+  end
 end