This commit is contained in:
ThatOneCalculator 2022-07-28 22:42:40 -07:00
parent 73ac045aa8
commit 664ea1dcf4
2 changed files with 6 additions and 1 deletions

View file

@ -65,10 +65,12 @@ export default define(meta, paramDef, async (ps, user) => {
} }
} }
// AND (note.userHost = ANY(meta.recommendedInstances))')
//#region Construct query //#region Construct query
const query = makePaginationQuery(Notes.createQueryBuilder('note'), const query = makePaginationQuery(Notes.createQueryBuilder('note'),
ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate) ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere('(note.visibility = \'public\' AND (note.userHost = ANY(meta.recommendedInstances))') .andWhere('(note.visibility = \'public\'')
.innerJoinAndSelect('note.user', 'user') .innerJoinAndSelect('note.user', 'user')
.leftJoinAndSelect('user.avatar', 'avatar') .leftJoinAndSelect('user.avatar', 'avatar')
.leftJoinAndSelect('user.banner', 'banner') .leftJoinAndSelect('user.banner', 'banner')

View file

@ -26,6 +26,9 @@ export default class extends Channel {
private async onNote(note: Packed<'Note'>) { private async onNote(note: Packed<'Note'>) {
const meta = await fetchMeta(); const meta = await fetchMeta();
console.log(meta.disableRecommendedTimeline);
console.log(meta.recommendedInstances);
console.log(note.user.host);
if (note.user.host !== null && !meta.recommendedInstances.includes(note.user.host)) return; if (note.user.host !== null && !meta.recommendedInstances.includes(note.user.host)) return;
if (note.visibility !== 'public') return; if (note.visibility !== 'public') return;
if (note.channelId != null && !this.followingChannels.has(note.channelId)) return; if (note.channelId != null && !this.followingChannels.has(note.channelId)) return;