mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix: re-add sending of Announce(Note) for microblog support, #12434
This commit is contained in:
@@ -163,10 +163,19 @@ activitypubApi.create.note = enabledCheck(async (caller, { pid }) => {
|
|||||||
cc: [`${nconf.get('url')}/category/${cid}/followers`],
|
cc: [`${nconf.get('url')}/category/${cid}/followers`],
|
||||||
object: payload,
|
object: payload,
|
||||||
};
|
};
|
||||||
|
const implicit = {
|
||||||
|
id: `${object.id}#activity/announce/${Date.now()}`,
|
||||||
|
type: 'Announce',
|
||||||
|
to: [activitypub._constants.publicAddress],
|
||||||
|
cc: [`${nconf.get('url')}/category/${cid}/followers`],
|
||||||
|
object: payload.object,
|
||||||
|
};
|
||||||
|
|
||||||
setTimeout(() => { // Delay sending to avoid potential race condition
|
setTimeout(() => { // Delay sending to avoid potential race condition
|
||||||
activitypub.send('cid', cid, followers, announce)
|
Promise.all([
|
||||||
.catch(err => winston.error(err.stack));
|
activitypub.send('cid', cid, followers, announce),
|
||||||
|
activitypub.send('cid', cid, followers, implicit),
|
||||||
|
]).catch(err => winston.error(err.stack));
|
||||||
}, 5000);
|
}, 5000);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user