2022-07-26 14:12:49 +02:00
|
|
|
export function isUserRelated(note: any, ids: Set<string>): boolean {
|
2022-07-27 08:12:15 +02:00
|
|
|
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
|
2022-06-27 14:48:10 +02:00
|
|
|
return false;
|
|
|
|
}
|