mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-30 18:46:01 +01:00
fix: improper cc and object fields in announceObject
This commit is contained in:
@@ -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,
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user