diff --git a/packages/backend/src/server/api/stream/channels/antenna.ts b/packages/backend/src/server/api/stream/channels/antenna.ts index 7fd34ccfd..ff05359b5 100644 --- a/packages/backend/src/server/api/stream/channels/antenna.ts +++ b/packages/backend/src/server/api/stream/channels/antenna.ts @@ -54,9 +54,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 e97928c8d..96ada8c97 100644 --- a/packages/backend/src/server/api/stream/channels/channel.ts +++ b/packages/backend/src/server/api/stream/channels/channel.ts @@ -60,9 +60,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 d5f32c91f..581618740 100644 --- a/packages/backend/src/server/api/stream/channels/global-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/global-timeline.ts @@ -90,9 +90,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 0f983c977..34890854c 100644 --- a/packages/backend/src/server/api/stream/channels/home-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/home-timeline.ts @@ -94,9 +94,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 8234d5c23..47d534aa1 100644 --- a/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts @@ -108,9 +108,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 eae05fca6..e2192cfad 100644 --- a/packages/backend/src/server/api/stream/channels/local-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/local-timeline.ts @@ -93,9 +93,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 746608c27..67e5cd138 100644 --- a/packages/backend/src/server/api/stream/channels/role-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/role-timeline.ts @@ -76,9 +76,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.connection.cacheNote(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 3faeaddc7..d9407ac5d 100644 --- a/packages/backend/src/server/api/stream/channels/user-list.ts +++ b/packages/backend/src/server/api/stream/channels/user-list.ts @@ -133,9 +133,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);