fix(widgets): use full Bluesky self-filter logic for sidebar webmentions (did:plc + bsky.app/profile)
This commit is contained in:
@@ -150,15 +150,17 @@ function webmentionsWidget() {
|
|||||||
merged.push(item);
|
merged.push(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Filter out webmentions from own Bluesky handle
|
// Use same self-Bluesky filter as post-interactions/interactions.njk
|
||||||
const filtered = merged.filter((item) => {
|
const isSelfBsky = (item) => {
|
||||||
const authorUrl = item.author && item.author.url ? item.author.url : '';
|
const u = (item.url || '').toLowerCase();
|
||||||
// Bluesky profile URLs can be at:// or https://bsky.app/profile/ or handle
|
const a = ((item.author && item.author.url) || '').toLowerCase();
|
||||||
return !(
|
return u.includes('did:plc:g4utqyolpyb5zpwwodmm3hht') ||
|
||||||
authorUrl.includes('svemagie.bsky.social') ||
|
u.includes('bsky.app/profile/svemagie.bsky.social') ||
|
||||||
(item.author && item.author.name && item.author.name.toLowerCase() === 'svemagie.bsky.social')
|
a.includes('did:plc:g4utqyolpyb5zpwwodmm3hht') ||
|
||||||
);
|
a.includes('bsky.app/profile/svemagie.bsky.social');
|
||||||
});
|
};
|
||||||
|
|
||||||
|
const filtered = merged.filter((item) => !isSelfBsky(item));
|
||||||
|
|
||||||
this.mentions = filtered.sort((a, b) => {
|
this.mentions = filtered.sort((a, b) => {
|
||||||
return new Date(b.published || b['wm-received'] || 0) - new Date(a.published || a['wm-received'] || 0);
|
return new Date(b.published || b['wm-received'] || 0) - new Date(a.published || a['wm-received'] || 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user