aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfeld <feld@feld.me>2019-10-01 22:16:29 +0000
committerfeld <feld@feld.me>2019-10-01 22:16:29 +0000
commit1255ec888d5f1a186b499bf9e5c23c8c7332ed4d (patch)
treecbea2b187683a04471674541d158db58b38c08f5
parentee6da62cdb057ce7e18c4b22346a183cde63502c (diff)
downloadpleroma-1255ec888d5f1a186b499bf9e5c23c8c7332ed4d.tar.gz
Revert "Add upload limits to /api/v1/instance"
This reverts commit db27c0dd8b18763ff2abb124ee8d641a4580cdaa.
-rw-r--r--CHANGELOG.md1
-rw-r--r--lib/pleroma/web/mastodon_api/controllers/mastodon_api_controller.ex6
-rw-r--r--test/web/mastodon_api/mastodon_api_controller_test.exs6
3 files changed, 11 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f61efcc22..a71a9dae6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Mastodon API: Account entities now include `follow_requests_count` (planned Mastodon 3.x addition)
- Pleroma API: `GET /api/v1/pleroma/accounts/:id/scrobbles` to get a list of recently scrobbled items
- Pleroma API: `POST /api/v1/pleroma/scrobble` to scrobble a media item
+- Mastodon API: Add `upload_limit`, `avatar_upload_limit`, `background_upload_limit`, and `banner_upload_limit` to `/api/v1/instance`
### Changed
- **Breaking:** Elixir >=1.8 is now required (was >= 1.7)
diff --git a/lib/pleroma/web/mastodon_api/controllers/mastodon_api_controller.ex b/lib/pleroma/web/mastodon_api/controllers/mastodon_api_controller.ex
index 80a7b5bef..33988bbbd 100644
--- a/lib/pleroma/web/mastodon_api/controllers/mastodon_api_controller.ex
+++ b/lib/pleroma/web/mastodon_api/controllers/mastodon_api_controller.ex
@@ -51,7 +51,11 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
registrations: Pleroma.Config.get([:instance, :registrations_open]),
# Extra (not present in Mastodon):
max_toot_chars: Keyword.get(instance, :limit),
- poll_limits: Keyword.get(instance, :poll_limits)
+ poll_limits: Keyword.get(instance, :poll_limits),
+ upload_limit: Keyword.get(instance, :upload_limit),
+ 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)
}
json(conn, response)
diff --git a/test/web/mastodon_api/mastodon_api_controller_test.exs b/test/web/mastodon_api/mastodon_api_controller_test.exs
index 68fe751e7..ae67ee89d 100644
--- a/test/web/mastodon_api/mastodon_api_controller_test.exs
+++ b/test/web/mastodon_api/mastodon_api_controller_test.exs
@@ -135,7 +135,11 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do
"thumbnail" => _,
"languages" => _,
"registrations" => _,
- "poll_limits" => _
+ "poll_limits" => _,
+ "upload_limit" => _,
+ "avatar_upload_limit" => _,
+ "background_upload_limit" => _,
+ "banner_upload_limit" => _
} = result
assert email == from_config_email