Use stringz.length instead of String.length in hashtag length calculation (#5443)

* Use stringz.length instead of String.length

* length to 128, ignore combining
This commit is contained in:
Acid Chicken (硫酸鶏) 2019-09-22 01:21:45 +09:00 committed by syuilo
parent 53fba9b137
commit 0f2d392b4b
2 changed files with 2 additions and 2 deletions

View file

@ -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));