From b597eb4c04040371ebdf15c09ed3bde513430d3b Mon Sep 17 00:00:00 2001 From: Leah Date: Sat, 8 Feb 2025 13:01:15 +0100 Subject: [PATCH] re-add ignoreAuthor --- packages/backend/src/misc/is-user-related.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/misc/is-user-related.ts b/packages/backend/src/misc/is-user-related.ts index 4fcc18658..0c3db94da 100644 --- a/packages/backend/src/misc/is-user-related.ts +++ b/packages/backend/src/misc/is-user-related.ts @@ -4,8 +4,8 @@ */ //Cherrypicked mute fix from foundkey: https://akkoma.dev/FoundKeyGang/FoundKey/pulls/32 -export function isUserRelated(note: any, ids: Set): boolean { - if (ids.has(note.userId)) return true; // note author is muted +export function isUserRelated(note: any, ids: Set, ignoreAuthor = false): boolean { + if (ids.has(note.userId) && !ignoreAuthor) return true; // note author is muted (unless ignoreAuthor is false) if (note.mentions && note.mentions.some((user: string) => ids.has(user))) return true; // any of mentioned users are muted if (note.reply && isUserRelated(note.reply, ids)) return true; // also check reply target if (note.renote && isUserRelated(note.renote, ids)) return true; // also check renote target