fix(backend): filter out notes by suspended users in liked collection

This commit is contained in:
Daiki Mizukami 2024-08-19 23:28:36 +09:00
parent 17da05ca54
commit 8d41e3c8e4
No known key found for this signature in database
GPG key ID: 10478E598B944AA2

View file

@ -400,12 +400,14 @@ export class ActivityPubServerService {
.limit(limit + 1) .limit(limit + 1)
.orderBy('reaction.id', 'DESC') .orderBy('reaction.id', 'DESC')
.innerJoinAndSelect('reaction.note', 'note') .innerJoinAndSelect('reaction.note', 'note')
.leftJoinAndSelect('note.user', 'noteUser')
.andWhere(new Brackets(qb => { .andWhere(new Brackets(qb => {
qb qb
.where('note.visibility = \'public\'') .where('note.visibility = \'public\'')
.orWhere('note.visibility = \'home\''); .orWhere('note.visibility = \'home\'');
})) }))
.andWhere('note.localOnly = FALSE') .andWhere('note.localOnly = FALSE')
.andWhere('noteUser.isSuspended = FALSE')
.getMany(); .getMany();
// 「次のページ」があるかどうか // 「次のページ」があるかどうか