mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2024-12-16 14:21:57 +01:00
15 lines
543 B
TypeScript
15 lines
543 B
TypeScript
import type { Packed } from './schema.js';
|
|
|
|
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;
|
|
}
|