summaryrefslogtreecommitdiff
path: root/src/services/note/create.ts
diff options
context:
space:
mode:
authorAcid Chicken (硫酸鶏) <root@acid-chicken.com>2019-09-22 01:21:45 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2019-09-22 01:21:45 +0900
commit0f2d392b4ba4d72fddc698b0aac9b011f3c21489 (patch)
tree9c097d0982b0d9660da31a2f21890c648b6e4484 /src/services/note/create.ts
parentfix typo (diff)
downloadsharkey-0f2d392b4ba4d72fddc698b0aac9b011f3c21489.tar.gz
sharkey-0f2d392b4ba4d72fddc698b0aac9b011f3c21489.tar.bz2
sharkey-0f2d392b4ba4d72fddc698b0aac9b011f3c21489.zip
Use stringz.length instead of String.length in hashtag length calculation (#5443)
* Use stringz.length instead of String.length * length to 128, ignore combining
Diffstat (limited to 'src/services/note/create.ts')
-rw-r--r--src/services/note/create.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/services/note/create.ts b/src/services/note/create.ts
index 0dd0e1962f..fcf991793b 100644
--- a/src/services/note/create.ts
+++ b/src/services/note/create.ts
@@ -165,7 +165,7 @@ export default async (user: User, data: Option, silent = false) => new Promise<N
mentionedUsers = data.apMentions || await extractMentionedUsers(user, combinedTokens);
}
- tags = tags.filter(tag => tag.length <= 100);
+ tags = tags.filter(tag => Array.from(tag || '').length <= 128);
if (data.reply && (user.id !== data.reply.userId) && !mentionedUsers.some(u => u.id === data.reply!.userId)) {
mentionedUsers.push(await Users.findOne(data.reply.userId).then(ensure));