fix: ブロックされたときブロックされたactorからブロックしたactorへのフォローを解除するように

This commit is contained in:
usbharu 2023-12-11 11:41:56 +09:00
parent 2dd0bfcb8d
commit 686fecf0bc
2 changed files with 8 additions and 2 deletions

View File

@ -23,7 +23,7 @@ class RelationshipRepositoryImpl : RelationshipRepository {
it[targetUserId] = relationship.targetUserId it[targetUserId] = relationship.targetUserId
it[following] = relationship.following it[following] = relationship.following
it[blocking] = relationship.blocking it[blocking] = relationship.blocking
it[muting] = relationship.blocking it[muting] = relationship.muting
it[followRequest] = relationship.followRequest it[followRequest] = relationship.followRequest
it[ignoreFollowRequestFromTarget] = relationship.ignoreFollowRequestFromTarget it[ignoreFollowRequestFromTarget] = relationship.ignoreFollowRequestFromTarget
} }
@ -35,7 +35,7 @@ class RelationshipRepositoryImpl : RelationshipRepository {
}) { }) {
it[following] = relationship.following it[following] = relationship.following
it[blocking] = relationship.blocking it[blocking] = relationship.blocking
it[muting] = relationship.blocking it[muting] = relationship.muting
it[followRequest] = relationship.followRequest it[followRequest] = relationship.followRequest
it[ignoreFollowRequestFromTarget] = relationship.ignoreFollowRequestFromTarget it[ignoreFollowRequestFromTarget] = relationship.ignoreFollowRequestFromTarget
} }

View File

@ -98,7 +98,13 @@ class RelationshipServiceImpl(
ignoreFollowRequestFromTarget = false ignoreFollowRequestFromTarget = false
) )
val inverseRelationship = relationshipRepository.findByUserIdAndTargetUserId(targetId, userId)
?.copy(followRequest = false, following = false)
relationshipRepository.save(relationship) relationshipRepository.save(relationship)
if (inverseRelationship != null) {
relationshipRepository.save(inverseRelationship)
}
val remoteUser = isRemoteUser(targetId) val remoteUser = isRemoteUser(targetId)