refactor: remove duplicate code (#8895)

This commit is contained in:
Johann150 2022-06-27 14:48:10 +02:00 committed by GitHub
parent 0ec266abf7
commit bc3ae901cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 41 additions and 64 deletions

View file

@ -1,8 +1,7 @@
import { isMutedUserRelated } from '@/misc/is-muted-user-related.js';
import Channel from '../channel.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 { isUserRelated } from '@/misc/is-user-related.js';
import { isInstanceMuted } from '@/misc/is-instance-muted.js';
import { Packed } from '@/misc/schema.js';
@ -63,9 +62,9 @@ export default class extends Channel {
}
// 流れてきた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テーブルにレコードがあるかどうかで判定したい(以下の理由により難しそうではある)