From b8ef027caca2739952e8dcf27606991e76783e28 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 4 Mar 2026 14:22:46 -0500 Subject: [PATCH] fix: #14046, sneak in a mention to the community in mocked replies --- src/activitypub/mocks.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/activitypub/mocks.js b/src/activitypub/mocks.js index aebd520b4b..ce3d1267d4 100644 --- a/src/activitypub/mocks.js +++ b/src/activitypub/mocks.js @@ -815,10 +815,6 @@ Mocks.notes.public = async (post) => { let context = await posts.getPostField(post.pid, 'context'); context = context || `${nconf.get('url')}/topic/${post.topic.tid}`; - /** - * audience is exposed as part of 1b12 but is now ignored by Lemmy. - * Remove this and most references to audience in 2026. - */ let audience = utils.isNumber(post.category.cid) ? // default `${nconf.get('url')}/category/${post.category.cid}` : post.category.cid; if (inReplyTo) { @@ -829,6 +825,17 @@ Mocks.notes.public = async (post) => { } to.add(audience); + // Sneak in a mention for the remote category (so Mastodon users address distributor) + if (!audience.startsWith(nconf.get('url'))) { + const slug = await categories.getCategoryField(audience, 'slug'); + tag = tag || []; + tag.push({ + type: 'Mention', + href: audience, + name: `@${slug}`, + }); + } + let object = { '@context': 'https://www.w3.org/ns/activitystreams', id,