From dcd73b1897c8aa544130667126815cda1cb702e2 Mon Sep 17 00:00:00 2001 From: Ricardo Date: Wed, 25 Mar 2026 22:41:14 +0100 Subject: [PATCH] fix: frontend reply syndication mapping and empty array cleanup - Map platform to syndicator using service.name keys from isOwner API - Add activitypub platform mapping (was completely missing) - Remove empty mp-syndicate-to array for webmention replies (caused permanent no-op entries in syndication queue) --- js/comments.js | 5 +---- js/webmentions.js | 7 +++++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/js/comments.js b/js/comments.js index c32b13e..15def50 100644 --- a/js/comments.js +++ b/js/comments.js @@ -137,14 +137,11 @@ document.addEventListener("alpine:init", () => { }, }; - // Only add syndication target for the matching platform + // Only add syndication target if one exists for the platform if (this.replyingTo.syndicateTo) { micropubBody.properties["mp-syndicate-to"] = [ this.replyingTo.syndicateTo, ]; - } else { - // IndieWeb webmention — no syndication, empty array - micropubBody.properties["mp-syndicate-to"] = []; } const res = await fetch("/micropub", { diff --git a/js/webmentions.js b/js/webmentions.js index 39f57e9..2604412 100644 --- a/js/webmentions.js +++ b/js/webmentions.js @@ -803,9 +803,12 @@ btn.addEventListener('click', function() { var replyUrl = btn.dataset.replyUrl; var platform = btn.dataset.platform || 'webmention'; + // Map detected platform to syndicator by service.name + var targets = ownerStore.syndicationTargets || {}; var syndicateTo = null; - if (platform === 'bluesky') syndicateTo = ownerStore.syndicationTargets.bluesky || null; - if (platform === 'mastodon') syndicateTo = ownerStore.syndicationTargets.mastodon || null; + if (platform === 'bluesky') syndicateTo = targets['Bluesky'] || null; + if (platform === 'mastodon') syndicateTo = targets['Mastodon'] || null; + if (platform === 'activitypub') syndicateTo = targets['ActivityPub (Fediverse)'] || null; // Close any existing reply form closeActiveReplyForm();