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`],
|
||||
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
|
||||
activitypub.send('cid', cid, followers, announce)
|
||||
.catch(err => winston.error(err.stack));
|
||||
Promise.all([
|
||||
activitypub.send('cid', cid, followers, announce),
|
||||
activitypub.send('cid', cid, followers, implicit),
|
||||
]).catch(err => winston.error(err.stack));
|
||||
}, 5000);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user