diff --git a/lib/inbox-listeners.js b/lib/inbox-listeners.js index b974673..e3e6bc0 100644 --- a/lib/inbox-listeners.js +++ b/lib/inbox-listeners.js @@ -253,17 +253,20 @@ export function registerInboxListeners(inboxChain, options) { actorObj?.preferredUsername?.toString() || actorUrl; + // Extract actor info (including avatar) before logging so we can store it + const actorInfo = await extractActorInfo(actorObj, { documentLoader: authLoader }); + await logActivity(collections, storeRawActivities, { direction: "inbound", type: "Like", actorUrl, actorName, + actorAvatar: actorInfo.photo || "", objectUrl: objectId, summary: `${actorName} liked ${objectId}`, }); // Store notification - const actorInfo = await extractActorInfo(actorObj, { documentLoader: authLoader }); await addNotification(collections, { uid: like.id?.href || `like:${actorUrl}:${objectId}`, type: "like", @@ -301,18 +304,21 @@ export function registerInboxListeners(inboxChain, options) { actorObj?.preferredUsername?.toString() || actorUrl; + // Extract actor info (including avatar) before logging so we can store it + const actorInfo = await extractActorInfo(actorObj, { documentLoader: authLoader }); + // Log the boost activity await logActivity(collections, storeRawActivities, { direction: "inbound", type: "Announce", actorUrl, actorName, + actorAvatar: actorInfo.photo || "", objectUrl: objectId, summary: `${actorName} boosted ${objectId}`, }); // Create notification - const actorInfo = await extractActorInfo(actorObj, { documentLoader: authLoader }); await addNotification(collections, { uid: announce.id?.href || `${actorUrl}#boost-${objectId}`, type: "boost", @@ -392,11 +398,16 @@ export function registerInboxListeners(inboxChain, options) { const pubUrl = collections._publicationUrl; if (inReplyTo) { const content = object.content?.toString() || ""; + + // Extract actor info (including avatar) before logging so we can store it + const actorInfo = await extractActorInfo(actorObj, { documentLoader: authLoader }); + await logActivity(collections, storeRawActivities, { direction: "inbound", type: "Reply", actorUrl, actorName, + actorAvatar: actorInfo.photo || "", objectUrl: object.id?.href || "", targetUrl: inReplyTo, content, @@ -405,7 +416,6 @@ export function registerInboxListeners(inboxChain, options) { // Create notification if reply is to one of OUR posts if (pubUrl && inReplyTo.startsWith(pubUrl)) { - const actorInfo = await extractActorInfo(actorObj, { documentLoader: authLoader }); const rawHtml = object.content?.toString() || ""; const contentHtml = sanitizeContent(rawHtml); const contentText = rawHtml.replace(/<[^>]*>/g, "").substring(0, 200); diff --git a/package.json b/package.json index 07dbc1a..2efbe70 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rmdes/indiekit-endpoint-activitypub", - "version": "2.0.26", + "version": "2.0.27", "description": "ActivityPub federation endpoint for Indiekit via Fedify. Adds full fediverse support: actor, inbox, outbox, followers, following, syndication, and Mastodon migration.", "keywords": [ "indiekit",