mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-21 04:35:09 +01:00
c1514ce91d
Fix #13290
21 lines
707 B
TypeScript
21 lines
707 B
TypeScript
/*
|
|
* SPDX-FileCopyrightText: syuilo and misskey-project
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
import { MiNote } from '@/models/Note.js';
|
|
import type { Packed } from './json-schema.js';
|
|
|
|
export function isInstanceMuted(note: Packed<'Note'> | MiNote, 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;
|
|
}
|