Compare commits
1 Commits
techhub
...
2b67d2abc1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2b67d2abc1 |
@@ -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?
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user