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

@ -2,7 +2,7 @@ import { Antenna } from '@/models/entities/antenna.js';
import { Note } from '@/models/entities/note.js';
import { AntennaNotes, Mutings, Notes } from '@/models/index.js';
import { genId } from '@/misc/gen-id.js';
import { isMutedUserRelated } from '@/misc/is-muted-user-related.js';
import { isUserRelated } from '@/misc/is-user-related.js';
import { publishAntennaStream, publishMainStream } from '@/services/stream.js';
import { User } from '@/models/entities/user.js';
@ -39,7 +39,7 @@ export async function addNoteToAntenna(antenna: Antenna, note: Note, noteUser: {
_note.renote = await Notes.findOneByOrFail({ id: note.renoteId });
}
if (isMutedUserRelated(_note, new Set<string>(mutings.map(x => x.muteeId)))) {
if (isUserRelated(_note, new Set<string>(mutings.map(x => x.muteeId)))) {
return;
}