diff --git a/src/main/kotlin/dev/usbharu/hideout/mastodon/infrastructure/exposedquery/StatusQueryServiceImpl.kt b/src/main/kotlin/dev/usbharu/hideout/mastodon/infrastructure/exposedquery/StatusQueryServiceImpl.kt index 86e4f9f4..07a8dbcb 100644 --- a/src/main/kotlin/dev/usbharu/hideout/mastodon/infrastructure/exposedquery/StatusQueryServiceImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/mastodon/infrastructure/exposedquery/StatusQueryServiceImpl.kt @@ -101,8 +101,8 @@ class StatusQueryServiceImpl : StatusQueryService { val statuses = resolveReplyAndRepost(pairs) return PaginationList( 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 { 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 { it } diff --git a/src/main/kotlin/dev/usbharu/hideout/mastodon/interfaces/api/account/MastodonAccountApiController.kt b/src/main/kotlin/dev/usbharu/hideout/mastodon/interfaces/api/account/MastodonAccountApiController.kt index a32d1910..650199ad 100644 --- a/src/main/kotlin/dev/usbharu/hideout/mastodon/interfaces/api/account/MastodonAccountApiController.kt +++ b/src/main/kotlin/dev/usbharu/hideout/mastodon/interfaces/api/account/MastodonAccountApiController.kt @@ -88,8 +88,8 @@ class MastodonAccountApiController( ) ) 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?max_id=$it" }, ) if (httpHeader != null) { diff --git a/src/main/kotlin/dev/usbharu/hideout/mastodon/service/account/AccountApiService.kt b/src/main/kotlin/dev/usbharu/hideout/mastodon/service/account/AccountApiService.kt index 68c2781c..42bb0e87 100644 --- a/src/main/kotlin/dev/usbharu/hideout/mastodon/service/account/AccountApiService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/mastodon/service/account/AccountApiService.kt @@ -87,6 +87,8 @@ class AccountApiServiceImpl( ): PaginationList { val canViewFollowers = if (loginUser == null) { false + }else if(loginUser == userid) { + true } else { transaction.transaction { isFollowing(loginUser, userid)