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
This commit is contained in:
Mark Felder 2024-05-07 17:45:02 -04:00
parent 3cad57bf48
commit b979389958
2 changed files with 14 additions and 0 deletions

View File

@ -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: %{

View File

@ -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: %{