when fetching notes from Redis, we need to re-check the criteria from
the API request, because `userTimelineWithFiles`,
`userTimelineWithReplies`, `userTimelineWithChannel` all get merged
together, so `noteIds` may well contain notes without attachments…
This commit is contained in:
dakkar 2023-10-31 15:18:37 +00:00
parent 9de6e0ac48
commit 111863b396

View File

@ -123,6 +123,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
}
}
if (ps.withFiles && !note.fileIds) return false;
if (note.channel?.isSensitive && !isSelf) return false;
if (note.visibility === 'specified' && (!me || (me.id !== note.userId && !note.visibleUserIds.some(v => v === me.id)))) return false;
if (note.visibility === 'followers' && !isFollowing && !isSelf) return false;