diff options
| author | piuvas <piuvas@proton.me> | 2024-12-23 20:42:21 -0300 |
|---|---|---|
| committer | piuvas <piuvas@proton.me> | 2024-12-23 20:42:21 -0300 |
| commit | 94c3a71e499f8d508dfd1e49727d6a2d04031873 (patch) | |
| tree | 4c47aeb5160172bfd8e7d9f86b268e1c830c597f /packages/backend/src/server/api/stream | |
| parent | populate myreaction on replies for streams. (diff) | |
| download | sharkey-94c3a71e499f8d508dfd1e49727d6a2d04031873.tar.gz sharkey-94c3a71e499f8d508dfd1e49727d6a2d04031873.tar.bz2 sharkey-94c3a71e499f8d508dfd1e49727d6a2d04031873.zip | |
improvements.
Diffstat (limited to 'packages/backend/src/server/api/stream')
5 files changed, 40 insertions, 10 deletions
diff --git a/packages/backend/src/server/api/stream/channels/bubble-timeline.ts b/packages/backend/src/server/api/stream/channels/bubble-timeline.ts index b8cbe4f283..41b7b7cd3c 100644 --- a/packages/backend/src/server/api/stream/channels/bubble-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/bubble-timeline.ts @@ -70,12 +70,18 @@ class BubbleTimelineChannel extends Channel { const myRenoteReaction = await this.noteEntityService.populateMyReaction(note.renote, this.user.id); note.renote.myReaction = myRenoteReaction; } + if (note.renote && note.renote.reply) { + if (Object.keys(note.renote.reply.reactions).length > 0) { + const myReplyReaction = await this.noteEntityService.populateMyReaction(note.renote.reply, this.user.id); + note.renote.reply.myReaction = myReplyReaction; + } + } } if (this.user && note.reply) { if (Object.keys(note.reply.reactions).length > 0) { - const myRenoteReaction = await this.noteEntityService.populateMyReaction(note.reply, this.user.id); - note.reply.myReaction = myRenoteReaction; + const myReplyReaction = await this.noteEntityService.populateMyReaction(note.reply, this.user.id); + note.reply.myReaction = myReplyReaction; } } 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 43aa99e8c4..6da21ac72c 100644 --- a/packages/backend/src/server/api/stream/channels/global-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/global-timeline.ts @@ -65,12 +65,18 @@ class GlobalTimelineChannel extends Channel { const myRenoteReaction = await this.noteEntityService.populateMyReaction(note.renote, this.user.id); note.renote.myReaction = myRenoteReaction; } + if (note.renote && note.renote.reply) { + if (Object.keys(note.renote.reply.reactions).length > 0) { + const myReplyReaction = await this.noteEntityService.populateMyReaction(note.renote.reply, this.user.id); + note.renote.reply.myReaction = myReplyReaction; + } + } } if (this.user && note.reply) { if (Object.keys(note.reply.reactions).length > 0) { - const myRenoteReaction = await this.noteEntityService.populateMyReaction(note.reply, this.user.id); - note.reply.myReaction = myRenoteReaction; + const myReplyReaction = await this.noteEntityService.populateMyReaction(note.reply, this.user.id); + note.reply.myReaction = myReplyReaction; } } 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 05040b9099..d4b65222a0 100644 --- a/packages/backend/src/server/api/stream/channels/home-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/home-timeline.ts @@ -86,12 +86,18 @@ class HomeTimelineChannel extends Channel { const myRenoteReaction = await this.noteEntityService.populateMyReaction(note.renote, this.user.id); note.renote.myReaction = myRenoteReaction; } + if (note.renote && note.renote.reply) { + if (Object.keys(note.renote.reply.reactions).length > 0) { + const myReplyReaction = await this.noteEntityService.populateMyReaction(note.renote.reply, this.user.id); + note.renote.reply.myReaction = myReplyReaction; + } + } } if (this.user && note.reply) { if (Object.keys(note.reply.reactions).length > 0) { - const myRenoteReaction = await this.noteEntityService.populateMyReaction(note.reply, this.user.id); - note.reply.myReaction = myRenoteReaction; + const myReplyReaction = await this.noteEntityService.populateMyReaction(note.reply, this.user.id); + note.reply.myReaction = myReplyReaction; } } 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 b268904f04..c989721463 100644 --- a/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts @@ -104,12 +104,18 @@ class HybridTimelineChannel extends Channel { const myRenoteReaction = await this.noteEntityService.populateMyReaction(note.renote, this.user.id); note.renote.myReaction = myRenoteReaction; } + if (note.renote && note.renote.reply) { + if (Object.keys(note.renote.reply.reactions).length > 0) { + const myReplyReaction = await this.noteEntityService.populateMyReaction(note.renote.reply, this.user.id); + note.renote.reply.myReaction = myReplyReaction; + } + } } if (this.user && note.reply) { if (Object.keys(note.reply.reactions).length > 0) { - const myRenoteReaction = await this.noteEntityService.populateMyReaction(note.reply, this.user.id); - note.reply.myReaction = myRenoteReaction; + const myReplyReaction = await this.noteEntityService.populateMyReaction(note.reply, this.user.id); + note.reply.myReaction = myReplyReaction; } } 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 8d75a0c3a2..2f1720f8fe 100644 --- a/packages/backend/src/server/api/stream/channels/local-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/local-timeline.ts @@ -75,12 +75,18 @@ class LocalTimelineChannel extends Channel { const myRenoteReaction = await this.noteEntityService.populateMyReaction(note.renote, this.user.id); note.renote.myReaction = myRenoteReaction; } + if (note.renote && note.renote.reply) { + if (Object.keys(note.renote.reply.reactions).length > 0) { + const myReplyReaction = await this.noteEntityService.populateMyReaction(note.renote.reply, this.user.id); + note.renote.reply.myReaction = myReplyReaction; + } + } } if (this.user && note.reply) { if (Object.keys(note.reply.reactions).length > 0) { - const myRenoteReaction = await this.noteEntityService.populateMyReaction(note.reply, this.user.id); - note.reply.myReaction = myRenoteReaction; + const myReplyReaction = await this.noteEntityService.populateMyReaction(note.reply, this.user.id); + note.reply.myReaction = myReplyReaction; } } |