From ccd9c7ed85c0441ebb2dd5feeea50aa9d42c0b6e Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 14 Mar 2024 14:48:35 -0400 Subject: [PATCH] fix: tweak maxTags handling --- src/activitypub/notes.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/activitypub/notes.js b/src/activitypub/notes.js index 8716a7945a..a2906c40d0 100644 --- a/src/activitypub/notes.js +++ b/src/activitypub/notes.js @@ -194,12 +194,12 @@ Notes.assertTopic = async (uid, id) => { let tags; if (!hasTid) { const systemTags = (meta.config.systemTags || '').split(','); - const maxTags = cid > 0 ? await categories.getCategoryField(cid, 'maxTags') : null; + const maxTags = await categories.getCategoryField(cid, 'maxTags'); tags = (mainPost._activitypub.tag || []) .filter(o => o.type === 'Hashtag' && !systemTags.includes(o.name.slice(1))) .map(o => o.name.slice(1)); - if (maxTags) { + if (maxTags && tags.length > maxTags) { tags.length = maxTags; }