From 6d58d5ed3b2edcbd1296118201e3f0e2b42f8f52 Mon Sep 17 00:00:00 2001 From: Chloe Kudryavtsev Date: Mon, 10 Oct 2022 04:19:30 -0400 Subject: [PATCH] fixup: muted-renotes review round 1 --- .../src/server/api/common/generated-muted-renote-query.ts | 2 +- .../backend/src/server/api/endpoints/notes/global-timeline.ts | 4 ++-- .../backend/src/server/api/endpoints/notes/hybrid-timeline.ts | 4 ++-- .../backend/src/server/api/endpoints/notes/local-timeline.ts | 4 ++-- packages/backend/src/server/api/endpoints/notes/timeline.ts | 4 ++-- .../backend/src/server/api/endpoints/renote-mute/create.ts | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/backend/src/server/api/common/generated-muted-renote-query.ts b/packages/backend/src/server/api/common/generated-muted-renote-query.ts index 08d6e94a8..70159862a 100644 --- a/packages/backend/src/server/api/common/generated-muted-renote-query.ts +++ b/packages/backend/src/server/api/common/generated-muted-renote-query.ts @@ -2,7 +2,7 @@ import { Brackets, SelectQueryBuilder } from 'typeorm'; import { User } from '@/models/entities/user.js'; import { RenoteMutings } from '@/models/index.js'; -export function generateMutedUserRenotesQueryForNotes(q: SelectQueryBuilder, me: { id: User['id'] }): void { +export function generateMutedRenotesQuery(q: SelectQueryBuilder, me: { id: User['id'] }): void { const mutingQuery = RenoteMutings.createQueryBuilder('renote_muting') .select('renote_muting.muteeId') .where('renote_muting.muterId = :muterId', { muterId: me.id }); diff --git a/packages/backend/src/server/api/endpoints/notes/global-timeline.ts b/packages/backend/src/server/api/endpoints/notes/global-timeline.ts index 2630e94a3..3d32e7c7a 100644 --- a/packages/backend/src/server/api/endpoints/notes/global-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/global-timeline.ts @@ -8,7 +8,7 @@ import { generateMutedUserQuery } from '../../common/generate-muted-user-query.j import { generateRepliesQuery } from '../../common/generate-replies-query.js'; import { generateMutedNoteQuery } from '../../common/generate-muted-note-query.js'; import { generateBlockedUserQuery } from '../../common/generate-block-query.js'; -import { generateMutedUserRenotesQueryForNotes } from '../../common/generated-muted-renote-query.js'; +import { generateMutedRenotesQuery } from '../../common/generated-muted-renote-query.js'; export const meta = { tags: ['notes'], @@ -80,7 +80,7 @@ export default define(meta, paramDef, async (ps, user) => { generateMutedUserQuery(query, user); generateMutedNoteQuery(query, user); generateBlockedUserQuery(query, user); - generateMutedUserRenotesQueryForNotes(query, user); + generateMutedRenotesQuery(query, user); } if (ps.withFiles) { diff --git a/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts b/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts index 0afd0c24a..f2e86915f 100644 --- a/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts @@ -11,7 +11,7 @@ import { generateRepliesQuery } from '../../common/generate-replies-query.js'; import { generateMutedNoteQuery } from '../../common/generate-muted-note-query.js'; import { generateChannelQuery } from '../../common/generate-channel-query.js'; import { generateBlockedUserQuery } from '../../common/generate-block-query.js'; -import { generateMutedUserRenotesQueryForNotes } from '../../common/generated-muted-renote-query.js'; +import { generateMutedRenotesQuery } from '../../common/generated-muted-renote-query.js'; export const meta = { tags: ['notes'], @@ -94,7 +94,7 @@ export default define(meta, paramDef, async (ps, user) => { generateMutedUserQuery(query, user); generateMutedNoteQuery(query, user); generateBlockedUserQuery(query, user); - generateMutedUserRenotesQueryForNotes(query, user); + generateMutedRenotesQuery(query, user); if (ps.includeMyRenotes === false) { query.andWhere(new Brackets(qb => { diff --git a/packages/backend/src/server/api/endpoints/notes/local-timeline.ts b/packages/backend/src/server/api/endpoints/notes/local-timeline.ts index e42832cc5..6a65c028a 100644 --- a/packages/backend/src/server/api/endpoints/notes/local-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/local-timeline.ts @@ -11,7 +11,7 @@ import { generateRepliesQuery } from '../../common/generate-replies-query.js'; import { generateMutedNoteQuery } from '../../common/generate-muted-note-query.js'; import { generateChannelQuery } from '../../common/generate-channel-query.js'; import { generateBlockedUserQuery } from '../../common/generate-block-query.js'; -import { generateMutedUserRenotesQueryForNotes } from '../../common/generated-muted-renote-query.js'; +import { generateMutedRenotesQuery } from '../../common/generated-muted-renote-query.js'; export const meta = { tags: ['notes'], @@ -87,7 +87,7 @@ export default define(meta, paramDef, async (ps, user) => { if (user) generateMutedUserQuery(query, user); if (user) generateMutedNoteQuery(query, user); if (user) generateBlockedUserQuery(query, user); - if (user) generateMutedUserRenotesQueryForNotes(query, user); + if (user) generateMutedRenotesQuery(query, user); if (ps.withFiles) { query.andWhere('note.fileIds != \'{}\''); diff --git a/packages/backend/src/server/api/endpoints/notes/timeline.ts b/packages/backend/src/server/api/endpoints/notes/timeline.ts index 2b843d3c7..d042e555f 100644 --- a/packages/backend/src/server/api/endpoints/notes/timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/timeline.ts @@ -9,7 +9,7 @@ import { generateRepliesQuery } from '../../common/generate-replies-query.js'; import { generateMutedNoteQuery } from '../../common/generate-muted-note-query.js'; import { generateChannelQuery } from '../../common/generate-channel-query.js'; import { generateBlockedUserQuery } from '../../common/generate-block-query.js'; -import { generateMutedUserRenotesQueryForNotes } from '../../common/generated-muted-renote-query.js'; +import { generateMutedRenotesQuery } from '../../common/generated-muted-renote-query.js'; export const meta = { tags: ['notes'], @@ -86,7 +86,7 @@ export default define(meta, paramDef, async (ps, user) => { generateMutedUserQuery(query, user); generateMutedNoteQuery(query, user); generateBlockedUserQuery(query, user); - generateMutedUserRenotesQueryForNotes(query, user); + generateMutedRenotesQuery(query, user); if (ps.includeMyRenotes === false) { query.andWhere(new Brackets(qb => { diff --git a/packages/backend/src/server/api/endpoints/renote-mute/create.ts b/packages/backend/src/server/api/endpoints/renote-mute/create.ts index 9ab2dd1e1..e1db204b7 100644 --- a/packages/backend/src/server/api/endpoints/renote-mute/create.ts +++ b/packages/backend/src/server/api/endpoints/renote-mute/create.ts @@ -46,7 +46,7 @@ export const paramDef = { export default define(meta, paramDef, async (ps, user) => { const muter = user; - // 自分自身 + // Check if the mutee is yourself if (user.id === ps.userId) { throw new ApiError(meta.errors.muteeIsYourself); }