fix: improper cc and object fields in announceObject

This commit is contained in:
Julian Lam
2025-03-03 11:51:36 -05:00
parent feb9421507
commit deb5ee5e01

View File

@@ -69,8 +69,10 @@ Feps.announceObject = async function announceObject(id) {
return; return;
} }
const author = await posts.getPostField(id, 'uid'); let author = await posts.getPostField(id, 'uid');
if (!utils.isNumber(author) && !author.startsWith(nconf.get('url'))) { if (utils.isNumber(author)) {
author = `${nconf.get('url')}/uid/${author}`;
} else if (!author.startsWith(nconf.get('url'))) {
followers.unshift(author); followers.unshift(author);
} }
@@ -81,6 +83,6 @@ Feps.announceObject = async function announceObject(id) {
actor: `${nconf.get('url')}/category/${cid}`, actor: `${nconf.get('url')}/category/${cid}`,
to: [`${nconf.get('url')}/category/${cid}/followers`], to: [`${nconf.get('url')}/category/${cid}/followers`],
cc: [author, activitypub._constants.publicAddress], cc: [author, activitypub._constants.publicAddress],
object: id, object: utils.isNumber(id) ? `${nconf.get('url')}/post/${id}` : id,
}); });
}; };