mirror of
https://github.com/paricafe/misskey.git
synced 2024-12-02 05:56:44 -06:00
16 lines
542 B
TypeScript
16 lines
542 B
TypeScript
|
import { Packed } from "./schema";
|
||
|
|
||
|
export function isInstanceMuted(note: Packed<'Note'>, mutedInstances: Set<string>): boolean {
|
||
|
if (mutedInstances.has(note?.user?.host ?? '')) return true;
|
||
|
if (mutedInstances.has(note?.reply?.user?.host ?? '')) return true;
|
||
|
if (mutedInstances.has(note?.renote?.user?.host ?? '')) return true;
|
||
|
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
export function isUserFromMutedInstance(notif: Packed<'Notification'>, mutedInstances: Set<string>): boolean {
|
||
|
if (mutedInstances.has(notif?.user?.host ?? '')) return true;
|
||
|
|
||
|
return false;
|
||
|
}
|