diff --git a/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/undo/APUndoProcessor.kt b/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/undo/APUndoProcessor.kt index 7e5b8583..21734428 100644 --- a/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/undo/APUndoProcessor.kt +++ b/src/main/kotlin/dev/usbharu/hideout/activitypub/service/activity/undo/APUndoProcessor.kt @@ -10,7 +10,6 @@ import dev.usbharu.hideout.activitypub.service.objects.user.APUserService import dev.usbharu.hideout.application.external.Transaction import dev.usbharu.hideout.core.query.UserQueryService import dev.usbharu.hideout.core.service.relationship.RelationshipService -import dev.usbharu.hideout.core.service.user.UserService import org.springframework.stereotype.Service @Service @@ -18,18 +17,14 @@ class APUndoProcessor( transaction: Transaction, private val apUserService: APUserService, private val userQueryService: UserQueryService, - private val userService: UserService, private val relationshipService: RelationshipService ) : AbstractActivityPubProcessor(transaction) { override suspend fun internalProcess(activity: ActivityPubProcessContext) { val undo = activity.activity - if (undo.actor == null) { - return - } val type = - undo.apObject.type.orEmpty() + undo.apObject.type .firstOrNull { it == "Block" || it == "Follow" || it == "Like" || it == "Announce" || it == "Accept" } ?: return 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 8507cbc1..a8bfd6de 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 @@ -60,13 +60,13 @@ class RelationshipRepositoryImpl : RelationshipRepository { } fun ResultRow.toRelationships(): Relationship = Relationship( - this[Relationships.userId], - this[Relationships.targetUserId], - this[Relationships.following], - this[Relationships.blocking], - this[Relationships.muting], - this[Relationships.followRequest], - this[Relationships.ignoreFollowRequestFromTarget] + userId = this[Relationships.userId], + targetUserId = this[Relationships.targetUserId], + following = this[Relationships.following], + blocking = this[Relationships.blocking], + muting = this[Relationships.muting], + followRequest = this[Relationships.followRequest], + ignoreFollowRequestFromTarget = this[Relationships.ignoreFollowRequestFromTarget] ) object Relationships : LongIdTable("relationships") { diff --git a/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/kjobexposed/KJobJobQueueWorkerService.kt b/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/kjobexposed/KJobJobQueueWorkerService.kt index 9bd19351..28b437c6 100644 --- a/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/kjobexposed/KJobJobQueueWorkerService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/kjobexposed/KJobJobQueueWorkerService.kt @@ -36,6 +36,7 @@ class KJobJobQueueWorkerService(private val jobQueueProcessorList: List("uid").toLong() val statusFlow = accountApiService.accountsStatuses( - id.toLong(), - maxId?.toLongOrNull(), - sinceId?.toLongOrNull(), - minId?.toLongOrNull(), - limit, - onlyMedia, - excludeReplies, - excludeReblogs, - pinned, - tagged, - userid + userid = id.toLong(), + maxId = maxId?.toLongOrNull(), + sinceId = sinceId?.toLongOrNull(), + minId = minId?.toLongOrNull(), + limit = limit, + onlyMedia = onlyMedia, + excludeReplies = excludeReplies, + excludeReblogs = excludeReblogs, + pinned = pinned, + tagged = tagged, + loginUser = userid ).asFlow() ResponseEntity.ok(statusFlow) } 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 6a3d47f9..3a0f22bc 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 @@ -13,6 +13,7 @@ import kotlin.math.min @Service interface AccountApiService { + @Suppress("LongParameterList") suspend fun accountsStatuses( userid: Long, maxId: Long?, @@ -76,17 +77,17 @@ class AccountApiServiceImpl( return transaction.transaction { statusQueryService.accountsStatus( - userid, - maxId, - sinceId, - minId, - limit, - onlyMedia, - excludeReplies, - excludeReblogs, - pinned, - tagged, - canViewFollowers + accountId = userid, + maxId = maxId, + sinceId = sinceId, + minId = minId, + limit = limit, + onlyMedia = onlyMedia, + excludeReplies = excludeReplies, + excludeReblogs = excludeReblogs, + pinned = pinned, + tagged = tagged, + includeFollowers = canViewFollowers ) } } diff --git a/src/main/kotlin/dev/usbharu/hideout/mastodon/service/app/AppApiService.kt b/src/main/kotlin/dev/usbharu/hideout/mastodon/service/app/AppApiService.kt index 7324dd33..c2139a27 100644 --- a/src/main/kotlin/dev/usbharu/hideout/mastodon/service/app/AppApiService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/mastodon/service/app/AppApiService.kt @@ -55,12 +55,12 @@ class AppApiServiceImpl( registeredClientRepository.save(registeredClient) Application( - appsRequest.clientName, - "invalid-vapid-key", - appsRequest.website, - id, - clientSecret, - appsRequest.redirectUris + name = appsRequest.clientName, + vapidKey = "invalid-vapid-key", + website = appsRequest.website, + clientId = id, + clientSecret = clientSecret, + redirectUri = appsRequest.redirectUris ) } } diff --git a/src/test/kotlin/dev/usbharu/hideout/core/service/user/UserServiceTest.kt b/src/test/kotlin/dev/usbharu/hideout/core/service/user/UserServiceTest.kt index 65a88e8b..c524a0f5 100644 --- a/src/test/kotlin/dev/usbharu/hideout/core/service/user/UserServiceTest.kt +++ b/src/test/kotlin/dev/usbharu/hideout/core/service/user/UserServiceTest.kt @@ -37,8 +37,6 @@ class UserServiceTest { userRepository, userAuthService, mock(), - mock(), - mock(), userBuilder, testApplicationConfig, mock() @@ -68,7 +66,7 @@ class UserServiceTest { onBlocking { nextId() } doReturn 113345L } val userService = - UserServiceImpl(userRepository, mock(), mock(), mock(), mock(), userBuilder, testApplicationConfig, mock()) + UserServiceImpl(userRepository, mock(), mock(), userBuilder, testApplicationConfig, mock()) val user = RemoteUserCreateDto( name = "test", domain = "remote.example.com",