From 324f5525b58de75226fb332dcf390d16c7ff19ce Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 30 Jun 2022 15:36:09 +0900 Subject: [PATCH] fix(server): cannot show users --- .../api/common/generate-muted-user-query.ts | 21 +------------------ 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/packages/backend/src/server/api/common/generate-muted-user-query.ts b/packages/backend/src/server/api/common/generate-muted-user-query.ts index e276ff2bd..470ece1a6 100644 --- a/packages/backend/src/server/api/common/generate-muted-user-query.ts +++ b/packages/backend/src/server/api/common/generate-muted-user-query.ts @@ -51,26 +51,7 @@ export function generateMutedUserQueryForUsers(q: SelectQueryBuilder, me: { .select('muting.muteeId') .where('muting.muterId = :muterId', { muterId: me.id }); - const mutingInstanceQuery = UserProfiles.createQueryBuilder('user_profile') - .select('user_profile.mutedInstances') - .where('user_profile.userId = :muterId', { muterId: me.id }); - - q - .andWhere(`user.id NOT IN (${ mutingQuery.getQuery() })`) - // mute instances - .andWhere(new Brackets(qb => { qb - .andWhere('note.userHost IS NULL') - .orWhere(`NOT ((${ mutingInstanceQuery.getQuery() })::jsonb ? note.userHost)`); - })) - .andWhere(new Brackets(qb => { qb - .where('note.replyUserHost IS NULL') - .orWhere(`NOT ((${ mutingInstanceQuery.getQuery() })::jsonb ? note.replyUserHost)`); - })) - .andWhere(new Brackets(qb => { qb - .where('note.renoteUserHost IS NULL') - .orWhere(`NOT ((${ mutingInstanceQuery.getQuery() })::jsonb ? note.renoteUserHost)`); - })); + q.andWhere(`user.id NOT IN (${ mutingQuery.getQuery() })`); q.setParameters(mutingQuery.getParameters()); - q.setParameters(mutingInstanceQuery.getParameters()); }