fix: 返信が無視されていたのを修正

This commit is contained in:
usbharu 2023-11-29 16:24:30 +09:00
parent 032342262c
commit 0b63f95c17
2 changed files with 11 additions and 2 deletions

View File

@ -65,7 +65,9 @@ class PostServiceImpl(
createdAt = Instant.now().toEpochMilli(), createdAt = Instant.now().toEpochMilli(),
visibility = post.visibility, visibility = post.visibility,
url = "${user.url}/posts/$id", url = "${user.url}/posts/$id",
mediaIds = post.mediaIds mediaIds = post.mediaIds,
replyId = post.repolyId,
repostId = post.repostId,
) )
return internalCreate(createPost, isLocal) return internalCreate(createPost, isLocal)
} }

View File

@ -13,6 +13,7 @@ import dev.usbharu.hideout.mastodon.interfaces.api.status.StatusesRequest
import dev.usbharu.hideout.mastodon.interfaces.api.status.toPostVisibility import dev.usbharu.hideout.mastodon.interfaces.api.status.toPostVisibility
import dev.usbharu.hideout.mastodon.interfaces.api.status.toStatusVisibility import dev.usbharu.hideout.mastodon.interfaces.api.status.toStatusVisibility
import dev.usbharu.hideout.mastodon.service.account.AccountService import dev.usbharu.hideout.mastodon.service.account.AccountService
import org.slf4j.LoggerFactory
import org.springframework.stereotype.Service import org.springframework.stereotype.Service
import java.time.Instant import java.time.Instant
@ -38,12 +39,14 @@ class StatsesApiServiceImpl(
statusesRequest: StatusesRequest, statusesRequest: StatusesRequest,
userId: Long userId: Long
): Status = transaction.transaction { ): Status = transaction.transaction {
logger.debug("START create post by mastodon api. {}", statusesRequest)
val post = postService.createLocal( val post = postService.createLocal(
PostCreateDto( PostCreateDto(
text = statusesRequest.status.orEmpty(), text = statusesRequest.status.orEmpty(),
overview = statusesRequest.spoiler_text, overview = statusesRequest.spoiler_text,
visibility = statusesRequest.visibility.toPostVisibility(), visibility = statusesRequest.visibility.toPostVisibility(),
repolyId = statusesRequest.in_reply_to_id?.toLongOrNull(), repolyId = statusesRequest.in_reply_to_id?.toLong(),
userId = userId, userId = userId,
mediaIds = statusesRequest.media_ids.map { it.toLong() } mediaIds = statusesRequest.media_ids.map { it.toLong() }
) )
@ -91,4 +94,8 @@ class StatsesApiServiceImpl(
editedAt = null, editedAt = null,
) )
} }
companion object {
private val logger = LoggerFactory.getLogger(StatusesApiService::class.java)
}
} }