mirror of https://github.com/usbharu/Hideout.git
feat: フォロー承認を取り消しの方法を追加
This commit is contained in:
parent
de5bc691bc
commit
31e69f8141
|
@ -1,8 +1,10 @@
|
||||||
package dev.usbharu.hideout.activitypub.service.activity.undo
|
package dev.usbharu.hideout.activitypub.service.activity.undo
|
||||||
|
|
||||||
|
import dev.usbharu.hideout.activitypub.domain.model.Accept
|
||||||
import dev.usbharu.hideout.activitypub.domain.model.Block
|
import dev.usbharu.hideout.activitypub.domain.model.Block
|
||||||
import dev.usbharu.hideout.activitypub.domain.model.Follow
|
import dev.usbharu.hideout.activitypub.domain.model.Follow
|
||||||
import dev.usbharu.hideout.activitypub.domain.model.Undo
|
import dev.usbharu.hideout.activitypub.domain.model.Undo
|
||||||
|
import dev.usbharu.hideout.activitypub.domain.model.objects.ObjectValue
|
||||||
import dev.usbharu.hideout.activitypub.service.common.AbstractActivityPubProcessor
|
import dev.usbharu.hideout.activitypub.service.common.AbstractActivityPubProcessor
|
||||||
import dev.usbharu.hideout.activitypub.service.common.ActivityPubProcessContext
|
import dev.usbharu.hideout.activitypub.service.common.ActivityPubProcessContext
|
||||||
import dev.usbharu.hideout.activitypub.service.common.ActivityType
|
import dev.usbharu.hideout.activitypub.service.common.ActivityType
|
||||||
|
@ -50,6 +52,25 @@ class APUndoProcessor(
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
"Accept" -> {
|
||||||
|
val accept = undo.apObject as Accept
|
||||||
|
|
||||||
|
|
||||||
|
val acceptObject = if (accept.apObject is ObjectValue) {
|
||||||
|
accept.apObject.`object`
|
||||||
|
} else if (accept.apObject is Follow) {
|
||||||
|
accept.apObject.apObject
|
||||||
|
} else {
|
||||||
|
logger.warn("FAILED Unsupported type. Undo Accept {}", accept.apObject.type)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
val accepter = apUserService.fetchPersonWithEntity(undo.actor, acceptObject).second
|
||||||
|
val target = userQueryService.findByUrl(acceptObject)
|
||||||
|
|
||||||
|
relationshipService.rejectFollowRequest(accepter.id, target.id)
|
||||||
|
}
|
||||||
|
|
||||||
else -> {}
|
else -> {}
|
||||||
}
|
}
|
||||||
TODO()
|
TODO()
|
||||||
|
|
Loading…
Reference in New Issue