diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/ActorDetail.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/ActorDetail.kt index 5a5eff44..d0c552c0 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/ActorDetail.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/ActorDetail.kt @@ -35,4 +35,4 @@ data class ActorDetail( ) } } -} \ No newline at end of file +} diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/GetActorDetailApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/GetActorDetailApplicationService.kt index f417fe5d..722f16fe 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/GetActorDetailApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/actor/GetActorDetailApplicationService.kt @@ -18,14 +18,14 @@ class GetActorDetailApplicationService( transaction: Transaction ) : AbstractApplicationService( - transaction, logger + transaction, + logger ) { override suspend fun internalExecute(command: GetActorDetail, principal: Principal): ActorDetail { val actor = if (command.id != null) { actorRepository.findById(ActorId(command.id)) ?: throw IllegalArgumentException("Actor ${command.id} not found.") } else if (command.actorName != null) { - val host = if (command.actorName.host.isEmpty()) { applicationConfig.url.host } else { @@ -46,4 +46,4 @@ class GetActorDetailApplicationService( companion object { private val logger = LoggerFactory.getLogger(GetActorDetailApplicationService::class.java) } -} \ No newline at end of file +} diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/instance/GetLocalInstanceApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/instance/GetLocalInstanceApplicationService.kt index e959e775..cdca8b84 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/instance/GetLocalInstanceApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/instance/GetLocalInstanceApplicationService.kt @@ -29,9 +29,9 @@ class GetLocalInstanceApplicationService( } val instance = ( - instanceRepository.findByUrl(applicationConfig.url.toURI()) - ?: throw InternalServerException("Local instance not found.") - ) + instanceRepository.findByUrl(applicationConfig.url.toURI()) + ?: throw InternalServerException("Local instance not found.") + ) cachedInstance = Instance.of(instance) @Suppress("UnsafeCallOnNullableType") diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/GetUserTimelineApplicationService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/GetUserTimelineApplicationService.kt index 0019a2d8..c151455c 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/GetUserTimelineApplicationService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/GetUserTimelineApplicationService.kt @@ -35,15 +35,18 @@ class GetUserTimelineApplicationService( val postDetailMap = userTimelineQueryService.findByIdAll(postIdList, principal).associateBy { it.id } - return PaginationList(postList.mapNotNull { - postDetailMap[it.id.id]?.copy( - repost = postDetailMap[it.repostId?.id], - reply = postDetailMap[it.replyId?.id] - ) - }, postList.next, postList.prev) + return PaginationList( + postList.mapNotNull { + postDetailMap[it.id.id]?.copy( + repost = postDetailMap[it.repostId?.id], + reply = postDetailMap[it.replyId?.id] + ) + }, + postList.next, postList.prev + ) } companion object { private val logger = LoggerFactory.getLogger(GetUserTimelineApplicationService::class.java) } -} \ No newline at end of file +} diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/config/MessageSourceConfig.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/config/MessageSourceConfig.kt index 846d89ca..ecbc2553 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/config/MessageSourceConfig.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/config/MessageSourceConfig.kt @@ -25,4 +25,4 @@ class MessageSourceConfig { fun messageSourceProperties(): MessageSourceProperties { return MessageSourceProperties() } -} \ No newline at end of file +} diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedquery/ExposedUserTimelineQueryService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedquery/ExposedUserTimelineQueryService.kt index 922abdca..72e48686 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedquery/ExposedUserTimelineQueryService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedquery/ExposedUserTimelineQueryService.kt @@ -39,10 +39,10 @@ class ExposedUserTimelineQueryService : UserTimelineQueryService, AbstractReposi .select(Posts.columns) .where { Posts.visibility eq Visibility.PUBLIC.name or - (Posts.visibility eq Visibility.UNLISTED.name) or - (Posts.visibility eq Visibility.DIRECT.name and (PostsVisibleActors.actorId eq principal.actorId.id)) or - (Posts.visibility eq Visibility.FOLLOWERS.name and (Relationships.blocking eq false and (relationshipsAlias[Relationships.following] eq true))) or - (Posts.actorId eq principal.actorId.id) + (Posts.visibility eq Visibility.UNLISTED.name) or + (Posts.visibility eq Visibility.DIRECT.name and (PostsVisibleActors.actorId eq principal.actorId.id)) or + (Posts.visibility eq Visibility.FOLLOWERS.name and (Relationships.blocking eq false and (relationshipsAlias[Relationships.following] eq true))) or + (Posts.actorId eq principal.actorId.id) } .alias("authorized_table") } @@ -107,4 +107,4 @@ class ExposedUserTimelineQueryService : UserTimelineQueryService, AbstractReposi companion object { private val logger = LoggerFactory.getLogger(ExposedUserTimelineQueryService::class.java) } -} \ No newline at end of file +} diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/springframework/SPAInterceptor.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/springframework/SPAInterceptor.kt index 866e1ae2..83df1836 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/springframework/SPAInterceptor.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/springframework/SPAInterceptor.kt @@ -11,7 +11,6 @@ import org.springframework.web.servlet.ModelAndView class SPAInterceptor : HandlerInterceptor { override fun preHandle(request: HttpServletRequest, response: HttpServletResponse, handler: Any): Boolean { - if (request.getParameter("s") == "f") { request.session.setAttribute("s", "f") } else if (request.getParameter("s") == "t") { @@ -37,4 +36,4 @@ class SPAInterceptor : HandlerInterceptor { modelAndView?.addObject("ogp", ogp) modelAndView?.viewName = "index" } -} \ No newline at end of file +} diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/IndexController.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/IndexController.kt index 38f46088..6f181ce4 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/IndexController.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/IndexController.kt @@ -25,4 +25,4 @@ class IndexController( model.addAttribute("applicationConfig", applicationConfig) return "top" } -} \ No newline at end of file +} diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/user/UserController.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/user/UserController.kt index b0eea320..c2691652 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/user/UserController.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/interfaces/web/user/UserController.kt @@ -39,13 +39,15 @@ class UserController( actorDetail ) model.addAttribute( - "userTimeline", getUserTimelineApplicationService.execute( + "userTimeline", + getUserTimelineApplicationService.execute( GetUserTimeline( actorDetail.id, Page.of(maxId, sinceId, minId, 20) - ), principal + ), + principal ) ) return "userById" } -} \ No newline at end of file +} diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/query/usertimeline/UserTimelineQueryService.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/query/usertimeline/UserTimelineQueryService.kt index 129cc190..2981cfa7 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/query/usertimeline/UserTimelineQueryService.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/query/usertimeline/UserTimelineQueryService.kt @@ -9,4 +9,4 @@ interface UserTimelineQueryService { * replyやrepost等はnullになります */ suspend fun findByIdAll(idList: List, principal: Principal): List -} \ No newline at end of file +}