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