diff --git a/packages/backend/src/core/NoteCreateService.ts b/packages/backend/src/core/NoteCreateService.ts index b57e8853c..d07e3fdf9 100644 --- a/packages/backend/src/core/NoteCreateService.ts +++ b/packages/backend/src/core/NoteCreateService.ts @@ -791,7 +791,7 @@ export class NoteCreateService implements OnApplicationShutdown { private isQuote(note: Option): note is Option & { renote: MiNote } & ( { text: string } | { cw: string } | { reply: MiNote } | { poll: IPoll } | { files: MiDriveFile[] } ) { - // NOTE: SYNC WITH misc/is-quote.ts + // NOTE: SYNC WITH misc/is-renote.ts return note.renote != null && ( note.text != null || note.reply != null || diff --git a/packages/backend/src/misc/is-renote.ts b/packages/backend/src/misc/is-renote.ts index 48f821806..9a4a4d79a 100644 --- a/packages/backend/src/misc/is-renote.ts +++ b/packages/backend/src/misc/is-renote.ts @@ -29,11 +29,13 @@ export function isRenote(note: MiNote): note is Renote { export function isQuote(note: Renote): note is Quote { // NOTE: SYNC WITH NoteCreateService.isQuote - return note.text != null || + return note.renoteId != null && ( + note.text != null || note.cw != null || note.replyId != null || note.hasPoll || - note.fileIds.length > 0; + note.fileIds.length > 0 + ); } type PackedRenote = @@ -59,9 +61,11 @@ export function isRenotePacked(note: Packed<'Note'>): note is PackedRenote { } export function isQuotePacked(note: PackedRenote): note is PackedQuote { - return note.text != null || + return note.renoteId != null && ( + note.text != null || note.cw != null || note.replyId != null || note.poll != null || - (note.fileIds != null && note.fileIds.length > 0); + (note.fileIds != null && note.fileIds.length > 0) + ); } diff --git a/packages/backend/src/server/api/stream/channels/global-timeline.ts b/packages/backend/src/server/api/stream/channels/global-timeline.ts index c3840e88b..fee5972e8 100644 --- a/packages/backend/src/server/api/stream/channels/global-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/global-timeline.ts @@ -67,7 +67,7 @@ class GlobalTimelineChannel extends Channel { } // 純粋なリノート(引用リノートでないリノート)の場合 - if (isRenotePacked(note) && !isQuotePacked(note) && note.renote) { + if (note.renote && isRenotePacked(note) && !isQuotePacked(note)) { if (!this.withRenotes) return; if (note.renote.reply) { const reply = note.renote.reply; diff --git a/packages/backend/src/server/api/stream/channels/home-timeline.ts b/packages/backend/src/server/api/stream/channels/home-timeline.ts index 9c2b60fd6..68822aa5d 100644 --- a/packages/backend/src/server/api/stream/channels/home-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/home-timeline.ts @@ -71,7 +71,7 @@ class HomeTimelineChannel extends Channel { } // 純粋なリノート(引用リノートでないリノート)の場合 - if (isRenotePacked(note) && !isQuotePacked(note) && note.renote) { + if (note.renote && isRenotePacked(note) && !isQuotePacked(note)) { if (!this.withRenotes) return; if (note.renote.reply) { const reply = note.renote.reply; diff --git a/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts b/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts index 1a5c16889..39b7b8b64 100644 --- a/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts @@ -85,7 +85,7 @@ class HybridTimelineChannel extends Channel { } // 純粋なリノート(引用リノートでないリノート)の場合 - if (isRenotePacked(note) && !isQuotePacked(note) && note.renote) { + if (note.renote && isRenotePacked(note) && !isQuotePacked(note)) { if (!this.withRenotes) return; if (note.renote.reply) { const reply = note.renote.reply; diff --git a/packages/backend/src/server/api/stream/channels/local-timeline.ts b/packages/backend/src/server/api/stream/channels/local-timeline.ts index 0a7f0d258..c191be84e 100644 --- a/packages/backend/src/server/api/stream/channels/local-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/local-timeline.ts @@ -70,7 +70,7 @@ class LocalTimelineChannel extends Channel { } // 純粋なリノート(引用リノートでないリノート)の場合 - if (isRenotePacked(note) && !isQuotePacked(note) && note.renote) { + if (note.renote && isRenotePacked(note) && !isQuotePacked(note)) { if (!this.withRenotes) return; if (note.renote.reply) { const reply = note.renote.reply; diff --git a/packages/backend/src/server/api/stream/channels/role-timeline.ts b/packages/backend/src/server/api/stream/channels/role-timeline.ts index a19f22cf6..6fabdcb75 100644 --- a/packages/backend/src/server/api/stream/channels/role-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/role-timeline.ts @@ -54,7 +54,7 @@ class RoleTimelineChannel extends Channel { } // 純粋なリノート(引用リノートでないリノート)の場合 - if (isRenotePacked(note) && !isQuotePacked(note) && note.renote) { + if (note.renote && isRenotePacked(note) && !isQuotePacked(note)) { if (note.renote.reply) { const reply = note.renote.reply; // 自分のフォローしていないユーザーの visibility: followers な投稿への返信のリノートは弾く diff --git a/packages/backend/src/server/api/stream/channels/user-list.ts b/packages/backend/src/server/api/stream/channels/user-list.ts index e92791898..297c253c4 100644 --- a/packages/backend/src/server/api/stream/channels/user-list.ts +++ b/packages/backend/src/server/api/stream/channels/user-list.ts @@ -110,7 +110,7 @@ class UserListChannel extends Channel { } // 純粋なリノート(引用リノートでないリノート)の場合 - if (isRenotePacked(note) && !isQuotePacked(note) && note.renote) { + if (note.renote && isRenotePacked(note) && !isQuotePacked(note)) { if (!this.withRenotes) return; if (note.renote.reply) { const reply = note.renote.reply;