mirror of https://github.com/usbharu/Hideout.git
fix: リモートユーザーの場合はタイムラインに自分自身を含めないように
This commit is contained in:
parent
588b54ea7e
commit
b91716bba2
|
@ -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(),
|
||||||
|
|
Loading…
Reference in New Issue