aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-05-18 13:28:50 +0200
committerlain <lain@soykaf.club>2020-05-18 13:29:30 +0200
commit188b32145e0a97411878a11bd4f8ad8bc9cc1d9a (patch)
treecab89045b034f2d817783cb444b9d12d027173ef
parent96f7b1b140979249cf28bc742b7749f1bee7ea9c (diff)
downloadpleroma-188b32145e0a97411878a11bd4f8ad8bc9cc1d9a.tar.gz
InstanceView: Expose background image link.
This will make it easier for more clients to support this feature.
-rw-r--r--config/config.exs1
-rw-r--r--lib/pleroma/web/mastodon_api/views/instance_view.ex1
-rw-r--r--test/web/mastodon_api/controllers/instance_controller_test.exs3
3 files changed, 4 insertions, 1 deletions
diff --git a/config/config.exs b/config/config.exs
index c51884f3a..6b4f3b38a 100644
--- a/config/config.exs
+++ b/config/config.exs
@@ -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,
diff --git a/lib/pleroma/web/mastodon_api/views/instance_view.ex b/lib/pleroma/web/mastodon_api/views/instance_view.ex
index a329ffc28..8088306c3 100644
--- a/lib/pleroma/web/mastodon_api/views/instance_view.ex
+++ b/lib/pleroma/web/mastodon_api/views/instance_view.ex
@@ -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(),
diff --git a/test/web/mastodon_api/controllers/instance_controller_test.exs b/test/web/mastodon_api/controllers/instance_controller_test.exs
index 2c61dc5ba..8bdfdddd1 100644
--- a/test/web/mastodon_api/controllers/instance_controller_test.exs
+++ b/test/web/mastodon_api/controllers/instance_controller_test.exs
@@ -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"]