hippofish/src/misc/is-muted-user-related.ts
Ehsan Javadynia ff67fb337e
using set instead of array for search (#7126)
* Resolve #6905

* Resolve #6905

* Resolve #6905
2021-01-30 11:09:46 +09:00

15 lines
330 B
TypeScript

export function isMutedUserRelated(note: any, mutedUserIds: Set<string>): boolean {
if (mutedUserIds.has(note.userId)) {
return true;
}
if (note.reply != null && mutedUserIds.has(note.reply.userId)) {
return true;
}
if (note.renote != null && mutedUserIds.has(note.renote.userId)) {
return true;
}
return false;
}