|
|
|
@@ -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 });
|
|
|
|
|