From d6dd4a21eaf935565c2c90380b670a4e4b2ba7b7 Mon Sep 17 00:00:00 2001 From: Andrew Date: Thu, 26 Oct 2017 23:05:07 -0700 Subject: [PATCH] Feature: 512-character limit in the toot box on client and serverside --- .../mastodon/features/compose/components/compose_form.js | 6 +++--- app/validators/status_length_validator.rb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/javascript/mastodon/features/compose/components/compose_form.js b/app/javascript/mastodon/features/compose/components/compose_form.js index 6eb01123e..9f038e6fb 100644 --- a/app/javascript/mastodon/features/compose/components/compose_form.js +++ b/app/javascript/mastodon/features/compose/components/compose_form.js @@ -80,7 +80,7 @@ export default class ComposeForm extends ImmutablePureComponent { const { is_submitting, is_uploading, anyMedia } = this.props; const fulltext = [this.props.spoiler_text, countableText(this.props.text)].join(''); - if (is_submitting || is_uploading || length(fulltext) > 500 || (fulltext.length !== 0 && fulltext.trim().length === 0 && !anyMedia)) { + if (is_submitting || is_uploading || length(fulltext) > 512 || (fulltext.length !== 0 && fulltext.trim().length === 0 && !anyMedia)) { return; } @@ -156,7 +156,7 @@ export default class ComposeForm extends ImmutablePureComponent { const { intl, onPaste, showSearch, anyMedia } = this.props; const disabled = this.props.is_submitting; const text = [this.props.spoiler_text, countableText(this.props.text)].join(''); - const disabledButton = disabled || this.props.is_uploading || length(text) > 500 || (text.length !== 0 && text.trim().length === 0 && !anyMedia); + const disabledButton = disabled || this.props.is_uploading || length(text) > 512 || (text.length !== 0 && text.trim().length === 0 && !anyMedia); let publishText = ''; if (this.props.privacy === 'private' || this.props.privacy === 'direct') { @@ -208,7 +208,7 @@ export default class ComposeForm extends ImmutablePureComponent { -
+
diff --git a/app/validators/status_length_validator.rb b/app/validators/status_length_validator.rb index ed5563f64..4d51fd3e1 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 = 512 def validate(status) return unless status.local? && !status.reblog?