From 4030c09e2782b286150e5f26561837f238255652 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Fri, 14 Jun 2024 14:09:52 -0400 Subject: [PATCH] fix: getCidByPid call returning improper values because a remote url to a local post was passed in --- src/activitypub/inbox.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) {