mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-06-23 07:50:39 +02:00
fix: federate out an Add on post creation even if there are no category followers
This commit is contained in:
@@ -136,8 +136,8 @@ activitypubApi.create.note = enabledCheck(async (caller, { pid, post }) => {
|
|||||||
|
|
||||||
await activitypub.send('uid', caller.uid, Array.from(targets), payload);
|
await activitypub.send('uid', caller.uid, Array.from(targets), payload);
|
||||||
|
|
||||||
if (followers.length) {
|
setTimeout(() => { // Delay sending to avoid potential race condition
|
||||||
setTimeout(() => { // Delay sending to avoid potential race condition
|
if (followers.length) {
|
||||||
Promise.all([payload, payload.object].map(async (object) => {
|
Promise.all([payload, payload.object].map(async (object) => {
|
||||||
await activitypub.send('cid', cid, followers, {
|
await activitypub.send('cid', cid, followers, {
|
||||||
id: `${nconf.get('url')}/post/${encodeURIComponent(object.object ? object.object.id : object.id)}#activity/announce/${Date.now()}`,
|
id: `${nconf.get('url')}/post/${encodeURIComponent(object.object ? object.object.id : object.id)}#activity/announce/${Date.now()}`,
|
||||||
@@ -147,9 +147,9 @@ activitypubApi.create.note = enabledCheck(async (caller, { pid, post }) => {
|
|||||||
object,
|
object,
|
||||||
});
|
});
|
||||||
})).catch(err => winston.error(err.stack));
|
})).catch(err => winston.error(err.stack));
|
||||||
activitypubApi.add(caller, { pid });
|
}
|
||||||
}, 5000);
|
activitypubApi.add(caller, { pid });
|
||||||
}
|
}, 5000);
|
||||||
});
|
});
|
||||||
|
|
||||||
activitypubApi.create.privateNote = enabledCheck(async (caller, { messageObj }) => {
|
activitypubApi.create.privateNote = enabledCheck(async (caller, { messageObj }) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user