InstanceView: Expose background image link.
authorlain <lain@soykaf.club>
Mon, 18 May 2020 11:28:50 +0000 (13:28 +0200)
committerlain <lain@soykaf.club>
Mon, 18 May 2020 11:29:30 +0000 (13:29 +0200)
This will make it easier for more clients to support this feature.

config/config.exs
lib/pleroma/web/mastodon_api/views/instance_view.ex
test/web/mastodon_api/controllers/instance_controller_test.exs

index c51884f3aa05efec46499789679635a46cd73f74..6b4f3b38ae12b7905f5512d02823bbdcb8155603 100644 (file)
@@ -183,6 +183,7 @@ config :pleroma, :instance,
   email: "example@example.com",
   notify_email: "noreply@example.com",
   description: "A Pleroma instance, an alternative fediverse server",
+  background_image: "/images/city.jpg",
   limit: 5_000,
   chat_limit: 5_000,
   remote_limit: 100_000,
index a329ffc28e94e263aefa946fbe0babcbbbcc699e..8088306c3bd0c01f6f4d0d4ae725f48067a448a8 100644 (file)
@@ -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(),
index 2c61dc5bae3af6cd527f35b4bcf6fa2aa67a962f..8bdfdddd18146dbda46c82f6ad6ed16f0f9d9c21 100644 (file)
@@ -31,7 +31,8 @@ defmodule Pleroma.Web.MastodonAPI.InstanceControllerTest do
              "upload_limit" => _,
              "avatar_upload_limit" => _,
              "background_upload_limit" => _,
-             "banner_upload_limit" => _
+             "banner_upload_limit" => _,
+             "background_image" => _
            } = result
 
     assert result["pleroma"]["metadata"]["features"]