fix(backend): ユーザーのノート取得でDBにfallbackした際にチャンネルノートのみになる

This commit is contained in:
taichanne30 2023-10-17 21:21:36 +09:00
parent 5a3c6575dd
commit b2a133124b
No known key found for this signature in database
GPG Key ID: 1D5EE39F870DC283
1 changed files with 4 additions and 1 deletions

View File

@ -151,7 +151,10 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
.leftJoinAndSelect('renote.user', 'renoteUser');
if (ps.withChannelNotes) {
if (!isSelf) query.andWhere('channel.isSensitive = false');
if (!isSelf) query.andWhere(new Brackets(qb => {
qb.orWhere('note.channelId IS NULL');
qb.orWhere('channel.isSensitive = false');
}));
} else {
query.andWhere('note.channelId IS NULL');
}