Skip to content

Node.js based forum software built for the modern web

fix: re-add sending of Announce(Note) for microblog support, #12434

Julian Lam89d2363d5edc
diff --git a/src/api/activitypub.js b/src/api/activitypub.js
index cce5ce8415..154fe2aebc 100644
--- a/src/api/activitypub.js
+++ b/src/api/activitypub.js
@@ -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);
}
});