diff --git a/lib/inbox-listeners.js b/lib/inbox-listeners.js index c63648b..54844c8 100644 --- a/lib/inbox-listeners.js +++ b/lib/inbox-listeners.js @@ -120,30 +120,15 @@ export function registerInboxListeners(inboxChain, options) { } }) .on(Accept, async (ctx, accept) => { - // Handle Accept(Follow) — remote server accepted our Follow request + // Handle Accept(Follow) — remote server accepted our Follow request. + // We don't inspect the inner object type because Fedify often resolves + // it to a Person (the Follow's target) rather than the Follow itself. + // Instead, we match directly against ap_following — if we have a + // pending follow for this actor, any Accept from them confirms it. const actorObj = await accept.getActor(); const actorUrl = actorObj?.id?.href || ""; if (!actorUrl) return; - // Check if the inner object is a Follow. Some servers send the full - // Follow object, others send only a reference URL that Fedify can't - // resolve (since the original Follow was our outgoing activity). - let isFollow = false; - try { - const inner = await accept.getObject(); - isFollow = inner instanceof Follow; - // If inner resolved to a non-Follow activity, skip - if (inner && !isFollow) { - console.info( - `[ActivityPub] Accept from ${actorUrl}: inner is ${inner.constructor?.name}, not Follow — skipping`, - ); - return; - } - } catch { - // getObject() failed — proceed anyway if we have a pending follow - } - - // Match against our following list for refollow or microsub-reader follows const result = await collections.ap_following.findOneAndUpdate( { actorUrl, diff --git a/package.json b/package.json index bb74e9c..4ea84b5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rmdes/indiekit-endpoint-activitypub", - "version": "1.0.15", + "version": "1.0.16", "description": "ActivityPub federation endpoint for Indiekit via Fedify. Adds full fediverse support: actor, inbox, outbox, followers, following, syndication, and Mastodon migration.", "keywords": [ "indiekit",