From 111863b396a01c53860c37f6a419937ce1bbfa63 Mon Sep 17 00:00:00 2001 From: dakkar Date: Tue, 31 Oct 2023 15:18:37 +0000 Subject: [PATCH] try to fix #118 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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… --- packages/backend/src/server/api/endpoints/users/notes.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/backend/src/server/api/endpoints/users/notes.ts b/packages/backend/src/server/api/endpoints/users/notes.ts index 343d320f6..9e87d9a23 100644 --- a/packages/backend/src/server/api/endpoints/users/notes.ts +++ b/packages/backend/src/server/api/endpoints/users/notes.ts @@ -123,6 +123,8 @@ export default class extends Endpoint { // 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;