logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git
commit: b979389958e2d96212cf54ad917d55da86524e30
parent 3cad57bf48180ee5f308ad491c21bcf231a7ba69
Author: Mark Felder <feld@feld.me>
Date:   Tue,  7 May 2024 17:45:02 -0400

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

Diffstat:

Mlib/pleroma/web/api_spec/operations/instance_operation.ex13+++++++++++++
Mlib/pleroma/web/mastodon_api/views/instance_view.ex1+
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 @@ -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 @@ -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: %{