From 1ea5b86e712f5fa93115ee915d0d5a4e4c622404 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=82=E3=82=8F=E3=82=8F=E3=82=8F=E3=81=A8=E3=83=BC?= =?UTF-8?q?=E3=81=AB=E3=82=85?= <17376330+u1-liquid@users.noreply.github.com> Date: Wed, 25 Dec 2024 15:40:37 +0900 Subject: [PATCH] =?UTF-8?q?enhance(data-usage):=20=E3=82=B9=E3=83=88?= =?UTF-8?q?=E3=83=AA=E3=83=BC=E3=83=A0=E4=B8=8A=E3=81=A7=E9=80=81=E3=82=8B?= =?UTF-8?q?=E3=83=87=E3=83=BC=E3=82=BF=E3=81=8C=E3=81=AA=E3=81=84=E5=A0=B4?= =?UTF-8?q?=E5=90=88=E3=81=AF=E3=82=AA=E3=83=96=E3=82=B8=E3=82=A7=E3=82=AF?= =?UTF-8?q?=E3=83=88=E3=81=94=E3=81=A8=E7=9C=81=E7=95=A5=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB=20(MisskeyIO#853)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/backend/src/server/api/stream/channels/antenna.ts | 6 +++--- packages/backend/src/server/api/stream/channels/channel.ts | 6 +++--- .../src/server/api/stream/channels/global-timeline.ts | 6 +++--- .../backend/src/server/api/stream/channels/home-timeline.ts | 6 +++--- .../src/server/api/stream/channels/hybrid-timeline.ts | 6 +++--- .../src/server/api/stream/channels/local-timeline.ts | 6 +++--- .../backend/src/server/api/stream/channels/role-timeline.ts | 6 +++--- .../backend/src/server/api/stream/channels/user-list.ts | 6 +++--- 8 files changed, 24 insertions(+), 24 deletions(-) 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);