diff options
author | Mark Felder <feld@feld.me> | 2024-05-07 17:45:02 -0400 |
---|---|---|
committer | Mark Felder <feld@feld.me> | 2024-05-07 17:45:02 -0400 |
commit | b979389958e2d96212cf54ad917d55da86524e30 (patch) | |
tree | 28196e0c2ad3914a54d57f98961d82c67d064e6b | |
parent | 3cad57bf48180ee5f308ad491c21bcf231a7ba69 (diff) | |
download | pleroma-b979389958e2d96212cf54ad917d55da86524e30.tar.gz pleroma-b979389958e2d96212cf54ad917d55da86524e30.zip |
Add configuration[accounts][max_pinned_statuses] to /api/v2/instance
Also add the absent max_featured_tags to the api spec for /api/v2/instance
-rw-r--r-- | lib/pleroma/web/api_spec/operations/instance_operation.ex | 13 | ||||
-rw-r--r-- | lib/pleroma/web/mastodon_api/views/instance_view.ex | 1 |
2 files changed, 14 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 57aec83a2..bc37cae75 100644 --- a/lib/pleroma/web/api_spec/operations/instance_operation.ex +++ b/lib/pleroma/web/api_spec/operations/instance_operation.ex @@ -272,6 +272,19 @@ defmodule Pleroma.Web.ApiSpec.InstanceOperation do type: :object, description: "Instance configuration", properties: %{ + accounts: %Schema{ + type: :object, + properties: %{ + max_featured_tags: %Schema{ + type: :integer, + description: "The maximum number of featured tags allowed for each account." + }, + max_pinned_statuses: %Schema{ + type: :integer, + description: "The maximum number of pinned statuses for each account." + } + } + }, urls: %Schema{ type: :object, properties: %{ diff --git a/lib/pleroma/web/mastodon_api/views/instance_view.ex b/lib/pleroma/web/mastodon_api/views/instance_view.ex index 337b2cc83..890dd3977 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([:accounts, :max_pinned_statuses], Config.get([:instance, :max_pinned_statuses], 0)) |> put_in([:statuses, :characters_reserved_per_url], 0) |> Map.merge(%{ urls: %{ |