mirror of
https://github.com/svemagie/blog-eleventy-indiekit.git
synced 2026-05-14 22:48:50 +02:00
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)
This commit is contained in:
+1
-4
@@ -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", {
|
||||
|
||||
+5
-2
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user