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

This commit is contained in:
Julian Lam
2024-06-14 14:09:52 -04:00
parent 6569066ef8
commit 4030c09e27

View File

@@ -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) {