merge: Increase character hard limits (resolves #686 and #696) (!647)

View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/647

Closes #686 and #696

Approved-by: Marie <github@yuugi.dev>
Approved-by: dakkar <dakkar@thenautilus.net>
This commit is contained in:
Hazelnoot 2024-10-07 23:20:14 +00:00
commit a90b4d487a
11 changed files with 57 additions and 10 deletions

View file

@ -351,6 +351,18 @@ export class NoteCreateService implements OnApplicationShutdown {
data.text = null;
}
if (data.cw) {
if (data.cw.length > DB_MAX_NOTE_TEXT_LENGTH) {
data.cw = data.cw.slice(0, DB_MAX_NOTE_TEXT_LENGTH);
}
data.cw = data.cw.trim();
if (data.cw === '') {
data.cw = null;
}
} else {
data.cw = null;
}
let tags = data.apHashtags;
let emojis = data.apEmojis;
let mentionedUsers = data.apMentions;