feat: filter self-Bluesky interactions from sidebar webmentions widget

Apply the same isSelfBsky() filter already used in post-interactions.njk
to the sidebar webmentions widget, hiding own Bluesky account entries
from both the conversations and webmentions merge loops.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
svemagie
2026-03-18 08:04:28 +01:00
parent 8ef24cd1b4
commit 2a2d4f68ac
@@ -135,14 +135,26 @@ function webmentionsWidget() {
const wmData = wmRes?.ok ? await wmRes.json() : { children: [] };
const convData = convRes?.ok ? await convRes.json() : { children: [] };
// Skip self-interactions from own Bluesky account
const isSelfBsky = (item) => {
const u = (item.url || '').toLowerCase();
const a = ((item.author && item.author.url) || '').toLowerCase();
return u.includes('did:plc:g4utqyolpyb5zpwwodmm3hht') ||
u.includes('bsky.app/profile/svemagie.bsky.social') ||
a.includes('did:plc:g4utqyolpyb5zpwwodmm3hht') ||
a.includes('bsky.app/profile/svemagie.bsky.social');
};
// Merge: conversations items first (richer metadata), then webmentions
const seen = new Set();
const merged = [];
for (const item of (convData.children || [])) {
if (isSelfBsky(item)) continue;
const key = item['wm-id'] || item.url;
if (key && !seen.has(key)) { seen.add(key); merged.push(item); }
}
for (const item of (wmData.children || [])) {
if (isSelfBsky(item)) continue;
const key = item['wm-id'];
if (!key || seen.has(key)) continue;
if (item.url && seen.has(item.url)) continue;