Skip to content

Commit

Permalink
try to fix transfem-org#118
Browse files Browse the repository at this point in the history
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…
  • Loading branch information
dakkar committed Oct 31, 2023
1 parent 9de6e0a commit 111863b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/backend/src/server/api/endpoints/users/notes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 111863b

Please sign in to comment.