diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2021-10-19 20:25:47 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2021-10-19 20:25:47 +0900 |
| commit | a96e5277db7f638d6601fb1d714d95d6d357ca35 (patch) | |
| tree | 2c6eee4e38ee7fb7b4bfc20e7bb1a6998f336dcb /src | |
| parent | リアクション一覧の公開をオプトインに (diff) | |
| download | sharkey-a96e5277db7f638d6601fb1d714d95d6d357ca35.tar.gz sharkey-a96e5277db7f638d6601fb1d714d95d6d357ca35.tar.bz2 sharkey-a96e5277db7f638d6601fb1d714d95d6d357ca35.zip | |
fix(api): アプリケーション通知が取得できない問題を修正
Fix #6702
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/api/endpoints/i/notifications.ts | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/server/api/endpoints/i/notifications.ts b/src/server/api/endpoints/i/notifications.ts index fcabbbc3dd..56668d03b7 100644 --- a/src/server/api/endpoints/i/notifications.ts +++ b/src/server/api/endpoints/i/notifications.ts @@ -6,6 +6,7 @@ import { makePaginationQuery } from '../../common/make-pagination-query'; import { Notifications, Followings, Mutings, Users } from '@/models/index'; import { notificationTypes } from '@/types'; import read from '@/services/note/read'; +import { Brackets } from 'typeorm'; export const meta = { tags: ['account', 'notifications'], @@ -94,10 +95,16 @@ export default define(meta, async (ps, user) => { .leftJoinAndSelect('reply.user', 'replyUser') .leftJoinAndSelect('renote.user', 'renoteUser'); - query.andWhere(`notification.notifierId NOT IN (${ mutingQuery.getQuery() })`); + query.andWhere(new Brackets(qb => { qb + .where(`notification.notifierId NOT IN (${ mutingQuery.getQuery() })`) + .orWhere('notification.notifierId IS NULL'); + })); query.setParameters(mutingQuery.getParameters()); - query.andWhere(`notification.notifierId NOT IN (${ suspendedQuery.getQuery() })`); + query.andWhere(new Brackets(qb => { qb + .where(`notification.notifierId NOT IN (${ suspendedQuery.getQuery() })`) + .orWhere('notification.notifierId IS NULL'); + })); if (ps.following) { query.andWhere(`((notification.notifierId IN (${ followingQuery.getQuery() })) OR (notification.notifierId = :meId))`, { meId: user.id }); |