From deb5ee5e01d54695ce52d002641e9d6e81d5da51 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Mon, 3 Mar 2025 11:51:36 -0500 Subject: [PATCH] fix: improper cc and object fields in announceObject --- src/activitypub/feps.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/activitypub/feps.js b/src/activitypub/feps.js index 3611ad805a..f8169cf621 100644 --- a/src/activitypub/feps.js +++ b/src/activitypub/feps.js @@ -69,8 +69,10 @@ Feps.announceObject = async function announceObject(id) { return; } - const author = await posts.getPostField(id, 'uid'); - if (!utils.isNumber(author) && !author.startsWith(nconf.get('url'))) { + let author = await posts.getPostField(id, 'uid'); + if (utils.isNumber(author)) { + author = `${nconf.get('url')}/uid/${author}`; + } else if (!author.startsWith(nconf.get('url'))) { followers.unshift(author); } @@ -81,6 +83,6 @@ Feps.announceObject = async function announceObject(id) { actor: `${nconf.get('url')}/category/${cid}`, to: [`${nconf.get('url')}/category/${cid}/followers`], cc: [author, activitypub._constants.publicAddress], - object: id, + object: utils.isNumber(id) ? `${nconf.get('url')}/post/${id}` : id, }); };