mirror of
https://github.com/paricafe/misskey.git
synced 2024-12-04 17:26:43 -06:00
c68d87538a
* ユーザリストTL系の各種動作を修正・統一 * fix * fix CHANGELOG.md * テスト追加
21 lines
718 B
TypeScript
21 lines
718 B
TypeScript
/*
|
|
* SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
* 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;
|
|
}
|