diff --git a/src/remote/activitypub/models/person.ts b/src/remote/activitypub/models/person.ts index a0b951c5f4..1c674729cb 100644 --- a/src/remote/activitypub/models/person.ts +++ b/src/remote/activitypub/models/person.ts @@ -134,7 +134,7 @@ export async function createPerson(uri: string, resolver?: Resolver): Promise tag.toLowerCase()); + const tags = extractHashtags(person.tag).map(tag => tag.toLowerCase()).splice(0, 100); const isBot = object.type == 'Service'; @@ -307,7 +307,7 @@ export async function updatePerson(uri: string, resolver?: Resolver | null, hint const { fields, services } = analyzeAttachments(person.attachment || []); - const tags = extractHashtags(person.tag).map(tag => tag.toLowerCase()); + const tags = extractHashtags(person.tag).map(tag => tag.toLowerCase()).splice(0, 100); const updates = { lastFetchedAt: new Date(), diff --git a/src/server/api/endpoints/i/update.ts b/src/server/api/endpoints/i/update.ts index 91056f04a7..99f7efbe1c 100644 --- a/src/server/api/endpoints/i/update.ts +++ b/src/server/api/endpoints/i/update.ts @@ -257,7 +257,7 @@ export default define(meta, async (ps, user, app) => { if (newDescription != null) { const tokens = parse(newDescription); emojis = emojis.concat(extractEmojis(tokens!)); - tags = extractHashtags(tokens!).map(tag => tag.toLowerCase()); + tags = extractHashtags(tokens!).map(tag => tag.toLowerCase()).splice(0, 100); } updates.emojis = emojis; diff --git a/src/services/note/create.ts b/src/services/note/create.ts index fcf991793b..0bb6cc1f5c 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 Array.from(tag || '').length <= 128); + tags = tags.filter(tag => Array.from(tag || '').length <= 128).splice(0, 100); 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));