2023-01-09 13:13:56 +00:00
|
|
|
diff --git a/app/serializers/rest/instance_serializer.rb b/app/serializers/rest/instance_serializer.rb
|
2024-10-14 12:51:55 +00:00
|
|
|
index 19361277a..03dc1ad85 100644
|
2023-01-09 13:13:56 +00:00
|
|
|
--- a/app/serializers/rest/instance_serializer.rb
|
|
|
|
+++ b/app/serializers/rest/instance_serializer.rb
|
2024-10-14 12:51:55 +00:00
|
|
|
@@ -11,12 +11,17 @@ class REST::InstanceSerializer < ActiveModel::Serializer
|
|
|
|
include RoutingHelper
|
2023-01-09 13:13:56 +00:00
|
|
|
|
|
|
|
attributes :domain, :title, :version, :source_url, :description,
|
|
|
|
+ :max_toot_chars,
|
2024-10-14 12:51:55 +00:00
|
|
|
:usage, :thumbnail, :icon, :languages, :configuration,
|
|
|
|
:registrations, :api_versions
|
2023-01-09 13:13:56 +00:00
|
|
|
|
|
|
|
has_one :contact, serializer: ContactSerializer
|
|
|
|
has_many :rules, serializer: REST::RuleSerializer
|
|
|
|
|
|
|
|
+ def max_toot_chars
|
|
|
|
+ StatusLengthValidator::MAX_CHARS
|
|
|
|
+ end
|
|
|
|
+
|
|
|
|
def thumbnail
|
|
|
|
if object.thumbnail
|
|
|
|
{
|
2023-01-12 12:51:21 +00:00
|
|
|
diff --git a/app/serializers/rest/v1/instance_serializer.rb b/app/serializers/rest/v1/instance_serializer.rb
|
2024-10-14 12:51:55 +00:00
|
|
|
index 7f9f21c5a..c99f1f9c1 100644
|
2023-01-12 12:51:21 +00:00
|
|
|
--- a/app/serializers/rest/v1/instance_serializer.rb
|
|
|
|
+++ b/app/serializers/rest/v1/instance_serializer.rb
|
2024-10-14 12:51:55 +00:00
|
|
|
@@ -4,6 +4,7 @@ class REST::V1::InstanceSerializer < ActiveModel::Serializer
|
|
|
|
include RoutingHelper
|
|
|
|
|
2023-01-12 12:51:21 +00:00
|
|
|
attributes :uri, :title, :short_description, :description, :email,
|
2024-10-14 12:51:55 +00:00
|
|
|
+ :max_toot_chars,
|
2023-01-12 12:51:21 +00:00
|
|
|
:version, :urls, :stats, :thumbnail,
|
|
|
|
:languages, :registrations, :approval_required, :invites_enabled,
|
|
|
|
:configuration
|
2024-10-14 12:51:55 +00:00
|
|
|
@@ -12,6 +13,10 @@ class REST::V1::InstanceSerializer < ActiveModel::Serializer
|
2023-01-12 12:51:21 +00:00
|
|
|
|
|
|
|
has_many :rules, serializer: REST::RuleSerializer
|
|
|
|
|
|
|
|
+ def max_toot_chars
|
|
|
|
+ StatusLengthValidator::MAX_CHARS
|
|
|
|
+ end
|
|
|
|
+
|
|
|
|
def uri
|
|
|
|
object.domain
|
|
|
|
end
|