From c0583e5d5c6f74f96f173d38e6f675508a54639a Mon Sep 17 00:00:00 2001 From: Hazel K Date: Wed, 2 Oct 2024 00:54:35 -0400 Subject: [PATCH] don't leak boost / quote / reply contents when CW is in effect --- packages/backend/src/misc/get-note-summary.ts | 4 ++-- packages/frontend/src/scripts/get-note-summary.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/backend/src/misc/get-note-summary.ts b/packages/backend/src/misc/get-note-summary.ts index 2652294103..60dddee9a2 100644 --- a/packages/backend/src/misc/get-note-summary.ts +++ b/packages/backend/src/misc/get-note-summary.ts @@ -39,7 +39,7 @@ export const getNoteSummary = (note: Packed<'Note'>): string => { // 返信のとき if (note.replyId) { - if (note.reply) { + if (note.reply && !note.cw) { summary += `\n\nRE: ${getNoteSummary(note.reply)}`; } else { summary += '\n\nRE: ...'; @@ -48,7 +48,7 @@ export const getNoteSummary = (note: Packed<'Note'>): string => { // Renoteのとき if (note.renoteId) { - if (note.renote) { + if (note.renote && !note.cw) { summary += `\n\nRN: ${getNoteSummary(note.renote)}`; } else { summary += '\n\nRN: ...'; diff --git a/packages/frontend/src/scripts/get-note-summary.ts b/packages/frontend/src/scripts/get-note-summary.ts index 6c70ced67f..58d486bf9b 100644 --- a/packages/frontend/src/scripts/get-note-summary.ts +++ b/packages/frontend/src/scripts/get-note-summary.ts @@ -44,7 +44,7 @@ export const getNoteSummary = (note?: Misskey.entities.Note | null): string => { // 返信のとき if (note.replyId) { - if (note.reply) { + if (note.reply && !note.cw) { summary += `\n\nRE: ${getNoteSummary(note.reply)}`; } else { summary += '\n\nRE: ...'; @@ -53,7 +53,7 @@ export const getNoteSummary = (note?: Misskey.entities.Note | null): string => { // Renoteのとき if (note.renoteId) { - if (note.renote) { + if (note.renote && !note.cw) { summary += `\n\nRN: ${getNoteSummary(note.renote)}`; } else { summary += '\n\nRN: ...';