Add configuration[statuses][characters_reserved_per_url] to /api/v2/instance

Fixes #3250
This commit is contained in:
Mark Felder 2024-05-07 17:23:41 -04:00
parent ffa6805c09
commit 3cad57bf48
3 changed files with 7 additions and 0 deletions

View File

@ -0,0 +1 @@
Add configuration[statuses][characters_reserved_per_url] to /api/v2/instance (https://docs.joinmastodon.org/entities/Instance/#characters_reserved_per_url)

View File

@ -285,6 +285,11 @@ defmodule Pleroma.Web.ApiSpec.InstanceOperation do
type: :object,
description: "A map with poll limits for local statuses",
properties: %{
characters_reserved_per_url: %Schema{
type: :integer,
description:
"Each URL in a status will be assumed to be exactly this many characters."
},
max_characters: %Schema{
type: :integer,
description: "Posts character limit (CW/Subject included in the counter)"

View File

@ -213,6 +213,7 @@ defmodule Pleroma.Web.MastodonAPI.InstanceView do
defp configuration2 do
configuration()
|> put_in([:statuses, :characters_reserved_per_url], 0)
|> Map.merge(%{
urls: %{
streaming: Pleroma.Web.Endpoint.websocket_url(),