Use sed instead of patch for char limit
This commit is contained in:
@@ -93,9 +93,8 @@ RUN ldconfig && \
|
|||||||
# Download Mastodon source
|
# Download Mastodon source
|
||||||
RUN curl -L https://github.com/tootsuite/mastodon/archive/v${MASTODON_VERSION}.tar.gz | tar -xz --strip-components 1 -f -
|
RUN curl -L https://github.com/tootsuite/mastodon/archive/v${MASTODON_VERSION}.tar.gz | tar -xz --strip-components 1 -f -
|
||||||
|
|
||||||
# Apply character limit patch
|
RUN sed -i 's/MAX_CHARS = 500/MAX_CHARS = 2500/g' app/validators/status_length_validator.rb && \
|
||||||
COPY char-limit.patch /tmp/
|
sed -i "s/max_characters'], 500)/max_characters'], 2500)/g" app/javascript/mastodon/features/compose/containers/compose_form_container.js
|
||||||
RUN patch -p1 < /tmp/char-limit.patch
|
|
||||||
|
|
||||||
# Install Ruby dependencies
|
# Install Ruby dependencies
|
||||||
RUN bundle config --local set deployment 'true' && \
|
RUN bundle config --local set deployment 'true' && \
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
diff --git a/app/validators/status_length_validator.rb b/app/validators/status_length_validator.rb
|
|
||||||
index 1234567..abcdefg 100644
|
|
||||||
--- a/app/validators/status_length_validator.rb
|
|
||||||
+++ b/app/validators/status_length_validator.rb
|
|
||||||
@@ -2,7 +2,7 @@
|
|
||||||
|
|
||||||
class StatusLengthValidator < ActiveModel::Validator
|
|
||||||
- MAX_CHARS = 500
|
|
||||||
+ MAX_CHARS = 2500
|
|
||||||
URL_PLACEHOLDER_CHARS = 23
|
|
||||||
URL_PLACEHOLDER = 'x' * 23
|
|
||||||
|
|
||||||
diff --git a/app/javascript/mastodon/features/compose/containers/compose_form_container.js b/app/javascript/mastodon/features/compose/containers/compose_form_container.js
|
|
||||||
index 1234567..abcdefg 100644
|
|
||||||
--- a/app/javascript/mastodon/features/compose/containers/compose_form_container.js
|
|
||||||
+++ b/app/javascript/mastodon/features/compose/containers/compose_form_container.js
|
|
||||||
@@ -71,7 +71,7 @@ const mapStateToProps = state => ({
|
|
||||||
anyMedia: state.getIn(['compose', 'media_attachments']).size > 0,
|
|
||||||
isInReply: state.getIn(['compose', 'in_reply_to']) !== null,
|
|
||||||
lang: state.getIn(['compose', 'language']),
|
|
||||||
- maxChars: state.getIn(['server', 'server', 'configuration', 'statuses', 'max_characters'], 500),
|
|
||||||
+ maxChars: state.getIn(['server', 'server', 'configuration', 'statuses', 'max_characters'], 2500),
|
|
||||||
});
|
|
||||||
|
|
||||||
const mapDispatchToProps = dispatch => ({
|
|
||||||
Reference in New Issue
Block a user