fix: federating category mentions

This commit is contained in:
Julian Lam
2024-07-09 15:42:08 -04:00
parent f605e188db
commit 00a266790d
2 changed files with 3 additions and 3 deletions

View File

@@ -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}`;
}