From 00a266790d16ef1fcd925cb6922241e810e71367 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Tue, 9 Jul 2024 15:42:08 -0400 Subject: [PATCH] fix: federating category mentions --- install/package.json | 2 +- src/activitypub/mocks.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/install/package.json b/install/package.json index 913d8920b1..71f51b8bc2 100644 --- a/install/package.json +++ b/install/package.json @@ -101,7 +101,7 @@ "nodebb-plugin-emoji": "5.1.15", "nodebb-plugin-emoji-android": "4.0.0", "nodebb-plugin-markdown": "13.0.0-pre.8", - "nodebb-plugin-mentions": "4.6.6", + "nodebb-plugin-mentions": "4.6.7", "nodebb-plugin-ntfy": "1.7.4", "nodebb-plugin-spam-be-gone": "2.2.2", "nodebb-rewards-essentials": "1.0.0", diff --git a/src/activitypub/mocks.js b/src/activitypub/mocks.js index af63d47fbb..e90cd564c0 100644 --- a/src/activitypub/mocks.js +++ b/src/activitypub/mocks.js @@ -327,10 +327,10 @@ Mocks.note = async (post) => { if (matches.size) { tag = tag || []; - tag.push(...Array.from(matches).map(({ id: href, slug: name }) => { + tag.push(...Array.from(matches).map(({ type, id: href, slug: name }) => { if (utils.isNumber(href)) { // local ref name = name.toLowerCase(); // local slugs are always lowercase - href = `${nconf.get('url')}/user/${name.slice(1)}`; + href = `${nconf.get('url')}/${type === 'uid' ? 'user' : `category/${href}`}/${name.slice(1)}`; name = `${name}@${nconf.get('url_parsed').hostname}`; }