summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/NoteEditService.ts
diff options
context:
space:
mode:
authorHazelnoot <acomputerdog@gmail.com>2024-10-26 10:04:23 -0400
committerHazelnoot <acomputerdog@gmail.com>2024-10-26 10:04:23 -0400
commit01e98c75abc548bcd674526494cfc8ec0c7912ed (patch)
tree2f2a19373d1724935396404d3397d456085a719d /packages/backend/src/core/NoteEditService.ts
parentfix unit tests (diff)
downloadsharkey-01e98c75abc548bcd674526494cfc8ec0c7912ed.tar.gz
sharkey-01e98c75abc548bcd674526494cfc8ec0c7912ed.tar.bz2
sharkey-01e98c75abc548bcd674526494cfc8ec0c7912ed.zip
add separate limits for CW length
Diffstat (limited to 'packages/backend/src/core/NoteEditService.ts')
-rw-r--r--packages/backend/src/core/NoteEditService.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/packages/backend/src/core/NoteEditService.ts b/packages/backend/src/core/NoteEditService.ts
index b1dd32aef8..d31958e5d4 100644
--- a/packages/backend/src/core/NoteEditService.ts
+++ b/packages/backend/src/core/NoteEditService.ts
@@ -380,9 +380,13 @@ export class NoteEditService implements OnApplicationShutdown {
data.text = null;
}
+ const maxCwLength = user.host == null
+ ? this.config.maxCwLength
+ : this.config.maxRemoteCwLength;
+
if (data.cw) {
- if (data.cw.length > maxTextLength) {
- data.cw = data.cw.slice(0, maxTextLength);
+ if (data.cw.length > maxCwLength) {
+ data.cw = data.cw.slice(0, maxCwLength);
}
data.cw = data.cw.trim();
if (data.cw === '') {