fix(webmentions): filter out self-interactions from own Bluesky account
Exclude webmentions from svemagie.bsky.social / did:plc:g4utqyolpyb5zpwwodmm3hht at both build-time (eleventy filter) and client-side (webmentions.js). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -878,7 +878,17 @@ export default function (eleventyConfig) {
|
||||
authorActions.add(key);
|
||||
deduped.push(wm);
|
||||
}
|
||||
return deduped;
|
||||
|
||||
// Filter out self-interactions from own Bluesky account
|
||||
const isSelfBsky = (wm) => {
|
||||
const u = (wm.url || "").toLowerCase();
|
||||
const a = (wm.author?.url || "").toLowerCase();
|
||||
return u.includes("bsky.app/profile/svemagie.bsky.social") ||
|
||||
u.includes("did:plc:g4utqyolpyb5zpwwodmm3hht") ||
|
||||
a.includes("bsky.app/profile/svemagie.bsky.social") ||
|
||||
a.includes("did:plc:g4utqyolpyb5zpwwodmm3hht");
|
||||
};
|
||||
return deduped.filter((wm) => !isSelfBsky(wm));
|
||||
});
|
||||
|
||||
eleventyConfig.addFilter("webmentionsByType", function (mentions, type) {
|
||||
|
||||
@@ -52,12 +52,21 @@
|
||||
}
|
||||
}
|
||||
|
||||
function isSelfBsky(wm) {
|
||||
var u = (wm.url || '').toLowerCase();
|
||||
var a = ((wm.author && wm.author.url) || '').toLowerCase();
|
||||
return u.includes('bsky.app/profile/svemagie.bsky.social') ||
|
||||
u.includes('did:plc:g4utqyolpyb5zpwwodmm3hht') ||
|
||||
a.includes('bsky.app/profile/svemagie.bsky.social') ||
|
||||
a.includes('did:plc:g4utqyolpyb5zpwwodmm3hht');
|
||||
}
|
||||
|
||||
function processWebmentions(allChildren) {
|
||||
if (!allChildren || !allChildren.length) return;
|
||||
|
||||
// Separate owner replies (threaded under parent) from regular interactions
|
||||
var ownerReplies = allChildren.filter(function(wm) { return wm.is_owner && wm.parent_url; });
|
||||
var regularItems = allChildren.filter(function(wm) { return !wm.is_owner; });
|
||||
var regularItems = allChildren.filter(function(wm) { return !wm.is_owner && !isSelfBsky(wm); });
|
||||
|
||||
let mentionsToShow;
|
||||
if (hasBuildTimeSection) {
|
||||
|
||||
Reference in New Issue
Block a user