summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaelwenn <contact+git.pleroma.social@hacktivis.me>2020-05-20 10:53:54 +0000
committerHaelwenn <contact+git.pleroma.social@hacktivis.me>2020-05-20 10:53:54 +0000
commit94ba5a780212920a1d4b303c3523f66ca0147a67 (patch)
treea64b6c0dc26b6c5bd5ba388dd0bf5edbeacddbd3
parent6dd1575c64ccc2ffe82155f70935b2aa58d22684 (diff)
parent2a74565090ebd7107e1419b4a56f6c6aa4a06ea1 (diff)
Merge branch 'exposed-background-image' into 'develop'
InstanceView: Expose background image link. See merge request pleroma/pleroma!2545
-rw-r--r--CHANGELOG.md1
-rw-r--r--config/config.exs1
-rw-r--r--docs/API/differences_in_mastoapi_responses.md1
-rw-r--r--lib/pleroma/web/api_spec/operations/instance_operation.ex1
-rw-r--r--lib/pleroma/web/mastodon_api/views/instance_view.ex1
-rw-r--r--test/web/mastodon_api/controllers/instance_controller_test.exs3
6 files changed, 7 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index feda41320..66b160a94 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- **Breaking:** removed `with_move` parameter from notifications timeline.
### Added
+- Instance: Add `background_image` to configuration and `/api/v1/instance`
- Instance: Extend `/api/v1/instance` with Pleroma-specific information.
- NodeInfo: `pleroma:api/v1/notifications:include_types_filter` to the `features` list.
- NodeInfo: `pleroma_emoji_reactions` to the `features` list.
diff --git a/config/config.exs b/config/config.exs
index 8833b3e27..248cf2455 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/docs/API/differences_in_mastoapi_responses.md b/docs/API/differences_in_mastoapi_responses.md
index 6d37d9008..e65fd5da4 100644
--- a/docs/API/differences_in_mastoapi_responses.md
+++ b/docs/API/differences_in_mastoapi_responses.md
@@ -216,6 +216,7 @@ Has theses additional parameters (which are the same as in Pleroma-API):
- `avatar_upload_limit`: The same for avatars
- `background_upload_limit`: The same for backgrounds
- `banner_upload_limit`: The same for banners
+- `background_image`: A background image that frontends can use
- `pleroma.metadata.features`: A list of supported features
- `pleroma.metadata.federation`: The federation restrictions of this instance
- `vapid_public_key`: The public key needed for push messages
diff --git a/lib/pleroma/web/api_spec/operations/instance_operation.ex b/lib/pleroma/web/api_spec/operations/instance_operation.ex
index 880bd3f1b..9d189d029 100644
--- a/lib/pleroma/web/api_spec/operations/instance_operation.ex
+++ b/lib/pleroma/web/api_spec/operations/instance_operation.ex
@@ -130,6 +130,7 @@ defmodule Pleroma.Web.ApiSpec.InstanceOperation do
example: %{
"avatar_upload_limit" => 2_000_000,
"background_upload_limit" => 4_000_000,
+ "background_image" => "/static/image.png",
"banner_upload_limit" => 4_000_000,
"description" => "A Pleroma instance, an alternative fediverse server",
"email" => "lain@lain.com",
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"]