fix?
Some checks failed
Lint / pnpm_install (pull_request) Successful in 32s
Test (production install and build) / production (22.x) (pull_request) Successful in 1m9s
Test (frontend) / vitest (22.x) (pull_request) Successful in 1m24s
Test (backend) / validate-api-json (22.x) (pull_request) Successful in 1m34s
Lint / lint (backend) (pull_request) Successful in 1m11s
Lint / lint (misskey-js) (pull_request) Successful in 36s
Lint / lint (sw) (pull_request) Successful in 33s
Test (backend) / unit (22.x) (pull_request) Successful in 2m32s
Lint / lint (frontend) (pull_request) Successful in 7m20s
Lint / typecheck (misskey-js) (pull_request) Successful in 32s
Lint / typecheck (backend) (pull_request) Successful in 1m25s
Test (backend) / e2e (22.x) (pull_request) Failing after 6m30s

This commit is contained in:
Leah 2025-02-08 14:15:34 +01:00
parent b597eb4c04
commit fbb7be529c

View file

@ -5,7 +5,9 @@
//Cherrypicked mute fix from foundkey: https://akkoma.dev/FoundKeyGang/FoundKey/pulls/32
export function isUserRelated(note: any, ids: Set<string>, ignoreAuthor = false): boolean {
if (ids.has(note.userId) && !ignoreAuthor) return true; // note author is muted (unless ignoreAuthor is false)
if (ignoreAuthor) return false;
if (ids.has(note.userId)) return true; // note author is muted
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