mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2026-02-15 17:16:57 +00:00
Merge branch 'instance-profile-fields' into 'develop'
Add /api/v2/instance profile fields limits info used by Mastodon See merge request pleroma/pleroma!4434
This commit is contained in:
commit
cb78699a3b
3 changed files with 22 additions and 0 deletions
1
changelog.d/instance-profile-fields.add
Normal file
1
changelog.d/instance-profile-fields.add
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
Add /api/v2/instance profile fields limits info used by Mastodon
|
||||||
|
|
@ -342,6 +342,18 @@ defmodule Pleroma.Web.ApiSpec.InstanceOperation do
|
||||||
max_pinned_statuses: %Schema{
|
max_pinned_statuses: %Schema{
|
||||||
type: :integer,
|
type: :integer,
|
||||||
description: "The maximum number of pinned statuses for each account."
|
description: "The maximum number of pinned statuses for each account."
|
||||||
|
},
|
||||||
|
max_profile_fields: %Schema{
|
||||||
|
type: :integer,
|
||||||
|
description: "The maximum number of custom profile fields allowed to be set."
|
||||||
|
},
|
||||||
|
profile_field_name_limit: %Schema{
|
||||||
|
type: :integer,
|
||||||
|
description: "The maximum size of a profile field name, in characters."
|
||||||
|
},
|
||||||
|
profile_field_value_limit: %Schema{
|
||||||
|
type: :integer,
|
||||||
|
description: "The maximum size of a profile field value, in characters."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -303,6 +303,15 @@ defmodule Pleroma.Web.MastodonAPI.InstanceView do
|
||||||
defp configuration2 do
|
defp configuration2 do
|
||||||
configuration()
|
configuration()
|
||||||
|> put_in([:accounts, :max_pinned_statuses], Config.get([:instance, :max_pinned_statuses], 0))
|
|> put_in([:accounts, :max_pinned_statuses], Config.get([:instance, :max_pinned_statuses], 0))
|
||||||
|
|> put_in([:accounts, :max_profile_fields], Config.get([:instance, :max_account_fields]))
|
||||||
|
|> put_in(
|
||||||
|
[:accounts, :profile_field_name_limit],
|
||||||
|
Config.get([:instance, :account_field_name_length])
|
||||||
|
)
|
||||||
|
|> put_in(
|
||||||
|
[:accounts, :profile_field_value_limit],
|
||||||
|
Config.get([:instance, :account_field_value_length])
|
||||||
|
)
|
||||||
|> put_in([:statuses, :characters_reserved_per_url], 0)
|
|> put_in([:statuses, :characters_reserved_per_url], 0)
|
||||||
|> Map.merge(%{
|
|> Map.merge(%{
|
||||||
urls: %{
|
urls: %{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue