From 527f27af2948af908006af7fe3683a2aee207fc5 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Mon, 8 Sep 2025 12:00:32 -0400 Subject: [PATCH] fix: make auto-categorization logic case-insensitive --- src/activitypub/notes.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/activitypub/notes.js b/src/activitypub/notes.js index ce9371fd26..3b15ab0137 100644 --- a/src/activitypub/notes.js +++ b/src/activitypub/notes.js @@ -399,15 +399,18 @@ async function assertRelation(post) { } async function assignCategory(post) { + activitypub.helpers.log('[activitypub] Checking auto-categorization rules.'); let cid = undefined; const rules = await activitypub.rules.list(); - const tags = await Notes._normalizeTags(post._activitypub.tag || []); + let tags = await Notes._normalizeTags(post._activitypub.tag || []); + tags = tags.map(tag => tag.toLowerCase()); cid = rules.reduce((cid, { type, value, cid: target }) => { if (!cid) { switch (type) { case 'hashtag': { - if (tags.includes(value)) { + if (tags.includes(value.toLowerCase())) { + activitypub.helpers.log(`[activitypub] - Rule match: #${value}; cid: ${target}`); return target; } break;