From b6168202aec4c33cb1c8503200570d9d88ecd23f Mon Sep 17 00:00:00 2001 From: Opliko Date: Wed, 10 Apr 2024 00:17:14 +0200 Subject: [PATCH] fix: reject accepts of invalid follows and return when already following --- src/activitypub/inbox.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/activitypub/inbox.js b/src/activitypub/inbox.js index 42f1dccbf0..1ae86cc4c6 100644 --- a/src/activitypub/inbox.js +++ b/src/activitypub/inbox.js @@ -256,7 +256,8 @@ inbox.accept = async (req) => { if (type === 'Follow') { if (!await db.isSortedSetMember(`followRequests:${uid}`, actor)) { - throw new Error('[[error:activitypub.get-failed]]'); + if (await db.isSortedSetMember(`followingRemote:${uid}`, actor)) return; // already following + return reject('Accept', req.body, actor); // not following, not requested, so reject to hopefully stop retries } const now = Date.now(); await Promise.all([