From 05035eba4eec3e64e7b471e343cbd54967985c16 Mon Sep 17 00:00:00 2001 From: usbharu Date: Thu, 19 Dec 2024 11:28:35 +0000 Subject: [PATCH] style: fix lint (CI) --- .../GetLocalInstanceApplicationService.kt | 6 +- .../GetRelationshipApplicationService.kt | 12 ++-- ...rRegisterHomeTimelineApplicationService.kt | 6 +- ...eTimelineRelationshipApplicationService.kt | 12 ++-- .../hideout/core/domain/model/actor/Actor.kt | 58 +++++++++---------- .../domain/model/actor/ActorPrivateKey.kt | 12 ++-- .../core/domain/model/actor/ActorPublicKey.kt | 12 ++-- .../ActorInstanceRelationship.kt | 12 ++-- .../core/domain/model/emoji/CustomEmoji.kt | 6 +- .../core/domain/model/filter/Filter.kt | 14 ++--- .../core/domain/model/filter/FilterKeyword.kt | 8 +-- .../core/domain/model/filter/FilterName.kt | 4 +- .../core/domain/model/filter/FilterResult.kt | 6 +- .../core/domain/model/filter/FilteredPost.kt | 6 +- .../hideout/core/domain/model/media/Media.kt | 22 +++---- .../hideout/core/domain/model/post/Post.kt | 38 ++++++------ .../model/timelineobject/TimelineObject.kt | 12 ++-- .../domain/model/userdetails/UserDetail.kt | 14 ++--- .../post/DefaultPostReadAccessControl.kt | 6 +- .../ExposedUserTimelineQueryService.kt | 20 +++---- ...osedActorInstanceRelationshipRepository.kt | 4 +- .../ExposedRelationshipRepository.kt | 8 +-- .../oauth2/HideoutUserDetails.kt | 10 ++-- .../timeline/AbstractTimelineStore.kt | 6 +- .../exposedquery/ExposedStatusQueryService.kt | 8 +-- .../interfaces/api/StatusesRequest.kt | 4 +- 26 files changed, 163 insertions(+), 163 deletions(-) diff --git a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/instance/GetLocalInstanceApplicationService.kt b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/instance/GetLocalInstanceApplicationService.kt index 5c738d69..0db792d1 100644 --- a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/instance/GetLocalInstanceApplicationService.kt +++ b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/instance/GetLocalInstanceApplicationService.kt @@ -46,9 +46,9 @@ class GetLocalInstanceApplicationService( } val instance = ( - instanceRepository.findByUrl(applicationConfig.url) - ?: throw InternalServerException("Local instance not found.") - ) + instanceRepository.findByUrl(applicationConfig.url) + ?: throw InternalServerException("Local instance not found.") + ) cachedInstance = Instance.of(instance) @Suppress("UnsafeCallOnNullableType") diff --git a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/GetRelationshipApplicationService.kt b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/GetRelationshipApplicationService.kt index 49c079f7..95531df1 100644 --- a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/GetRelationshipApplicationService.kt +++ b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/relationship/GetRelationshipApplicationService.kt @@ -47,14 +47,14 @@ class GetRelationshipApplicationService( val target = actorRepository.findById(targetId) ?: throw IllegalArgumentException("Actor ${command.targetActorId} not found.") val relationship = ( - relationshipRepository.findByActorIdAndTargetId(actor.id, targetId) - ?: dev.usbharu.hideout.core.domain.model.relationship.Relationship.default(actor.id, targetId) - ) + relationshipRepository.findByActorIdAndTargetId(actor.id, targetId) + ?: dev.usbharu.hideout.core.domain.model.relationship.Relationship.default(actor.id, targetId) + ) val relationship1 = ( - relationshipRepository.findByActorIdAndTargetId(targetId, actor.id) - ?: dev.usbharu.hideout.core.domain.model.relationship.Relationship.default(targetId, actor.id) - ) + relationshipRepository.findByActorIdAndTargetId(targetId, actor.id) + ?: dev.usbharu.hideout.core.domain.model.relationship.Relationship.default(targetId, actor.id) + ) val actorInstanceRelationship = actorInstanceRelationshipRepository.findByActorIdAndInstanceId(actor.id, target.instance) diff --git a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/UserRegisterHomeTimelineApplicationService.kt b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/UserRegisterHomeTimelineApplicationService.kt index 98ce31c4..3c1c47d5 100644 --- a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/UserRegisterHomeTimelineApplicationService.kt +++ b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/UserRegisterHomeTimelineApplicationService.kt @@ -41,9 +41,9 @@ class UserRegisterHomeTimelineApplicationService( ) : AbstractApplicationService(transaction, logger) { override suspend fun internalExecute(command: RegisterHomeTimeline, principal: Principal) { val userDetail = ( - userDetailRepository.findById(UserDetailId(command.userDetailId)) - ?: throw IllegalArgumentException("UserDetail ${command.userDetailId} not found.") - ) + userDetailRepository.findById(UserDetailId(command.userDetailId)) + ?: throw IllegalArgumentException("UserDetail ${command.userDetailId} not found.") + ) val timeline = Timeline.create( TimelineId(idGenerateService.generateId()), diff --git a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/UserRemoveTimelineRelationshipApplicationService.kt b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/UserRemoveTimelineRelationshipApplicationService.kt index d5c93d06..d7c22d65 100644 --- a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/UserRemoveTimelineRelationshipApplicationService.kt +++ b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/timeline/UserRemoveTimelineRelationshipApplicationService.kt @@ -39,14 +39,14 @@ class UserRemoveTimelineRelationshipApplicationService( override suspend fun internalExecute(command: RemoveTimelineRelationship, principal: LocalUser) { val timelineRelationship = ( - timelineRelationshipRepository.findById(command.timelineRelationshipId) - ?: throw IllegalArgumentException("TimelineRelationship ${command.timelineRelationshipId} not found.") - ) + timelineRelationshipRepository.findById(command.timelineRelationshipId) + ?: throw IllegalArgumentException("TimelineRelationship ${command.timelineRelationshipId} not found.") + ) val timeline = ( - timelineRepository.findById(timelineRelationship.timelineId) - ?: throw IllegalArgumentException("Timeline ${timelineRelationship.timelineId} not found.") - ) + timelineRepository.findById(timelineRelationship.timelineId) + ?: throw IllegalArgumentException("Timeline ${timelineRelationship.timelineId} not found.") + ) if (timeline.userDetailId != principal.userDetailId) { throw PermissionDeniedException() diff --git a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/actor/Actor.kt b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/actor/Actor.kt index ad2a9854..684c3474 100644 --- a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/actor/Actor.kt +++ b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/actor/Actor.kt @@ -158,34 +158,34 @@ class Actor( override fun toString(): String { return "Actor(" + - "id=$id, " + - "name=$name, " + - "domain=$domain, " + - "inbox=$inbox, " + - "outbox=$outbox, " + - "url=$url, " + - "publicKey=$publicKey, " + - "privateKey=$privateKey, " + - "createdAt=$createdAt, " + - "keyId=$keyId, " + - "followersEndpoint=$followersEndpoint, " + - "followingEndpoint=$followingEndpoint, " + - "instance=$instance, " + - "locked=$locked, " + - "followersCount=$followersCount, " + - "followingCount=$followingCount, " + - "postsCount=$postsCount, " + - "lastPostAt=$lastPostAt, " + - "lastUpdateAt=$lastUpdateAt, " + - "banner=$banner, " + - "icon=$icon, " + - "suspend=$suspend, " + - "alsoKnownAs=$alsoKnownAs, " + - "moveTo=$moveTo, " + - "emojis=$emojis, " + - "description=$description, " + - "screenName=$screenName, " + - "deleted=$deleted" + - ")" + "id=$id, " + + "name=$name, " + + "domain=$domain, " + + "inbox=$inbox, " + + "outbox=$outbox, " + + "url=$url, " + + "publicKey=$publicKey, " + + "privateKey=$privateKey, " + + "createdAt=$createdAt, " + + "keyId=$keyId, " + + "followersEndpoint=$followersEndpoint, " + + "followingEndpoint=$followingEndpoint, " + + "instance=$instance, " + + "locked=$locked, " + + "followersCount=$followersCount, " + + "followingCount=$followingCount, " + + "postsCount=$postsCount, " + + "lastPostAt=$lastPostAt, " + + "lastUpdateAt=$lastUpdateAt, " + + "banner=$banner, " + + "icon=$icon, " + + "suspend=$suspend, " + + "alsoKnownAs=$alsoKnownAs, " + + "moveTo=$moveTo, " + + "emojis=$emojis, " + + "description=$description, " + + "screenName=$screenName, " + + "deleted=$deleted" + + ")" } } diff --git a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/actor/ActorPrivateKey.kt b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/actor/ActorPrivateKey.kt index bb507885..fd683f2b 100644 --- a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/actor/ActorPrivateKey.kt +++ b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/actor/ActorPrivateKey.kt @@ -25,12 +25,12 @@ value class ActorPrivateKey(val privateKey: String) { fun create(privateKey: PrivateKey): ActorPrivateKey { return ActorPrivateKey( "-----BEGIN PRIVATE KEY-----\n" + - Base64 - .getEncoder() - .encodeToString(privateKey.encoded) - .chunked(64) - .joinToString("\n") + - "\n-----END PRIVATE KEY-----" + Base64 + .getEncoder() + .encodeToString(privateKey.encoded) + .chunked(64) + .joinToString("\n") + + "\n-----END PRIVATE KEY-----" ) } } diff --git a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/actor/ActorPublicKey.kt b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/actor/ActorPublicKey.kt index 5dd982f1..f3419d91 100644 --- a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/actor/ActorPublicKey.kt +++ b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/actor/ActorPublicKey.kt @@ -25,12 +25,12 @@ value class ActorPublicKey(val publicKey: String) { fun create(publicKey: PublicKey): ActorPublicKey { return ActorPublicKey( "-----BEGIN PUBLIC KEY-----\n" + - Base64 - .getEncoder() - .encodeToString(publicKey.encoded) - .chunked(64) - .joinToString("\n") + - "\n-----END PUBLIC KEY-----" + Base64 + .getEncoder() + .encodeToString(publicKey.encoded) + .chunked(64) + .joinToString("\n") + + "\n-----END PUBLIC KEY-----" ) } } diff --git a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/actorinstancerelationship/ActorInstanceRelationship.kt b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/actorinstancerelationship/ActorInstanceRelationship.kt index 90c7b529..4585ddc0 100644 --- a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/actorinstancerelationship/ActorInstanceRelationship.kt +++ b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/actorinstancerelationship/ActorInstanceRelationship.kt @@ -89,12 +89,12 @@ class ActorInstanceRelationship( override fun toString(): String { return "ActorInstanceRelationship(" + - "actorId=$actorId, " + - "instanceId=$instanceId, " + - "blocking=$blocking, " + - "muting=$muting, " + - "doNotSendPrivate=$doNotSendPrivate" + - ")" + "actorId=$actorId, " + + "instanceId=$instanceId, " + + "blocking=$blocking, " + + "muting=$muting, " + + "doNotSendPrivate=$doNotSendPrivate" + + ")" } companion object { diff --git a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/emoji/CustomEmoji.kt b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/emoji/CustomEmoji.kt index 5a64a948..b80d06cf 100644 --- a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/emoji/CustomEmoji.kt +++ b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/emoji/CustomEmoji.kt @@ -29,9 +29,9 @@ sealed class Emoji { abstract fun id(): String override fun toString(): String { return "Emoji(" + - "domain='$domain', " + - "name='$name'" + - ")" + "domain='$domain', " + + "name='$name'" + + ")" } } diff --git a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/Filter.kt b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/Filter.kt index 30878db0..030c2deb 100644 --- a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/Filter.kt +++ b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/Filter.kt @@ -84,13 +84,13 @@ class Filter( override fun hashCode(): Int = id.hashCode() override fun toString(): String { return "Filter(" + - "id=$id, " + - "userDetailId=$userDetailId, " + - "name=$name, " + - "filterContext=$filterContext, " + - "filterAction=$filterAction, " + - "filterKeywords=$filterKeywords" + - ")" + "id=$id, " + + "userDetailId=$userDetailId, " + + "name=$name, " + + "filterContext=$filterContext, " + + "filterAction=$filterAction, " + + "filterKeywords=$filterKeywords" + + ")" } companion object { diff --git a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterKeyword.kt b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterKeyword.kt index 373c92ed..ff139522 100644 --- a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterKeyword.kt +++ b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterKeyword.kt @@ -34,9 +34,9 @@ class FilterKeyword( override fun toString(): String { return "FilterKeyword(" + - "id=$id, " + - "keyword=$keyword, " + - "mode=$mode" + - ")" + "id=$id, " + + "keyword=$keyword, " + + "mode=$mode" + + ")" } } diff --git a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterName.kt b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterName.kt index 88af257a..64c5dd67 100644 --- a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterName.kt +++ b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterName.kt @@ -33,8 +33,8 @@ class FilterName(name: String) { override fun toString(): String { return "FilterName(" + - "name='$name'" + - ")" + "name='$name'" + + ")" } companion object { diff --git a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterResult.kt b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterResult.kt index 1b4badc5..8c590718 100644 --- a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterResult.kt +++ b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterResult.kt @@ -37,8 +37,8 @@ class FilterResult(val filter: Filter, val matchedKeyword: String) { override fun toString(): String { return "FilterResult(" + - "filter=$filter, " + - "matchedKeyword='$matchedKeyword'" + - ")" + "filter=$filter, " + + "matchedKeyword='$matchedKeyword'" + + ")" } } diff --git a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilteredPost.kt b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilteredPost.kt index 6c345e34..2b4934c0 100644 --- a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilteredPost.kt +++ b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilteredPost.kt @@ -39,8 +39,8 @@ class FilteredPost(val post: Post, val filterResults: List) { override fun toString(): String { return "FilteredPost(" + - "post=$post, " + - "filterResults=$filterResults" + - ")" + "post=$post, " + + "filterResults=$filterResults" + + ")" } } diff --git a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/media/Media.kt b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/media/Media.kt index 4f310044..a5a12785 100644 --- a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/media/Media.kt +++ b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/media/Media.kt @@ -52,16 +52,16 @@ class Media( override fun toString(): String { return "Media(" + - "id=$id, " + - "name=$name, " + - "remoteUrl=$remoteUrl, " + - "thumbnailUrl=$thumbnailUrl, " + - "type=$type, " + - "mimeType=$mimeType, " + - "blurHash=$blurHash, " + - "description=$description, " + - "actorId=$actorId, " + - "url=$url" + - ")" + "id=$id, " + + "name=$name, " + + "remoteUrl=$remoteUrl, " + + "thumbnailUrl=$thumbnailUrl, " + + "type=$type, " + + "mimeType=$mimeType, " + + "blurHash=$blurHash, " + + "description=$description, " + + "actorId=$actorId, " + + "url=$url" + + ")" } } diff --git a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/post/Post.kt b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/post/Post.kt index fc8d40fa..db5f2732 100644 --- a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/post/Post.kt +++ b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/post/Post.kt @@ -241,25 +241,25 @@ class Post( override fun toString(): String { return "Post(" + - "id=$id, " + - "createdAt=$createdAt, " + - "url=$url, " + - "repostId=$repostId, " + - "replyId=$replyId, " + - "apId=$apId, " + - "actorId=$actorId, " + - "visibility=$visibility, " + - "visibleActors=$visibleActors, " + - "content=$content, " + - "overview=$overview, " + - "sensitive=$sensitive, " + - "text='$text', " + - "emojiIds=$emojiIds, " + - "mediaIds=$mediaIds, " + - "deleted=$deleted, " + - "hide=$hide, " + - "moveTo=$moveTo" + - ")" + "id=$id, " + + "createdAt=$createdAt, " + + "url=$url, " + + "repostId=$repostId, " + + "replyId=$replyId, " + + "apId=$apId, " + + "actorId=$actorId, " + + "visibility=$visibility, " + + "visibleActors=$visibleActors, " + + "content=$content, " + + "overview=$overview, " + + "sensitive=$sensitive, " + + "text='$text', " + + "emojiIds=$emojiIds, " + + "mediaIds=$mediaIds, " + + "deleted=$deleted, " + + "hide=$hide, " + + "moveTo=$moveTo" + + ")" } companion object { diff --git a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timelineobject/TimelineObject.kt b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timelineobject/TimelineObject.kt index dabd1f15..4d9737e2 100644 --- a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timelineobject/TimelineObject.kt +++ b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/timelineobject/TimelineObject.kt @@ -77,9 +77,9 @@ class TimelineObject( lastUpdatedAt = Instant.now() isPureRepost = post.repostId != null && - post.replyId == null && - post.text.isEmpty() && - post.overview?.overview.isNullOrEmpty() + post.replyId == null && + post.text.isEmpty() && + post.overview?.overview.isNullOrEmpty() warnFilters = filterResults.map { TimelineObjectWarnFilter(it.filter.id, it.matchedKeyword) } } @@ -149,9 +149,9 @@ class TimelineObject( repostActorId = repost.actorId, visibility = post.visibility, isPureRepost = repost.mediaIds.isEmpty() && - repost.overview == null && - repost.content == PostContent.empty && - repost.replyId == null, + repost.overview == null && + repost.content == PostContent.empty && + repost.replyId == null, mediaIds = post.mediaIds, emojiIds = post.emojiIds, visibleActors = post.visibleActors.toList(), diff --git a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/userdetails/UserDetail.kt b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/userdetails/UserDetail.kt index 183ec3e6..a782b044 100644 --- a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/userdetails/UserDetail.kt +++ b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/userdetails/UserDetail.kt @@ -44,13 +44,13 @@ class UserDetail( override fun hashCode(): Int = id.hashCode() override fun toString(): String { return "UserDetail(" + - "id=$id, " + - "actorId=$actorId, " + - "password=$password, " + - "autoAcceptFolloweeFollowRequest=$autoAcceptFolloweeFollowRequest, " + - "lastMigration=$lastMigration, " + - "homeTimelineId=$homeTimelineId" + - ")" + "id=$id, " + + "actorId=$actorId, " + + "password=$password, " + + "autoAcceptFolloweeFollowRequest=$autoAcceptFolloweeFollowRequest, " + + "lastMigration=$lastMigration, " + + "homeTimelineId=$homeTimelineId" + + ")" } companion object { diff --git a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/service/post/DefaultPostReadAccessControl.kt b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/service/post/DefaultPostReadAccessControl.kt index 1af858f5..e9c1c2ad 100644 --- a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/service/post/DefaultPostReadAccessControl.kt +++ b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/service/post/DefaultPostReadAccessControl.kt @@ -39,9 +39,9 @@ class DefaultPostReadAccessControl(private val relationshipRepository: Relations } val relationship = ( - relationshipRepository.findByActorIdAndTargetId(post.actorId, principal.actorId) - ?: Relationship.default(post.actorId, principal.actorId) - ) + relationshipRepository.findByActorIdAndTargetId(post.actorId, principal.actorId) + ?: Relationship.default(post.actorId, principal.actorId) + ) // ブロックされてたら見れない if (relationship.blocking) { diff --git a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedquery/ExposedUserTimelineQueryService.kt b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedquery/ExposedUserTimelineQueryService.kt index c3636879..2198efe2 100644 --- a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedquery/ExposedUserTimelineQueryService.kt +++ b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedquery/ExposedUserTimelineQueryService.kt @@ -53,16 +53,16 @@ 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") } diff --git a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedActorInstanceRelationshipRepository.kt b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedActorInstanceRelationshipRepository.kt index f7b9db9a..967fcc02 100644 --- a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedActorInstanceRelationshipRepository.kt +++ b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedActorInstanceRelationshipRepository.kt @@ -54,7 +54,7 @@ class ExposedActorInstanceRelationshipRepository(override val domainEventPublish query { ActorInstanceRelationships.deleteWhere { actorId eq actorInstanceRelationship.actorId.id and - (instanceId eq actorInstanceRelationship.instanceId.instanceId) + (instanceId eq actorInstanceRelationship.instanceId.instanceId) } onComplete { update(actorInstanceRelationship) @@ -70,7 +70,7 @@ class ExposedActorInstanceRelationshipRepository(override val domainEventPublish .selectAll() .where { ActorInstanceRelationships.actorId eq actorId.id and - (ActorInstanceRelationships.instanceId eq instanceId.instanceId) + (ActorInstanceRelationships.instanceId eq instanceId.instanceId) } .limit(1) .singleOrNull() diff --git a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedRelationshipRepository.kt b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedRelationshipRepository.kt index ef92ea01..7c91af8d 100644 --- a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedRelationshipRepository.kt +++ b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedRelationshipRepository.kt @@ -87,10 +87,10 @@ class ExposedRelationshipRepository(override val domainEventPublisher: DomainEve ): List = query { Relationships.selectAll().where { Relationships.actorId eq actorId.id and ( - Relationships.targetActorId inList targetIds.map { - it.id - } - ) and (Relationships.following eq following) + Relationships.targetActorId inList targetIds.map { + it.id + } + ) and (Relationships.following eq following) }.map { it.toRelationships() } } diff --git a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/springframework/oauth2/HideoutUserDetails.kt b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/springframework/oauth2/HideoutUserDetails.kt index 616868fe..cbaf2540 100644 --- a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/springframework/oauth2/HideoutUserDetails.kt +++ b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/springframework/oauth2/HideoutUserDetails.kt @@ -70,11 +70,11 @@ class HideoutUserDetails( override fun toString(): String { return "HideoutUserDetails(" + - "password='$password', " + - "username='$username', " + - "userDetailsId=$userDetailsId, " + - "authorities=$authorities" + - ")" + "password='$password', " + + "username='$username', " + + "userDetailsId=$userDetailsId, " + + "authorities=$authorities" + + ")" } companion object { diff --git a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/timeline/AbstractTimelineStore.kt b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/timeline/AbstractTimelineStore.kt index 4bdb5534..7cf5b91e 100644 --- a/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/timeline/AbstractTimelineStore.kt +++ b/hideout/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/timeline/AbstractTimelineStore.kt @@ -262,8 +262,8 @@ abstract class AbstractTimelineStore(private val idGenerateService: IdGenerateSe val actors = getActors( timelineObjectList.map { it.postActorId } + - timelineObjectList.mapNotNull { it.repostActorId } + - timelineObjectList.mapNotNull { it.replyActorId } + timelineObjectList.mapNotNull { it.repostActorId } + + timelineObjectList.mapNotNull { it.replyActorId } ) val postMap = posts.associate { post -> @@ -272,7 +272,7 @@ abstract class AbstractTimelineStore(private val idGenerateService: IdGenerateSe val mediaMap = getMedias( posts.flatMap { it.mediaIds } + - actors.mapNotNull { it.value.icon } + actors.mapNotNull { it.value.icon } ) val reactions = getReactions(posts.map { it.id }) diff --git a/hideout/hideout-mastodon/src/main/kotlin/dev/usbharu/hideout/mastodon/infrastructure/exposedquery/ExposedStatusQueryService.kt b/hideout/hideout-mastodon/src/main/kotlin/dev/usbharu/hideout/mastodon/infrastructure/exposedquery/ExposedStatusQueryService.kt index 46ec6b44..93101819 100644 --- a/hideout/hideout-mastodon/src/main/kotlin/dev/usbharu/hideout/mastodon/infrastructure/exposedquery/ExposedStatusQueryService.kt +++ b/hideout/hideout-mastodon/src/main/kotlin/dev/usbharu/hideout/mastodon/infrastructure/exposedquery/ExposedStatusQueryService.kt @@ -59,10 +59,10 @@ class StatusQueryServiceImpl : StatusQueryService { .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") } diff --git a/hideout/hideout-mastodon/src/main/kotlin/dev/usbharu/hideout/mastodon/interfaces/api/StatusesRequest.kt b/hideout/hideout-mastodon/src/main/kotlin/dev/usbharu/hideout/mastodon/interfaces/api/StatusesRequest.kt index 3e4e0b02..9a97d9a5 100644 --- a/hideout/hideout-mastodon/src/main/kotlin/dev/usbharu/hideout/mastodon/interfaces/api/StatusesRequest.kt +++ b/hideout/hideout-mastodon/src/main/kotlin/dev/usbharu/hideout/mastodon/interfaces/api/StatusesRequest.kt @@ -66,8 +66,8 @@ class StatusesRequest { override fun toString(): String { return "StatusesRequest(status=$status, mediaIds=$media_ids, poll=$poll, inReplyToId=$in_reply_to_id, " + - "sensitive=$sensitive, spoilerText=$spoiler_text, visibility=$visibility, language=$language," + - " scheduledAt=$scheduled_at)" + "sensitive=$sensitive, spoilerText=$spoiler_text, visibility=$visibility, language=$language," + + " scheduledAt=$scheduled_at)" } @Suppress("EnumNaming", "EnumEntryNameCase")