From 7bbbbd0b8937c1aed0de776a806a65004fc66b97 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 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);