diff options
author | feld <feld@feld.me> | 2024-05-11 12:11:00 +0000 |
---|---|---|
committer | feld <feld@feld.me> | 2024-05-11 12:11:00 +0000 |
commit | c954437cc02f92b5c48c29d2c12d21496d13f813 (patch) | |
tree | d9965651509f4d9c62f606d99c54565fcd4170c9 /lib | |
parent | 6cfb0d7ddbfca5aef79b6da04e1abb1b1a4b59b7 (diff) | |
parent | acf73f7e13515c64a9cfa935f6102f7ffa32585b (diff) | |
download | pleroma-c954437cc02f92b5c48c29d2c12d21496d13f813.tar.gz pleroma-c954437cc02f92b5c48c29d2c12d21496d13f813.zip |
Merge branch 'mastodon-instance-v2' into 'develop'
Add new values to /api/v2/instance
Closes #3250 and #3251
See merge request pleroma/pleroma!4106
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/api_spec/operations/instance_operation.ex | 27 | ||||
-rw-r--r-- | lib/pleroma/web/mastodon_api/views/instance_view.ex | 2 |
2 files changed, 29 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..b6c411c07 100644 --- a/lib/pleroma/web/api_spec/operations/instance_operation.ex +++ b/lib/pleroma/web/api_spec/operations/instance_operation.ex @@ -50,6 +50,15 @@ defmodule Pleroma.Web.ApiSpec.InstanceOperation do %Schema{ type: :object, properties: %{ + accounts: %Schema{ + type: :object, + properties: %{ + max_featured_tags: %Schema{ + type: :integer, + description: "The maximum number of featured tags allowed for each account." + } + } + }, uri: %Schema{type: :string, description: "The domain name of the instance"}, title: %Schema{type: :string, description: "The title of the website"}, description: %Schema{ @@ -272,6 +281,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: %{ @@ -285,6 +307,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..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,8 @@ 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: %{ streaming: Pleroma.Web.Endpoint.websocket_url(), |