Skip to content

Node.js based forum software built for the modern web

fix: getCidByPid call returning improper values because a remote url to a local post was passed in

Julian Lam4030c09e2782
diff --git a/src/activitypub/inbox.js b/src/activitypub/inbox.js
index deb5236db1..99446020a3 100644
--- a/src/activitypub/inbox.js
+++ b/src/activitypub/inbox.js
@@ -33,7 +33,11 @@ function reject(type, object, target, senderType = 'uid', id = 0) {
// FEP 1b12
async function announce(id, activity) {
- const cid = await posts.getCidByPid(id);
+ let localId;
+ if (id.startsWith(nconf.get('url'))) {
+ ({ id: localId } = await activitypub.helpers.resolveLocalId(id));
+ }
+ const cid = await posts.getCidByPid(localId || id);
const followers = await activitypub.notes.getCategoryFollowers(cid);
if (!followers.length) {