Compare commits

...

2 Commits

Author SHA1 Message Date
Sayamame-beans 4784f99289
Merge b8926866f7 into 752606fe88 2024-11-21 13:17:54 +00:00
Sayamame-beans b8926866f7 fix(backend): lack of muting empty check 2024-11-21 13:17:43 +00:00
1 changed files with 2 additions and 1 deletions

View File

@ -127,7 +127,7 @@ export class QueryService {
} }
@bindThis @bindThis
public generateMutedUserQuery(q: SelectQueryBuilder<any>, me: { id: MiUser['id'] }, exclude?: { id: MiUser['id'] }, checkMentions: boolean = true): void { public generateMutedUserQuery(q: SelectQueryBuilder<any>, me: { id: MiUser['id'] }, exclude?: { id: MiUser['id'] }, checkMentions = true): void {
const mutingQuery = this.mutingsRepository.createQueryBuilder('muting') const mutingQuery = this.mutingsRepository.createQueryBuilder('muting')
.select('muting.muteeId') .select('muting.muteeId')
.where('muting.muterId = :muterId', { muterId: me.id }); .where('muting.muterId = :muterId', { muterId: me.id });
@ -182,6 +182,7 @@ export class QueryService {
q.andWhere(new Brackets(qb => { q.andWhere(new Brackets(qb => {
qb qb
.where('note.mentions IS NULL') .where('note.mentions IS NULL')
.orWhere(`NOT EXISTS (${ mutingQuery.getQuery() })`)
.orWhere(`NOT (note.mentions && (${ mutingArrayQuery.getQuery() }))`); .orWhere(`NOT (note.mentions && (${ mutingArrayQuery.getQuery() }))`);
})); }));
} }