Skip to content

Node.js based forum software built for the modern web

fix: reject accepts of invalid follows and return when already following

Oplikob6168202aec4
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([