fix withRenotes check in bubble-timeline.ts

This commit is contained in:
Hazelnoot 2025-06-01 14:42:06 -04:00
parent 008df49d49
commit baf785bdc1

View file

@ -74,11 +74,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
throw new ApiError(meta.errors.btlDisabled); throw new ApiError(meta.errors.btlDisabled);
} }
const [ const followings = me ? await this.cacheService.userFollowingsCache.fetch(me.id) : undefined;
followings,
] = me ? await Promise.all([
this.cacheService.userFollowingsCache.fetch(me.id),
]) : [undefined];
//#region Construct query //#region Construct query
const query = this.queryService.makePaginationQuery(this.notesRepository.createQueryBuilder('note'), const query = this.queryService.makePaginationQuery(this.notesRepository.createQueryBuilder('note'),
@ -86,7 +82,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
.andWhere('note.visibility = \'public\'') .andWhere('note.visibility = \'public\'')
.andWhere('note.channelId IS NULL') .andWhere('note.channelId IS NULL')
.andWhere('note.userHost IS NULL') .andWhere('note.userHost IS NULL')
.andWhere('userInstance.isBubbled = true') // This comes from generateVisibilityQuery below .andWhere('userInstance.isBubbled = true') // This comes from generateBlockedHostQueryForNote below
.innerJoinAndSelect('note.user', 'user') .innerJoinAndSelect('note.user', 'user')
.leftJoinAndSelect('note.reply', 'reply') .leftJoinAndSelect('note.reply', 'reply')
.leftJoinAndSelect('note.renote', 'renote') .leftJoinAndSelect('note.renote', 'renote')
@ -105,14 +101,14 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
if (!ps.withBots) query.andWhere('user.isBot = FALSE'); if (!ps.withBots) query.andWhere('user.isBot = FALSE');
if (ps.withRenotes === false) { if (!ps.withRenotes) {
query.andWhere(new Brackets(qb => { query.andWhere(new Brackets(qb => qb
qb.where('note.renoteId IS NULL'); .orWhere('note.renoteId IS NULL')
qb.orWhere(new Brackets(qb => { .orWhere('note.text IS NOT NULL')
qb.where('note.text IS NOT NULL'); .orWhere('note.cw IS NOT NULL')
qb.orWhere('note.fileIds != \'{}\''); .orWhere('note.replyId IS NOT NULL')
})); .orWhere('note.hasPoll = false')
})); .orWhere('note.fileIds != \'{}\'')));
} }
//#endregion //#endregion