@rmdes/indiekit-endpoint-conversations 2.4.2 → 2.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -260,6 +260,13 @@ async function apiMentions(request, response) {
260
260
  const inReplyTo = post.properties?.["in-reply-to"];
261
261
  if (!inReplyTo || typeof inReplyTo !== "string") continue;
262
262
 
263
+ // Include syndication URLs so the frontend can match the Bridgy
264
+ // echo (webmention.io returns the syndicated URL as the item's url)
265
+ const syndication = post.properties?.syndication;
266
+ const synUrls = Array.isArray(syndication)
267
+ ? syndication
268
+ : syndication ? [syndication] : [];
269
+
263
270
  children.push({
264
271
  type: "entry",
265
272
  "wm-id": `owner-reply-${post._id}`,
@@ -280,15 +287,42 @@ async function apiMentions(request, response) {
280
287
  },
281
288
  is_owner: true,
282
289
  parent_url: inReplyTo,
290
+ syndication: synUrls,
283
291
  });
284
292
  }
285
293
  }
286
294
 
295
+ // Build owner identity URLs so the frontend can detect self-authored
296
+ // items from any source (webmention.io, Bridgy, etc.). The owner may
297
+ // syndicate replies via Bluesky, self-hosted AP, or external Mastodon —
298
+ // each produces a different author URL. All are derived from env vars
299
+ // so any deployment can use this without hardcoding.
300
+ const ownerUrls = [];
301
+ const siteUrlClean = (application.publication?.me || application.url || "").replace(/\/$/, "");
302
+ if (siteUrlClean) {
303
+ ownerUrls.push(siteUrlClean);
304
+ // Self-hosted ActivityPub actor
305
+ const apHandle = process.env.ACTIVITYPUB_HANDLE;
306
+ if (apHandle) {
307
+ ownerUrls.push(siteUrlClean + "/activitypub/users/" + apHandle);
308
+ }
309
+ }
310
+ const bskyHandle = (process.env.BLUESKY_IDENTIFIER || process.env.BLUESKY_HANDLE || "").replace(/^@+/, "").toLowerCase();
311
+ if (bskyHandle) {
312
+ ownerUrls.push("https://bsky.app/profile/" + bskyHandle);
313
+ }
314
+ const mastodonInstance = (process.env.MASTODON_INSTANCE || "").replace(/\/$/, "");
315
+ const mastodonUser = process.env.MASTODON_USER || "";
316
+ if (mastodonInstance && mastodonUser) {
317
+ ownerUrls.push(mastodonInstance + "/@" + mastodonUser);
318
+ }
319
+
287
320
  response.set("Cache-Control", "public, max-age=60");
288
321
  response.json({
289
322
  type: "feed",
290
323
  name: "Conversations",
291
324
  children,
325
+ owner_urls: ownerUrls,
292
326
  });
293
327
  } catch (error) {
294
328
  console.error("[Conversations] API error:", error.message);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rmdes/indiekit-endpoint-conversations",
3
- "version": "2.4.2",
3
+ "version": "2.4.3",
4
4
  "description": "Conversation aggregation endpoint for Indiekit. Backend enrichment service that polls Mastodon/Bluesky notifications and serves JF2-compatible data for the interactions page.",
5
5
  "keywords": [
6
6
  "indiekit",