From 8b717d54108497524edf33f84de50420aab8a6f9 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Fri, 14 Feb 2025 21:12:18 -0500 Subject: [PATCH] fix: restrict feps methods to real cids --- src/activitypub/feps.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/activitypub/feps.js b/src/activitypub/feps.js index 4cb0b8821c..e652a0c829 100644 --- a/src/activitypub/feps.js +++ b/src/activitypub/feps.js @@ -1,7 +1,6 @@ 'use strict'; const nconf = require('nconf'); -const winston = require('winston'); const posts = require('../posts'); @@ -14,6 +13,9 @@ Feps.announce = async function announce(id, activity) { ({ id: localId } = await activitypub.helpers.resolveLocalId(id)); } const cid = await posts.getCidByPid(localId || id); + if (cid === -1) { + return; + } const followers = await activitypub.notes.getCategoryFollowers(cid); if (!followers.length) { @@ -44,6 +46,9 @@ Feps.announceObject = async function announceObject(id) { ({ id: localId } = await activitypub.helpers.resolveLocalId(id)); } const cid = await posts.getCidByPid(localId || id); + if (cid === -1) { + return; + } const followers = await activitypub.notes.getCategoryFollowers(cid); if (!followers.length) {