diff --git a/.github/README.md b/.github/README.md new file mode 100644 index 00000000000000..760f81bf31b497 --- /dev/null +++ b/.github/README.md @@ -0,0 +1,22 @@ +# Mastodon fork for [est.social](https://est.social/) + +Forked from [Mastodon](https://github.com/mastodon/mastodon/). + +This is mainly to manage localization ahead of the official releases. + +## Changes made + +1. Upped char limit to 10,000 after some [discussion](https://est.social/@diana/109989076059242012) on our site. + - app/javascript/mastodon/features/compose/components/compose_form.js + - app/serializers/rest/instance_serializer.rb + - app/serializers/rest/v1/instance_serializer.rb + - app/validators/status_length_validator.rb +2. Localization. These come from the official [Crowdin project](https://crowdin.com/project/mastodon/et) but they are merged ahead of the official releases. + - app/javascript/mastodon/locales/et.json + - config/locales/activerecord.et.yml + - config/locales/devise.et.yml + - config/locales/doorkeeper.et.yml + - config/locales/et.yml + - config/locales/simple_form.et.yml +3. Our version suffix `+est`: + - lib/mastodon/version.rb diff --git a/app/javascript/mastodon/features/compose/components/compose_form.jsx b/app/javascript/mastodon/features/compose/components/compose_form.jsx index 9222b2dc87703b..c6f8052b1df826 100644 --- a/app/javascript/mastodon/features/compose/components/compose_form.jsx +++ b/app/javascript/mastodon/features/compose/components/compose_form.jsx @@ -100,7 +100,7 @@ class ComposeForm extends ImmutablePureComponent { const fulltext = this.getFulltextForCharacterCounting(); const isOnlyWhitespace = fulltext.length !== 0 && fulltext.trim().length === 0; - return !(isSubmitting || isUploading || isChangingUpload || length(fulltext) > 500 || (isOnlyWhitespace && !anyMedia)); + return !(isSubmitting || isUploading || isChangingUpload || length(fulltext) > 10000 || (isOnlyWhitespace && !anyMedia)); }; handleSubmit = (e) => { @@ -297,7 +297,7 @@ class ComposeForm extends ImmutablePureComponent {
- +
diff --git a/app/lib/feed_manager.rb b/app/lib/feed_manager.rb index 26e5b78e8f8864..ff9ba7e73b5e4b 100644 --- a/app/lib/feed_manager.rb +++ b/app/lib/feed_manager.rb @@ -7,7 +7,7 @@ class FeedManager include Redisable # Maximum number of items stored in a single feed - MAX_ITEMS = 800 + MAX_ITEMS = 10_000 # Number of items in the feed since last reblog of status # before the new reblog will be inserted. Must be <= MAX_ITEMS diff --git a/app/serializers/rest/instance_serializer.rb b/app/serializers/rest/instance_serializer.rb index 14aeda9462dbb3..ddbdc48c73ccec 100644 --- a/app/serializers/rest/instance_serializer.rb +++ b/app/serializers/rest/instance_serializer.rb @@ -11,7 +11,7 @@ class ContactSerializer < ActiveModel::Serializer attributes :domain, :title, :version, :source_url, :description, :usage, :thumbnail, :languages, :configuration, - :registrations + :registrations, :max_toot_chars has_one :contact, serializer: ContactSerializer has_many :rules, serializer: REST::RuleSerializer @@ -89,6 +89,10 @@ def registrations } end + def max_toot_chars + StatusLengthValidator::MAX_CHARS + end + private def registrations_enabled? diff --git a/app/serializers/rest/v1/instance_serializer.rb b/app/serializers/rest/v1/instance_serializer.rb index 99d1b2bd62b75f..1bf3138a82e903 100644 --- a/app/serializers/rest/v1/instance_serializer.rb +++ b/app/serializers/rest/v1/instance_serializer.rb @@ -6,7 +6,7 @@ class REST::V1::InstanceSerializer < ActiveModel::Serializer attributes :uri, :title, :short_description, :description, :email, :version, :urls, :stats, :thumbnail, :languages, :registrations, :approval_required, :invites_enabled, - :configuration + :configuration, :max_toot_chars has_one :contact_account, serializer: REST::AccountSerializer @@ -98,6 +98,10 @@ def invites_enabled UserRole.everyone.can?(:invite_users) end + def max_toot_chars + StatusLengthValidator::MAX_CHARS + end + private def instance_presenter diff --git a/app/validators/status_length_validator.rb b/app/validators/status_length_validator.rb index dc841ded3e16bc..cd0a9490b711bf 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 = 10_000 URL_PLACEHOLDER_CHARS = 23 URL_PLACEHOLDER = 'x' * 23