2
0

Compare commits

...

1 Commits

Author SHA1 Message Date
Nicolas Dextraze
2b67d2abc1 fix max chars to 1024
Some checks failed
PR Needs Rebase / label-rebase-needed (push) Has been cancelled
Chromatic / Run Chromatic (push) Has been cancelled
Build nightly container image / compute-suffix (push) Has been cancelled
Build nightly container image / build-image (push) Has been cancelled
Build nightly container image / build-image-streaming (push) Has been cancelled
Crowdin / Download translations / download-translations (push) Has been cancelled
2025-10-13 16:04:57 -04:00
2 changed files with 6 additions and 2 deletions

View File

@@ -12,7 +12,7 @@ class REST::InstanceSerializer < ActiveModel::Serializer
attributes :domain, :title, :version, :source_url, :description,
:usage, :thumbnail, :icon, :languages, :configuration,
:registrations, :api_versions
:registrations, :api_versions, :max_toot_chars
has_one :contact, serializer: ContactSerializer
has_many :rules, serializer: REST::RuleSerializer
@@ -119,6 +119,10 @@ class REST::InstanceSerializer < ActiveModel::Serializer
Mastodon::Version.api_versions
end
def max_toot_chars
StatusLengthValidator::MAX_CHARS
end
private
def registrations_enabled?

View File

@@ -1,7 +1,7 @@
# frozen_string_literal: true
class StatusLengthValidator < ActiveModel::Validator
MAX_CHARS = 500
MAX_CHARS = 1024
URL_PLACEHOLDER_CHARS = 23
URL_PLACEHOLDER = 'x' * 23