forked from FoundKeyGang/FoundKey
Fix tag length limit from AP (#3688)
This commit is contained in:
parent
a5f09c90dd
commit
4fc377584f
1 changed files with 3 additions and 3 deletions
|
@ -163,14 +163,14 @@ export default async (user: IUser, data: Option, silent = false) => new Promise<
|
||||||
|
|
||||||
tags = data.apHashtags || extractHashtags(combinedTokens);
|
tags = data.apHashtags || extractHashtags(combinedTokens);
|
||||||
|
|
||||||
// MongoDBのインデックス対象は128文字以上にできない
|
|
||||||
tags = tags.filter(tag => tag.length <= 100);
|
|
||||||
|
|
||||||
emojis = data.apEmojis || extractEmojis(combinedTokens);
|
emojis = data.apEmojis || extractEmojis(combinedTokens);
|
||||||
|
|
||||||
mentionedUsers = data.apMentions || await extractMentionedUsers(user, combinedTokens);
|
mentionedUsers = data.apMentions || await extractMentionedUsers(user, combinedTokens);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MongoDBのインデックス対象は128文字以上にできない
|
||||||
|
tags = tags.filter(tag => tag.length <= 100);
|
||||||
|
|
||||||
if (data.reply && !user._id.equals(data.reply.userId) && !mentionedUsers.some(u => u._id.equals(data.reply.userId))) {
|
if (data.reply && !user._id.equals(data.reply.userId) && !mentionedUsers.some(u => u._id.equals(data.reply.userId))) {
|
||||||
mentionedUsers.push(await User.findOne({ _id: data.reply.userId }));
|
mentionedUsers.push(await User.findOne({ _id: data.reply.userId }));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue