fix: リモートユーザーの場合はタイムラインに自分自身を含めないように

This commit is contained in:
usbharu 2023-09-29 19:20:57 +09:00
parent 588b54ea7e
commit b91716bba2
1 changed files with 6 additions and 3 deletions

View File

@ -15,9 +15,12 @@ class TimelineService(
private val timelineRepository: TimelineRepository private val timelineRepository: TimelineRepository
) { ) {
suspend fun publishTimeline(post: Post, isLocal: Boolean) { suspend fun publishTimeline(post: Post, isLocal: Boolean) {
// 自分自身も含める必要がある val findFollowersById = followerQueryService.findFollowersById(post.userId).toMutableList()
val user = userQueryService.findById(post.userId) if (isLocal) {
val findFollowersById = followerQueryService.findFollowersById(post.userId).plus(user) // 自分自身も含める必要がある
val user = userQueryService.findById(post.userId)
findFollowersById.add(user)
}
val timelines = findFollowersById.map { val timelines = findFollowersById.map {
Timeline( Timeline(
id = timelineRepository.generateId(), id = timelineRepository.generateId(),