feat: #13255 new topics in remote category addresses remote category, tests, fixes to tests

This commit is contained in:
Julian Lam
2025-03-21 14:16:33 -04:00
parent 77bd92d55e
commit 38b82acfbc
6 changed files with 115 additions and 16 deletions

View File

@@ -701,7 +701,8 @@ Mocks.notes.public = async (post) => {
* audience is exposed as part of 1b12 but is now ignored by Lemmy.
* Remove this and most references to audience in 2026.
*/
let audience = `${nconf.get('url')}/category/${post.category.cid}`; // default
let audience = utils.isNumber(post.category.cid) ? // default
`${nconf.get('url')}/category/${post.category.cid}` : post.category.cid;
if (inReplyTo) {
const chain = await activitypub.notes.getParentChain(post.uid, inReplyTo);
chain.forEach((post) => {

View File

@@ -129,7 +129,7 @@ activitypubApi.create.note = enabledCheck(async (caller, { pid, post }) => {
await Promise.all([
activitypub.send('uid', caller.uid, Array.from(targets), activity),
activitypub.feps.announce(pid, activity),
activitypubApi.add(caller, { pid }),
utils.isNumber(post.cid) ? activitypubApi.add(caller, { pid }) : undefined,
]);
});

View File

@@ -87,9 +87,7 @@ topicsAPI.create = async function (caller, data) {
socketHelpers.notifyNew(caller.uid, 'newTopic', { posts: [result.postData], topic: result.topicData });
if (!isScheduling) {
setTimeout(() => {
activitypubApi.create.note(caller, { pid: result.postData.pid });
}, 5000);
await activitypubApi.create.note(caller, { pid: result.postData.pid });
}
return result.topicData;