diff --git a/src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Accept.kt b/src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Accept.kt index 13f6a31d..67a8ed0f 100644 --- a/src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Accept.kt +++ b/src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Accept.kt @@ -38,9 +38,9 @@ open class Accept @JsonCreator constructor( override fun toString(): String { return "Accept(" + - "apObject=$apObject, " + - "actor='$actor'" + - ")" + - " ${super.toString()}" + "apObject=$apObject, " + + "actor='$actor'" + + ")" + + " ${super.toString()}" } } diff --git a/src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Block.kt b/src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Block.kt index b1bde6d5..88a7b319 100644 --- a/src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Block.kt +++ b/src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Block.kt @@ -34,12 +34,10 @@ open class Block( override fun toString(): String { return "Block(" + - "actor='$actor', " + - "id='$id', " + - "apObject='$apObject'" + - ")" + - " ${super.toString()}" + "actor='$actor', " + + "id='$id', " + + "apObject='$apObject'" + + ")" + + " ${super.toString()}" } - - } diff --git a/src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Create.kt b/src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Create.kt index 3a27e800..2cbc9a3c 100644 --- a/src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Create.kt +++ b/src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Create.kt @@ -51,13 +51,13 @@ open class Create( override fun toString(): String { return "Create(" + - "name=$name, " + - "apObject=$apObject, " + - "actor='$actor', " + - "id='$id', " + - "to=$to, " + - "cc=$cc" + - ")" + - " ${super.toString()}" + "name=$name, " + + "apObject=$apObject, " + + "actor='$actor', " + + "id='$id', " + + "to=$to, " + + "cc=$cc" + + ")" + + " ${super.toString()}" } } diff --git a/src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Reject.kt b/src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Reject.kt index fd0e980e..82cb5b8a 100644 --- a/src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Reject.kt +++ b/src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Reject.kt @@ -34,12 +34,10 @@ open class Reject( override fun toString(): String { return "Reject(" + - "actor='$actor', " + - "id='$id', " + - "apObject=$apObject" + - ")" + - " ${super.toString()}" + "actor='$actor', " + + "id='$id', " + + "apObject=$apObject" + + ")" + + " ${super.toString()}" } - - } diff --git a/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/accept/ApSendAcceptService.kt b/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/accept/ApSendAcceptService.kt index ab364c06..35270235 100644 --- a/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/accept/ApSendAcceptService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/accept/ApSendAcceptService.kt @@ -32,5 +32,4 @@ class ApSendAcceptServiceImpl( jobQueueParentService.scheduleTypeSafe(deliverAcceptJob, deliverAcceptJobParam) } - } diff --git a/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/block/APDeliverBlockJobProcessor.kt b/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/block/APDeliverBlockJobProcessor.kt index 37236c0f..a97a0f19 100644 --- a/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/block/APDeliverBlockJobProcessor.kt +++ b/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/block/APDeliverBlockJobProcessor.kt @@ -19,7 +19,6 @@ class APDeliverBlockJobProcessor( private val deliverBlockJob: DeliverBlockJob ) : JobProcessor { override suspend fun process(param: DeliverBlockJobParam): Unit = transaction.transaction { - val signer = userRepository.findById(param.signer) apRequestService.apPost( param.inbox, diff --git a/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/block/BlockActivityPubProcessor.kt b/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/block/BlockActivityPubProcessor.kt index fa67be3d..075bf893 100644 --- a/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/block/BlockActivityPubProcessor.kt +++ b/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/block/BlockActivityPubProcessor.kt @@ -9,7 +9,6 @@ import dev.usbharu.hideout.core.query.UserQueryService import dev.usbharu.hideout.core.service.relationship.RelationshipService import org.springframework.stereotype.Service - /** * ブロックアクティビティを処理します */ diff --git a/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/reject/ApSendRejectServiceImpl.kt b/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/reject/ApSendRejectServiceImpl.kt index ded3c2a5..fb7610bb 100644 --- a/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/reject/ApSendRejectServiceImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/reject/ApSendRejectServiceImpl.kt @@ -16,7 +16,6 @@ class ApSendRejectServiceImpl( private val deliverRejectJob: DeliverRejectJob ) : ApSendRejectService { override suspend fun sendRejectFollow(user: User, target: User) { - val deliverRejectJobParam = DeliverRejectJobParam( Reject( user.url, diff --git a/src/main/kotlin/dev/usbharu/hideout/core/domain/model/relationship/RelationshipRepositoryImpl.kt b/src/main/kotlin/dev/usbharu/hideout/core/domain/model/relationship/RelationshipRepositoryImpl.kt index bb0513e6..8507cbc1 100644 --- a/src/main/kotlin/dev/usbharu/hideout/core/domain/model/relationship/RelationshipRepositoryImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/core/domain/model/relationship/RelationshipRepositoryImpl.kt @@ -57,7 +57,6 @@ class RelationshipRepositoryImpl : RelationshipRepository { }.singleOrNull() ?.toRelationships() } - } fun ResultRow.toRelationships(): Relationship = Relationship( diff --git a/src/main/kotlin/dev/usbharu/hideout/core/external/job/DeliverBlockJob.kt b/src/main/kotlin/dev/usbharu/hideout/core/external/job/DeliverBlockJob.kt index 3e8688b9..988b5b1a 100644 --- a/src/main/kotlin/dev/usbharu/hideout/core/external/job/DeliverBlockJob.kt +++ b/src/main/kotlin/dev/usbharu/hideout/core/external/job/DeliverBlockJob.kt @@ -49,6 +49,4 @@ class DeliverBlockJob(@Qualifier("activitypub") private val objectMapper: Object objectMapper.readValue(props[reject]), props[inbox] ) - - } diff --git a/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedquery/FollowerQueryServiceImpl.kt b/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedquery/FollowerQueryServiceImpl.kt index f8c6bb6e..df5acb77 100644 --- a/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedquery/FollowerQueryServiceImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedquery/FollowerQueryServiceImpl.kt @@ -15,7 +15,8 @@ class FollowerQueryServiceImpl( ) : FollowerQueryService { override suspend fun findFollowersById(id: Long): List { return userQueryService.findByIds( - relationshipQueryService.findByTargetIdAndFollowing(id, true).map { it.userId }) + relationshipQueryService.findByTargetIdAndFollowing(id, true).map { it.userId } + ) } override suspend fun alreadyFollow(userId: Long, followerId: Long): Boolean = diff --git a/src/main/kotlin/dev/usbharu/hideout/core/service/relationship/RelationshipService.kt b/src/main/kotlin/dev/usbharu/hideout/core/service/relationship/RelationshipService.kt index 64dcb536..9032bd2e 100644 --- a/src/main/kotlin/dev/usbharu/hideout/core/service/relationship/RelationshipService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/core/service/relationship/RelationshipService.kt @@ -19,5 +19,4 @@ interface RelationshipService { suspend fun unblock(userId: Long, targetId: Long) suspend fun mute(userId: Long, targetId: Long) suspend fun unmute(userId: Long, targetId: Long) - } diff --git a/src/main/kotlin/dev/usbharu/hideout/core/service/relationship/RelationshipServiceImpl.kt b/src/main/kotlin/dev/usbharu/hideout/core/service/relationship/RelationshipServiceImpl.kt index 39987141..bea66075 100644 --- a/src/main/kotlin/dev/usbharu/hideout/core/service/relationship/RelationshipServiceImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/core/service/relationship/RelationshipServiceImpl.kt @@ -79,7 +79,7 @@ class RelationshipServiceImpl( val user = userQueryService.findById(userId) apSendFollowService.sendFollow(SendFollowDto(user, remoteUser)) } else { - //TODO: フォロー許可制ユーザーを実装したら消す + // TODO: フォロー許可制ユーザーを実装したら消す acceptFollowRequest(targetId, userId) } @@ -135,12 +135,16 @@ class RelationshipServiceImpl( if (relationship.blocking) { logger.warn("FAILED Blocking user userId: {} targetId: {}", userId, targetId) - throw IllegalStateException("Cannot accept a follow request from a blocked user. userId: $userId targetId: $targetId") + throw IllegalStateException( + "Cannot accept a follow request from a blocked user. userId: $userId targetId: $targetId" + ) } if (inverseRelationship.blocking) { logger.warn("FAILED BLocked by user userId: {} targetId: {}", userId, targetId) - throw IllegalStateException("Cannot accept a follow request from a blocking user. userId: $userId targetId: $targetId") + throw IllegalStateException( + "Cannot accept a follow request from a blocking user. userId: $userId targetId: $targetId" + ) } val copy = relationship.copy(followRequest = false, following = true, blocking = false) @@ -237,7 +241,6 @@ class RelationshipServiceImpl( val copy = relationship.copy(blocking = false) relationshipRepository.save(copy) - val remoteUser = isRemoteUser(targetId) if (remoteUser != null) { val user = userQueryService.findById(userId)