diff --git a/packages/backend/src/server/api/stream/channels/antenna.ts b/packages/backend/src/server/api/stream/channels/antenna.ts index ad8caa506b..8ad151ae9b 100644 --- a/packages/backend/src/server/api/stream/channels/antenna.ts +++ b/packages/backend/src/server/api/stream/channels/antenna.ts @@ -48,9 +48,9 @@ class AntennaChannel extends Channel { if (this.minimize && ['public', 'home'].includes(note.visibility)) { this.send('note', { id: note.id, myReaction: note.myReaction, - poll: note.poll ? { choices: note.poll.choices } : undefined, - reply: note.reply ? { myReaction: note.reply.myReaction } : undefined, - renote: note.renote ? { myReaction: note.renote.myReaction } : undefined, + poll: note.poll?.choices ? { choices: note.poll.choices } : undefined, + reply: note.reply?.myReaction ? { myReaction: note.reply.myReaction } : undefined, + renote: note.renote?.myReaction ? { myReaction: note.renote.myReaction } : undefined, }); } else { this.connection.cacheNote(note); diff --git a/packages/backend/src/server/api/stream/channels/channel.ts b/packages/backend/src/server/api/stream/channels/channel.ts index 84a968cc23..45fbe7849a 100644 --- a/packages/backend/src/server/api/stream/channels/channel.ts +++ b/packages/backend/src/server/api/stream/channels/channel.ts @@ -54,9 +54,9 @@ class ChannelChannel extends Channel { if (this.minimize && ['public', 'home'].includes(note.visibility)) { this.send('note', { id: note.id, myReaction: note.myReaction, - poll: note.poll ? { choices: note.poll.choices } : undefined, - reply: note.reply ? { myReaction: note.reply.myReaction } : undefined, - renote: note.renote ? { myReaction: note.renote.myReaction } : undefined, + poll: note.poll?.choices ? { choices: note.poll.choices } : undefined, + reply: note.reply?.myReaction ? { myReaction: note.reply.myReaction } : undefined, + renote: note.renote?.myReaction ? { myReaction: note.renote.myReaction } : undefined, }); } else { this.connection.cacheNote(note); 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 33a4677a8f..4d5dbb45dc 100644 --- a/packages/backend/src/server/api/stream/channels/global-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/global-timeline.ts @@ -67,9 +67,9 @@ class GlobalTimelineChannel extends Channel { if (this.minimize && ['public', 'home'].includes(note.visibility)) { this.send('note', { id: note.id, myReaction: note.myReaction, - poll: note.poll ? { choices: note.poll.choices } : undefined, - reply: note.reply ? { myReaction: note.reply.myReaction } : undefined, - renote: note.renote ? { myReaction: note.renote.myReaction } : undefined, + poll: note.poll?.choices ? { choices: note.poll.choices } : undefined, + reply: note.reply?.myReaction ? { myReaction: note.reply.myReaction } : undefined, + renote: note.renote?.myReaction ? { myReaction: note.renote.myReaction } : undefined, }); } else { this.connection.cacheNote(note); 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 c3d2d836f2..44f55c93ad 100644 --- a/packages/backend/src/server/api/stream/channels/home-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/home-timeline.ts @@ -91,9 +91,9 @@ class HomeTimelineChannel extends Channel { if (this.minimize && ['public', 'home'].includes(note.visibility)) { this.send('note', { id: note.id, myReaction: note.myReaction, - poll: note.poll ? { choices: note.poll.choices } : undefined, - reply: note.reply ? { myReaction: note.reply.myReaction } : undefined, - renote: note.renote ? { myReaction: note.renote.myReaction } : undefined, + poll: note.poll?.choices ? { choices: note.poll.choices } : undefined, + reply: note.reply?.myReaction ? { myReaction: note.reply.myReaction } : undefined, + renote: note.renote?.myReaction ? { myReaction: note.renote.myReaction } : undefined, }); } else { this.connection.cacheNote(note); 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 8bd22fbd65..2ec9f85d4f 100644 --- a/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts @@ -106,9 +106,9 @@ class HybridTimelineChannel extends Channel { if (this.minimize && ['public', 'home'].includes(note.visibility)) { this.send('note', { id: note.id, myReaction: note.myReaction, - poll: note.poll ? { choices: note.poll.choices } : undefined, - reply: note.reply ? { myReaction: note.reply.myReaction } : undefined, - renote: note.renote ? { myReaction: note.renote.myReaction } : undefined, + poll: note.poll?.choices ? { choices: note.poll.choices } : undefined, + reply: note.reply?.myReaction ? { myReaction: note.reply.myReaction } : undefined, + renote: note.renote?.myReaction ? { myReaction: note.renote.myReaction } : undefined, }); } else { this.connection.cacheNote(note); 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 904b15ca37..07c0e80bc4 100644 --- a/packages/backend/src/server/api/stream/channels/local-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/local-timeline.ts @@ -77,9 +77,9 @@ class LocalTimelineChannel extends Channel { if (this.minimize && ['public', 'home'].includes(note.visibility)) { this.send('note', { id: note.id, myReaction: note.myReaction, - poll: note.poll ? { choices: note.poll.choices } : undefined, - reply: note.reply ? { myReaction: note.reply.myReaction } : undefined, - renote: note.renote ? { myReaction: note.renote.myReaction } : undefined, + poll: note.poll?.choices ? { choices: note.poll.choices } : undefined, + reply: note.reply?.myReaction ? { myReaction: note.reply.myReaction } : undefined, + renote: note.renote?.myReaction ? { myReaction: note.renote.myReaction } : undefined, }); } else { this.connection.cacheNote(note); 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 5bf3b7db05..10ee684d68 100644 --- a/packages/backend/src/server/api/stream/channels/role-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/role-timeline.ts @@ -53,9 +53,9 @@ class RoleTimelineChannel extends Channel { if (this.minimize && ['public', 'home'].includes(note.visibility)) { this.send('note', { id: note.id, myReaction: note.myReaction, - poll: note.poll ? { choices: note.poll.choices } : undefined, - reply: note.reply ? { myReaction: note.reply.myReaction } : undefined, - renote: note.renote ? { myReaction: note.renote.myReaction } : undefined, + poll: note.poll?.choices ? { choices: note.poll.choices } : undefined, + reply: note.reply?.myReaction ? { myReaction: note.reply.myReaction } : undefined, + renote: note.renote?.myReaction ? { myReaction: note.renote.myReaction } : undefined, }); } else { this.send('note', note); 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 98d165e39b..18cfed5d6b 100644 --- a/packages/backend/src/server/api/stream/channels/user-list.ts +++ b/packages/backend/src/server/api/stream/channels/user-list.ts @@ -123,9 +123,9 @@ class UserListChannel extends Channel { if (this.minimize && ['public', 'home'].includes(note.visibility)) { this.send('note', { id: note.id, myReaction: note.myReaction, - poll: note.poll ? { choices: note.poll.choices } : undefined, - reply: note.reply ? { myReaction: note.reply.myReaction } : undefined, - renote: note.renote ? { myReaction: note.renote.myReaction } : undefined, + poll: note.poll?.choices ? { choices: note.poll.choices } : undefined, + reply: note.reply?.myReaction ? { myReaction: note.reply.myReaction } : undefined, + renote: note.renote?.myReaction ? { myReaction: note.renote.myReaction } : undefined, }); } else { this.connection.cacheNote(note);