refactor: remove duplicate code (#8895)
This commit is contained in:
parent
0ec266abf7
commit
bc3ae901cc
12 changed files with 41 additions and 64 deletions
|
@ -1,10 +1,9 @@
|
|||
import { isMutedUserRelated } from '@/misc/is-muted-user-related.js';
|
||||
import Channel from '../channel.js';
|
||||
import { fetchMeta } from '@/misc/fetch-meta.js';
|
||||
import { Notes } from '@/models/index.js';
|
||||
import { checkWordMute } from '@/misc/check-word-mute.js';
|
||||
import { isBlockerUserRelated } from '@/misc/is-blocker-user-related.js';
|
||||
import { isInstanceMuted } from '@/misc/is-instance-muted.js';
|
||||
import { isUserRelated } from '@/misc/is-user-related.js';
|
||||
import { Packed } from '@/misc/schema.js';
|
||||
|
||||
export default class extends Channel {
|
||||
|
@ -55,9 +54,9 @@ export default class extends Channel {
|
|||
if (isInstanceMuted(note, new Set<string>(this.userProfile?.mutedInstances ?? []))) return;
|
||||
|
||||
// 流れてきたNoteがミュートしているユーザーが関わるものだったら無視する
|
||||
if (isMutedUserRelated(note, this.muting)) return;
|
||||
if (isUserRelated(note, this.muting)) return;
|
||||
// 流れてきたNoteがブロックされているユーザーが関わるものだったら無視する
|
||||
if (isBlockerUserRelated(note, this.blocking)) return;
|
||||
if (isUserRelated(note, this.blocking)) return;
|
||||
|
||||
// 流れてきたNoteがミュートすべきNoteだったら無視する
|
||||
// TODO: 将来的には、単にMutedNoteテーブルにレコードがあるかどうかで判定したい(以下の理由により難しそうではある)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue