From 4be80cbe06f1b859c82ee47a281f977f2e26e4fe Mon Sep 17 00:00:00 2001 From: Falko Zurell Date: Tue, 10 Oct 2023 19:45:38 +0200 Subject: [PATCH 01/13] added patchfile for v4.2.1 --- ...ase-character-limit-from-500-to-5000.patch | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 character-limit-patch.patch/v4.2.1-increase-character-limit-from-500-to-5000.patch diff --git a/character-limit-patch.patch/v4.2.1-increase-character-limit-from-500-to-5000.patch b/character-limit-patch.patch/v4.2.1-increase-character-limit-from-500-to-5000.patch new file mode 100644 index 0000000..9e9103f --- /dev/null +++ b/character-limit-patch.patch/v4.2.1-increase-character-limit-from-500-to-5000.patch @@ -0,0 +1,48 @@ +From 1d7ac665608f78c497d346c0a2e5909d1e83e753 Mon Sep 17 00:00:00 2001 +From: Falko Zurell +Date: Tue, 10 Oct 2023 19:41:59 +0200 +Subject: [PATCH] apply 5000 char limit patch to 4.2.1 + +--- + .../mastodon/features/compose/components/compose_form.jsx | 4 ++-- + app/validators/status_length_validator.rb | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/app/javascript/mastodon/features/compose/components/compose_form.jsx b/app/javascript/mastodon/features/compose/components/compose_form.jsx +index 9222b2dc8..962310a28 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) > 5000 || (isOnlyWhitespace && !anyMedia)); + }; + + handleSubmit = (e) => { +@@ -297,7 +297,7 @@ class ComposeForm extends ImmutablePureComponent { + + +
+- ++ +
+ + +diff --git a/app/validators/status_length_validator.rb b/app/validators/status_length_validator.rb +index dc841ded3..9cb1ec94b 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 = 5000 + URL_PLACEHOLDER_CHARS = 23 + URL_PLACEHOLDER = 'x' * 23 + +-- +2.39.3 (Apple Git-145) + From 5b3c3ab5bbb3a816f32f3827ecf539b531107ab7 Mon Sep 17 00:00:00 2001 From: Falko Zurell Date: Tue, 5 Dec 2023 11:37:15 +0100 Subject: [PATCH 02/13] patch for v4.2.2 Signed-off-by: Falko Zurell --- ...ase-character-limit-from-500-to-5000.patch | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 character-limit-patch.patch/v4.2.2-increase-character-limit-from-500-to-5000.patch diff --git a/character-limit-patch.patch/v4.2.2-increase-character-limit-from-500-to-5000.patch b/character-limit-patch.patch/v4.2.2-increase-character-limit-from-500-to-5000.patch new file mode 100644 index 0000000..c941450 --- /dev/null +++ b/character-limit-patch.patch/v4.2.2-increase-character-limit-from-500-to-5000.patch @@ -0,0 +1,49 @@ +From 5c2fceaddd82bb9a78103c2df25ad3f953d14d71 Mon Sep 17 00:00:00 2001 +From: Falko Zurell +Date: Tue, 5 Dec 2023 11:34:09 +0100 +Subject: [PATCH] patch for v4.2.2 + +Signed-off-by: Falko Zurell +--- + .../mastodon/features/compose/components/compose_form.jsx | 4 ++-- + app/validators/status_length_validator.rb | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/app/javascript/mastodon/features/compose/components/compose_form.jsx b/app/javascript/mastodon/features/compose/components/compose_form.jsx +index 9222b2dc8..962310a28 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) > 5000 || (isOnlyWhitespace && !anyMedia)); + }; + + handleSubmit = (e) => { +@@ -297,7 +297,7 @@ class ComposeForm extends ImmutablePureComponent { + + +
+- ++ +
+ + +diff --git a/app/validators/status_length_validator.rb b/app/validators/status_length_validator.rb +index dc841ded3..9cb1ec94b 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 = 5000 + URL_PLACEHOLDER_CHARS = 23 + URL_PLACEHOLDER = 'x' * 23 + +-- +2.39.3 (Apple Git-145) + From 1d537bc05263c519f0a0ef525c5d328511654b47 Mon Sep 17 00:00:00 2001 From: Falko Zurell Date: Tue, 5 Dec 2023 11:43:49 +0100 Subject: [PATCH 03/13] added some documentation about the workflow Signed-off-by: Falko Zurell --- README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index eab88ca..bd552d5 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,14 @@ # mastodon-character-increase -mastodon char increase \ No newline at end of file +mastodon char increase as documentated at https://write.as/sweetmeat/customize-mastodon-to-change-your-post-character-limit + + +### Workflow: + +1. check out the mastodon original code +1. check out the Tag your want to patch for (e.q. `git checkout v.4.2.2`) +1. create a new branch from the tag: `git checkout -b v4.2.2-maxChar500` +1. modify the files that need to be modified +1. create the diff patch file: `mastodon git:(v4.2.2-maxChar5000) git format-patch --stdout v4.2.2` +1. verify the patch and save into this repo: `mastodon git:(v4.2.2-maxChar5000) git format-patch --stdout v4.2.2 > ../mastodon-character-increase/character-limit-patch.patch/v4.2.2-increase-character-limit-from-500-to-5000.patch` + From 3ad06a07cbf4066af6c555687e16f7dc94c0aea2 Mon Sep 17 00:00:00 2001 From: Falko Zurell Date: Tue, 5 Dec 2023 11:53:47 +0100 Subject: [PATCH 04/13] fixing ruby gems Signed-off-by: Falko Zurell --- ...ase-character-limit-from-500-to-5000.patch | 40 ++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/character-limit-patch.patch/v4.2.2-increase-character-limit-from-500-to-5000.patch b/character-limit-patch.patch/v4.2.2-increase-character-limit-from-500-to-5000.patch index c941450..b23cbb7 100644 --- a/character-limit-patch.patch/v4.2.2-increase-character-limit-from-500-to-5000.patch +++ b/character-limit-patch.patch/v4.2.2-increase-character-limit-from-500-to-5000.patch @@ -1,7 +1,7 @@ From 5c2fceaddd82bb9a78103c2df25ad3f953d14d71 Mon Sep 17 00:00:00 2001 From: Falko Zurell Date: Tue, 5 Dec 2023 11:34:09 +0100 -Subject: [PATCH] patch for v4.2.2 +Subject: [PATCH 1/2] patch for v4.2.2 Signed-off-by: Falko Zurell --- @@ -47,3 +47,41 @@ index dc841ded3..9cb1ec94b 100644 -- 2.39.3 (Apple Git-145) + +From b4872f2bdf4ff4bb4fc2e905f4a59d7e2c39b88e Mon Sep 17 00:00:00 2001 +From: Falko Zurell +Date: Tue, 5 Dec 2023 11:53:10 +0100 +Subject: [PATCH 2/2] fixing ruby gem issues + +0.3.2 - May 02, 2023 (10 KB) yanked + +Signed-off-by: Falko Zurell +--- + Gemfile.lock | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Gemfile.lock b/Gemfile.lock +index a003cd18d..d83b2f861 100644 +--- a/Gemfile.lock ++++ b/Gemfile.lock +@@ -377,7 +377,7 @@ GEM + ipaddress (0.8.3) + jmespath (1.6.2) + json (2.6.3) +- json-canonicalization (0.3.2) ++ json-canonicalization (0.3.1) + json-jwt (1.15.3) + activesupport (>= 4.2) + aes_key_wrap +@@ -385,7 +385,7 @@ GEM + httpclient + json-ld (3.2.5) + htmlentities (~> 4.3) +- json-canonicalization (~> 0.3, >= 0.3.2) ++ json-canonicalization (~> 0.3, >= 0.3.1) + link_header (~> 0.0, >= 0.0.8) + multi_json (~> 1.15) + rack (>= 2.2, < 4) +-- +2.39.3 (Apple Git-145) + From f5e216672339812629566c530139e67b99ade69d Mon Sep 17 00:00:00 2001 From: Falko Zurell Date: Tue, 5 Dec 2023 12:00:49 +0100 Subject: [PATCH 05/13] upgrade ruby version for canon Signed-off-by: Falko Zurell --- ...ase-character-limit-from-500-to-5000.patch | 40 ++++++++++++++++++- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/character-limit-patch.patch/v4.2.2-increase-character-limit-from-500-to-5000.patch b/character-limit-patch.patch/v4.2.2-increase-character-limit-from-500-to-5000.patch index b23cbb7..281e76d 100644 --- a/character-limit-patch.patch/v4.2.2-increase-character-limit-from-500-to-5000.patch +++ b/character-limit-patch.patch/v4.2.2-increase-character-limit-from-500-to-5000.patch @@ -1,7 +1,7 @@ From 5c2fceaddd82bb9a78103c2df25ad3f953d14d71 Mon Sep 17 00:00:00 2001 From: Falko Zurell Date: Tue, 5 Dec 2023 11:34:09 +0100 -Subject: [PATCH 1/2] patch for v4.2.2 +Subject: [PATCH 1/3] patch for v4.2.2 Signed-off-by: Falko Zurell --- @@ -51,7 +51,7 @@ index dc841ded3..9cb1ec94b 100644 From b4872f2bdf4ff4bb4fc2e905f4a59d7e2c39b88e Mon Sep 17 00:00:00 2001 From: Falko Zurell Date: Tue, 5 Dec 2023 11:53:10 +0100 -Subject: [PATCH 2/2] fixing ruby gem issues +Subject: [PATCH 2/3] fixing ruby gem issues 0.3.2 - May 02, 2023 (10 KB) yanked @@ -85,3 +85,39 @@ index a003cd18d..d83b2f861 100644 -- 2.39.3 (Apple Git-145) + +From de4d16ead13e52a504b352d315d901d677e20eb9 Mon Sep 17 00:00:00 2001 +From: Falko Zurell +Date: Tue, 5 Dec 2023 12:00:15 +0100 +Subject: [PATCH 3/3] upgrade version + +Signed-off-by: Falko Zurell +--- + Gemfile.lock | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Gemfile.lock b/Gemfile.lock +index d83b2f861..efaccb137 100644 +--- a/Gemfile.lock ++++ b/Gemfile.lock +@@ -377,7 +377,7 @@ GEM + ipaddress (0.8.3) + jmespath (1.6.2) + json (2.6.3) +- json-canonicalization (0.3.1) ++ json-canonicalization (1.0.0) + json-jwt (1.15.3) + activesupport (>= 4.2) + aes_key_wrap +@@ -385,7 +385,7 @@ GEM + httpclient + json-ld (3.2.5) + htmlentities (~> 4.3) +- json-canonicalization (~> 0.3, >= 0.3.1) ++ json-canonicalization (~> 1.0, >= 0.3.1) + link_header (~> 0.0, >= 0.0.8) + multi_json (~> 1.15) + rack (>= 2.2, < 4) +-- +2.39.3 (Apple Git-145) + From d63f7717879e60ad63fd6e2fc60f7b159a895f37 Mon Sep 17 00:00:00 2001 From: Falko Zurell Date: Tue, 5 Dec 2023 16:32:01 +0100 Subject: [PATCH 06/13] patch for 4.2.3 Signed-off-by: Falko Zurell --- ...ase-character-limit-from-500-to-5000.patch | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 character-limit-patch.patch/v4.2.3-increase-character-limit-from-500-to-5000.patch diff --git a/character-limit-patch.patch/v4.2.3-increase-character-limit-from-500-to-5000.patch b/character-limit-patch.patch/v4.2.3-increase-character-limit-from-500-to-5000.patch new file mode 100644 index 0000000..9e9103f --- /dev/null +++ b/character-limit-patch.patch/v4.2.3-increase-character-limit-from-500-to-5000.patch @@ -0,0 +1,48 @@ +From 1d7ac665608f78c497d346c0a2e5909d1e83e753 Mon Sep 17 00:00:00 2001 +From: Falko Zurell +Date: Tue, 10 Oct 2023 19:41:59 +0200 +Subject: [PATCH] apply 5000 char limit patch to 4.2.1 + +--- + .../mastodon/features/compose/components/compose_form.jsx | 4 ++-- + app/validators/status_length_validator.rb | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/app/javascript/mastodon/features/compose/components/compose_form.jsx b/app/javascript/mastodon/features/compose/components/compose_form.jsx +index 9222b2dc8..962310a28 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) > 5000 || (isOnlyWhitespace && !anyMedia)); + }; + + handleSubmit = (e) => { +@@ -297,7 +297,7 @@ class ComposeForm extends ImmutablePureComponent { + + +
+- ++ +
+ + +diff --git a/app/validators/status_length_validator.rb b/app/validators/status_length_validator.rb +index dc841ded3..9cb1ec94b 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 = 5000 + URL_PLACEHOLDER_CHARS = 23 + URL_PLACEHOLDER = 'x' * 23 + +-- +2.39.3 (Apple Git-145) + From cbebe6d6a019cb9c86013118540d9a713e295d1f Mon Sep 17 00:00:00 2001 From: Falko Zurell Date: Thu, 25 Jan 2024 12:34:32 +0100 Subject: [PATCH 07/13] updated README file Signed-off-by: Falko Zurell --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index bd552d5..a567c2a 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ mastodon char increase as documentated at https://write.as/sweetmeat/customize-mastodon-to-change-your-post-character-limit +https://1010.gitlab.io/posts/customize-mastodon-character-limit/ + ### Workflow: @@ -9,6 +11,7 @@ mastodon char increase as documentated at https://write.as/sweetmeat/customize-m 1. check out the Tag your want to patch for (e.q. `git checkout v.4.2.2`) 1. create a new branch from the tag: `git checkout -b v4.2.2-maxChar500` 1. modify the files that need to be modified +1. commit the changes to your branch: `git commit` 1. create the diff patch file: `mastodon git:(v4.2.2-maxChar5000) git format-patch --stdout v4.2.2` 1. verify the patch and save into this repo: `mastodon git:(v4.2.2-maxChar5000) git format-patch --stdout v4.2.2 > ../mastodon-character-increase/character-limit-patch.patch/v4.2.2-increase-character-limit-from-500-to-5000.patch` From ac6e3b70a5374ef268941a2125aa436aa6d5e437 Mon Sep 17 00:00:00 2001 From: Falko Zurell Date: Thu, 25 Jan 2024 12:34:44 +0100 Subject: [PATCH 08/13] patch for v4.2.4 Signed-off-by: Falko Zurell --- .../v4.2-increase-character-limit-from-500-to-5000.patch | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/character-limit-patch.patch/v4.2-increase-character-limit-from-500-to-5000.patch b/character-limit-patch.patch/v4.2-increase-character-limit-from-500-to-5000.patch index a10700d..038319c 100644 --- a/character-limit-patch.patch/v4.2-increase-character-limit-from-500-to-5000.patch +++ b/character-limit-patch.patch/v4.2-increase-character-limit-from-500-to-5000.patch @@ -1,8 +1,9 @@ -From 1bc2e7f11e06b04449178d65268234146ef452aa Mon Sep 17 00:00:00 2001 -From: Falko Zurell -Date: Thu, 21 Sep 2023 13:05:23 +0200 -Subject: [PATCH] 5000 Character Limit mod for Mastodon v4.2 +From b3c2e2a6fbf5413ca5e4fae16265fa16afc60aa3 Mon Sep 17 00:00:00 2001 +From: Falko Zurell +Date: Thu, 25 Jan 2024 12:31:41 +0100 +Subject: [PATCH] applied patch for 5k char limit +Signed-off-by: Falko Zurell --- .../mastodon/features/compose/components/compose_form.jsx | 4 ++-- app/validators/status_length_validator.rb | 2 +- From 7ec4aca5167030715ddb2087628979bda0198f7b Mon Sep 17 00:00:00 2001 From: Falko Zurell Date: Thu, 25 Jan 2024 12:35:37 +0100 Subject: [PATCH 09/13] patch for v4.2.4 specifically Signed-off-by: Falko Zurell --- ...ase-character-limit-from-500-to-5000.patch | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 character-limit-patch.patch/v4.2.4-increase-character-limit-from-500-to-5000.patch diff --git a/character-limit-patch.patch/v4.2.4-increase-character-limit-from-500-to-5000.patch b/character-limit-patch.patch/v4.2.4-increase-character-limit-from-500-to-5000.patch new file mode 100644 index 0000000..038319c --- /dev/null +++ b/character-limit-patch.patch/v4.2.4-increase-character-limit-from-500-to-5000.patch @@ -0,0 +1,49 @@ +From b3c2e2a6fbf5413ca5e4fae16265fa16afc60aa3 Mon Sep 17 00:00:00 2001 +From: Falko Zurell +Date: Thu, 25 Jan 2024 12:31:41 +0100 +Subject: [PATCH] applied patch for 5k char limit + +Signed-off-by: Falko Zurell +--- + .../mastodon/features/compose/components/compose_form.jsx | 4 ++-- + app/validators/status_length_validator.rb | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/app/javascript/mastodon/features/compose/components/compose_form.jsx b/app/javascript/mastodon/features/compose/components/compose_form.jsx +index 9222b2dc8..962310a28 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) > 5000 || (isOnlyWhitespace && !anyMedia)); + }; + + handleSubmit = (e) => { +@@ -297,7 +297,7 @@ class ComposeForm extends ImmutablePureComponent { + + +
+- ++ +
+ + +diff --git a/app/validators/status_length_validator.rb b/app/validators/status_length_validator.rb +index dc841ded3..9cb1ec94b 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 = 5000 + URL_PLACEHOLDER_CHARS = 23 + URL_PLACEHOLDER = 'x' * 23 + +-- +2.39.3 (Apple Git-145) + From c6d63e88efb837de3fe9c311e9f641b796ad8d5f Mon Sep 17 00:00:00 2001 From: Falko Zurell Date: Thu, 1 Feb 2024 17:51:15 +0100 Subject: [PATCH 10/13] emergency patch for v.4.2.5 Signed-off-by: Falko Zurell --- ...ase-character-limit-from-500-to-5000.patch | 6 +-- ...ase-character-limit-from-500-to-5000.patch | 49 +++++++++++++++++++ 2 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 character-limit-patch.patch/v4.2.5-increase-character-limit-from-500-to-5000.patch diff --git a/character-limit-patch.patch/v4.2-increase-character-limit-from-500-to-5000.patch b/character-limit-patch.patch/v4.2-increase-character-limit-from-500-to-5000.patch index 038319c..96a8409 100644 --- a/character-limit-patch.patch/v4.2-increase-character-limit-from-500-to-5000.patch +++ b/character-limit-patch.patch/v4.2-increase-character-limit-from-500-to-5000.patch @@ -1,7 +1,7 @@ -From b3c2e2a6fbf5413ca5e4fae16265fa16afc60aa3 Mon Sep 17 00:00:00 2001 +From c8a844ab03ca3b255d345408025595bfd9bd9178 Mon Sep 17 00:00:00 2001 From: Falko Zurell -Date: Thu, 25 Jan 2024 12:31:41 +0100 -Subject: [PATCH] applied patch for 5k char limit +Date: Thu, 1 Feb 2024 17:47:31 +0100 +Subject: [PATCH] applying char increase patch to v4.2.5 Signed-off-by: Falko Zurell --- diff --git a/character-limit-patch.patch/v4.2.5-increase-character-limit-from-500-to-5000.patch b/character-limit-patch.patch/v4.2.5-increase-character-limit-from-500-to-5000.patch new file mode 100644 index 0000000..96a8409 --- /dev/null +++ b/character-limit-patch.patch/v4.2.5-increase-character-limit-from-500-to-5000.patch @@ -0,0 +1,49 @@ +From c8a844ab03ca3b255d345408025595bfd9bd9178 Mon Sep 17 00:00:00 2001 +From: Falko Zurell +Date: Thu, 1 Feb 2024 17:47:31 +0100 +Subject: [PATCH] applying char increase patch to v4.2.5 + +Signed-off-by: Falko Zurell +--- + .../mastodon/features/compose/components/compose_form.jsx | 4 ++-- + app/validators/status_length_validator.rb | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/app/javascript/mastodon/features/compose/components/compose_form.jsx b/app/javascript/mastodon/features/compose/components/compose_form.jsx +index 9222b2dc8..962310a28 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) > 5000 || (isOnlyWhitespace && !anyMedia)); + }; + + handleSubmit = (e) => { +@@ -297,7 +297,7 @@ class ComposeForm extends ImmutablePureComponent { + + +
+- ++ +
+ + +diff --git a/app/validators/status_length_validator.rb b/app/validators/status_length_validator.rb +index dc841ded3..9cb1ec94b 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 = 5000 + URL_PLACEHOLDER_CHARS = 23 + URL_PLACEHOLDER = 'x' * 23 + +-- +2.39.3 (Apple Git-145) + From 6273a8967d229280ea692c803118545e81bac16b Mon Sep 17 00:00:00 2001 From: Falko Zurell Date: Wed, 14 Feb 2024 16:53:20 +0100 Subject: [PATCH 11/13] updated README to include apply cmd Signed-off-by: Falko Zurell --- .gitignore | 1 + README.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9bb88d3 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/.DS_Store diff --git a/README.md b/README.md index a567c2a..1292b22 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ https://1010.gitlab.io/posts/customize-mastodon-character-limit/ 1. check out the mastodon original code 1. check out the Tag your want to patch for (e.q. `git checkout v.4.2.2`) 1. create a new branch from the tag: `git checkout -b v4.2.2-maxChar500` -1. modify the files that need to be modified +1. modify the files that need to be modified (e.q. `git apply ../mastodon-character-increase/character-limit-patch.patch/v4.2-increase-character-limit-from-500-to-5000.patch` ) 1. commit the changes to your branch: `git commit` 1. create the diff patch file: `mastodon git:(v4.2.2-maxChar5000) git format-patch --stdout v4.2.2` 1. verify the patch and save into this repo: `mastodon git:(v4.2.2-maxChar5000) git format-patch --stdout v4.2.2 > ../mastodon-character-increase/character-limit-patch.patch/v4.2.2-increase-character-limit-from-500-to-5000.patch` From c6e936e8bf92fd66538bf3bdf275ec262ac83495 Mon Sep 17 00:00:00 2001 From: Falko Zurell Date: Wed, 14 Feb 2024 16:56:33 +0100 Subject: [PATCH 12/13] added patchfile for v4.2.6 this is the same as for v4.2 Signed-off-by: Falko Zurell --- ...ase-character-limit-from-500-to-5000.patch | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 character-limit-patch.patch/v4.2.6-increase-character-limit-from-500-to-5000.patch diff --git a/character-limit-patch.patch/v4.2.6-increase-character-limit-from-500-to-5000.patch b/character-limit-patch.patch/v4.2.6-increase-character-limit-from-500-to-5000.patch new file mode 100644 index 0000000..892bdb6 --- /dev/null +++ b/character-limit-patch.patch/v4.2.6-increase-character-limit-from-500-to-5000.patch @@ -0,0 +1,48 @@ +From 3ac129a66ae03d58654abfd2f2af2cab293ed809 Mon Sep 17 00:00:00 2001 +From: Falko Zurell +Date: Wed, 14 Feb 2024 16:54:44 +0100 +Subject: [PATCH] applied patch for v4.2.6 + +--- + .../mastodon/features/compose/components/compose_form.jsx | 4 ++-- + app/validators/status_length_validator.rb | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/app/javascript/mastodon/features/compose/components/compose_form.jsx b/app/javascript/mastodon/features/compose/components/compose_form.jsx +index 9222b2dc8..962310a28 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) > 5000 || (isOnlyWhitespace && !anyMedia)); + }; + + handleSubmit = (e) => { +@@ -297,7 +297,7 @@ class ComposeForm extends ImmutablePureComponent { + + +
+- ++ +
+ + +diff --git a/app/validators/status_length_validator.rb b/app/validators/status_length_validator.rb +index dc841ded3..9cb1ec94b 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 = 5000 + URL_PLACEHOLDER_CHARS = 23 + URL_PLACEHOLDER = 'x' * 23 + +-- +2.39.3 (Apple Git-145) + From 90fc350467e990ebd975b2487072d6315ce4c9ae Mon Sep 17 00:00:00 2001 From: Falko Zurell Date: Tue, 8 Oct 2024 15:29:42 +0200 Subject: [PATCH 13/13] new patch for Mastodon v4.3.x Signed-off-by: Falko Zurell --- ...ase-character-limit-from-500-to-5000.patch | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 character-limit-patch.patch/v4.3-increase-character-limit-from-500-to-5000.patch diff --git a/character-limit-patch.patch/v4.3-increase-character-limit-from-500-to-5000.patch b/character-limit-patch.patch/v4.3-increase-character-limit-from-500-to-5000.patch new file mode 100644 index 0000000..283c1ca --- /dev/null +++ b/character-limit-patch.patch/v4.3-increase-character-limit-from-500-to-5000.patch @@ -0,0 +1,26 @@ +From d04253848c2d53cc732e3cb0c6e31be91dd6107c Mon Sep 17 00:00:00 2001 +From: Falko Zurell +Date: Tue, 8 Oct 2024 15:27:02 +0200 +Subject: [PATCH] adjust post character limit to 5000 chars for 4.3.x + +Signed-off-by: Falko Zurell +--- + app/validators/status_length_validator.rb | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/app/validators/status_length_validator.rb b/app/validators/status_length_validator.rb +index dc841ded3..9cb1ec94b 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 = 5000 + URL_PLACEHOLDER_CHARS = 23 + URL_PLACEHOLDER = 'x' * 23 + +-- +2.39.5 (Apple Git-154) +