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 @@ defp instance2 do
type: :object, type: :object,
description: "Instance configuration", description: "Instance configuration",
properties: %{ 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{ urls: %Schema{
type: :object, type: :object,
properties: %{ properties: %{

View File

@ -213,6 +213,7 @@ defp configuration do
defp configuration2 do defp configuration2 do
configuration() configuration()
|> put_in([:accounts, :max_pinned_statuses], Config.get([:instance, :max_pinned_statuses], 0))
|> put_in([:statuses, :characters_reserved_per_url], 0) |> put_in([:statuses, :characters_reserved_per_url], 0)
|> Map.merge(%{ |> Map.merge(%{
urls: %{ urls: %{