Plain text
diff --git a/app/controllers/api/v2/search_controller.rb b/app/controllers/api/v2/search_controller.rb
index 3cfc6e791..15970ea8a 100644
--- a/app/controllers/api/v2/search_controller.rb
+++ b/app/controllers/api/v2/search_controller.rb
@@ -11,6 +11,7 @@ class Api::V2::SearchController < Api::BaseController
with_options unless: :user_signed_in? do
before_action :query_pagination_error, if: :pagination_requested?
before_action :remote_resolve_error, if: :remote_resolve_requested?
+ before_action :require_user!
end
before_action :require_valid_pagination_options!
diff --git a/app/serializers/rest/instance_serializer.rb b/app/serializers/rest/instance_serializer.rb
index 19361277a..6c03af8e9 100644
--- a/app/serializers/rest/instance_serializer.rb
+++ b/app/serializers/rest/instance_serializer.rb
@@ -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
@@ -111,6 +111,10 @@ class REST::InstanceSerializer < ActiveModel::Serializer
Mastodon::Version.api_versions
end
+ def max_toot_chars
+ 10000
+ end
+
private
def registrations_enabled?
diff --git a/app/validators/status_length_validator.rb b/app/validators/status_length_validator.rb
index dc841ded3..91069040b 100644
--- a/app/validators/status_length_validator.rb
+++ b/app/validators/status_length_validator.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
class StatusLengthValidator < ActiveModel::Validator
- MAX_CHARS = 500
+ MAX_CHARS = 10000
URL_PLACEHOLDER_CHARS = 23
URL_PLACEHOLDER = 'x' * 23diff --git a/app/controllers/api/v2/search_controller.rb b/app/controllers/api/v2/search_controller.rb