From b91716bba25d11ab98de905e8b64928e9b994c78 Mon Sep 17 00:00:00 2001 From: usbharu <64310155+usbharu@users.noreply.github.com> Date: Fri, 29 Sep 2023 19:20:57 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=E3=83=AA=E3=83=A2=E3=83=BC=E3=83=88?= =?UTF-8?q?=E3=83=A6=E3=83=BC=E3=82=B6=E3=83=BC=E3=81=AE=E5=A0=B4=E5=90=88?= =?UTF-8?q?=E3=81=AF=E3=82=BF=E3=82=A4=E3=83=A0=E3=83=A9=E3=82=A4=E3=83=B3?= =?UTF-8?q?=E3=81=AB=E8=87=AA=E5=88=86=E8=87=AA=E8=BA=AB=E3=82=92=E5=90=AB?= =?UTF-8?q?=E3=82=81=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dev/usbharu/hideout/service/post/TimelineService.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/dev/usbharu/hideout/service/post/TimelineService.kt b/src/main/kotlin/dev/usbharu/hideout/service/post/TimelineService.kt index 944b1dda..97f83a08 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/post/TimelineService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/post/TimelineService.kt @@ -15,9 +15,12 @@ class TimelineService( private val timelineRepository: TimelineRepository ) { suspend fun publishTimeline(post: Post, isLocal: Boolean) { - // 自分自身も含める必要がある - val user = userQueryService.findById(post.userId) - val findFollowersById = followerQueryService.findFollowersById(post.userId).plus(user) + val findFollowersById = followerQueryService.findFollowersById(post.userId).toMutableList() + if (isLocal) { + // 自分自身も含める必要がある + val user = userQueryService.findById(post.userId) + findFollowersById.add(user) + } val timelines = findFollowersById.map { Timeline( id = timelineRepository.generateId(),