2022-07-26 12:12:49 +00:00
|
|
|
export function isUserRelated(note: any, ids: Set<string>): boolean {
|
2022-07-27 06:12:15 +00:00
|
|
|
if (ids.has(note.userId)) return true; // note author is muted
|
2023-01-16 19:19:20 +00:00
|
|
|
if (note.mentions?.some((user: string) => ids.has(user))) return true; // any of mentioned users are muted
|
2023-01-13 04:40:33 +00:00
|
|
|
if (note.reply && isUserRelated(note.reply, ids)) return true; // also check reply target
|
2022-07-27 06:12:15 +00:00
|
|
|
if (note.renote && isUserRelated(note.renote, ids)) return true; // also check renote target
|
2022-06-27 12:48:10 +00:00
|
|
|
return false;
|
|
|
|
}
|