summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMark Felder <feld@feld.me>2024-05-07 17:23:41 -0400
committerMark Felder <feld@feld.me>2024-05-07 17:25:30 -0400
commit3cad57bf48180ee5f308ad491c21bcf231a7ba69 (patch)
tree272cf51ce55bddddb38d3236c2b51ea12385097d /lib
parentffa6805c0919abca6de2329ce01966d883876b30 (diff)
downloadpleroma-3cad57bf48180ee5f308ad491c21bcf231a7ba69.tar.gz
pleroma-3cad57bf48180ee5f308ad491c21bcf231a7ba69.zip
Add configuration[statuses][characters_reserved_per_url] to /api/v2/instance
Fixes #3250
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/api_spec/operations/instance_operation.ex5
-rw-r--r--lib/pleroma/web/mastodon_api/views/instance_view.ex1
2 files changed, 6 insertions, 0 deletions
diff --git a/lib/pleroma/web/api_spec/operations/instance_operation.ex b/lib/pleroma/web/api_spec/operations/instance_operation.ex
index 708b74b12..57aec83a2 100644
--- a/lib/pleroma/web/api_spec/operations/instance_operation.ex
+++ b/lib/pleroma/web/api_spec/operations/instance_operation.ex
@@ -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)"
diff --git a/lib/pleroma/web/mastodon_api/views/instance_view.ex b/lib/pleroma/web/mastodon_api/views/instance_view.ex
index 210b46d2c..337b2cc83 100644
--- a/lib/pleroma/web/mastodon_api/views/instance_view.ex
+++ b/lib/pleroma/web/mastodon_api/views/instance_view.ex
@@ -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(),