Merge branch 'feature/expose-attachment-size' into 'develop'

Add upload limits to /api/v1/instance

See merge request pleroma/pleroma!1614
This commit is contained in:
feld 2019-10-01 22:16:29 +00:00
commit aaafec7eb8
3 changed files with 11 additions and 2 deletions

View file

@ -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) - 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: `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 - 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 ### Changed
- **Breaking:** Elixir >=1.8 is now required (was >= 1.7) - **Breaking:** Elixir >=1.8 is now required (was >= 1.7)

View file

@ -51,7 +51,11 @@ def masto_instance(conn, _params) do
registrations: Pleroma.Config.get([:instance, :registrations_open]), registrations: Pleroma.Config.get([:instance, :registrations_open]),
# Extra (not present in Mastodon): # Extra (not present in Mastodon):
max_toot_chars: Keyword.get(instance, :limit), 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) json(conn, response)

View file

@ -135,7 +135,11 @@ test "get instance information", %{conn: conn} do
"thumbnail" => _, "thumbnail" => _,
"languages" => _, "languages" => _,
"registrations" => _, "registrations" => _,
"poll_limits" => _ "poll_limits" => _,
"upload_limit" => _,
"avatar_upload_limit" => _,
"background_upload_limit" => _,
"banner_upload_limit" => _
} = result } = result
assert email == from_config_email assert email == from_config_email