fix: アカウントの投稿一覧の取得のバグを修正

This commit is contained in:
usbharu 2024-01-31 16:44:20 +09:00
parent 8703a45fc2
commit 8d24b366e4
3 changed files with 8 additions and 4 deletions

View File

@ -101,8 +101,8 @@ class StatusQueryServiceImpl : StatusQueryService {
val statuses = resolveReplyAndRepost(pairs) val statuses = resolveReplyAndRepost(pairs)
return PaginationList( return PaginationList(
statuses, statuses,
statuses.lastOrNull()?.id?.toLongOrNull(), statuses.firstOrNull()?.id?.toLongOrNull(),
statuses.firstOrNull()?.id?.toLongOrNull() statuses.lastOrNull()?.id?.toLongOrNull()
) )
} }
@ -137,7 +137,9 @@ class StatusQueryServiceImpl : StatusQueryService {
} }
.map { .map {
if (it.inReplyToId != null) { if (it.inReplyToId != null) {
it.copy(inReplyToAccountId = statuses.find { (id) -> id == it.inReplyToId }?.id) println("statuses trace: $statuses")
println("inReplyToId trace: ${it.inReplyToId}")
it.copy(inReplyToAccountId = statuses.find { (id) -> id == it.inReplyToId }?.account?.id)
} else { } else {
it it
} }

View File

@ -88,8 +88,8 @@ class MastodonAccountApiController(
) )
) )
val httpHeader = statuses.toHttpHeader( val httpHeader = statuses.toHttpHeader(
{ "${applicationConfig.url}/api/v1/accounts/$id/statuses?max_id=$it" },
{ "${applicationConfig.url}/api/v1/accounts/$id/statuses?min_id=$it" }, { "${applicationConfig.url}/api/v1/accounts/$id/statuses?min_id=$it" },
{ "${applicationConfig.url}/api/v1/accounts/$id/statuses?max_id=$it" },
) )
if (httpHeader != null) { if (httpHeader != null) {

View File

@ -87,6 +87,8 @@ class AccountApiServiceImpl(
): PaginationList<Status, Long> { ): PaginationList<Status, Long> {
val canViewFollowers = if (loginUser == null) { val canViewFollowers = if (loginUser == null) {
false false
}else if(loginUser == userid) {
true
} else { } else {
transaction.transaction { transaction.transaction {
isFollowing(loginUser, userid) isFollowing(loginUser, userid)