mirror of
https://github.com/usbharu/Hideout.git
synced 2026-08-28 14:34:57 +00:00
feat: usersのinboxにも対応
This commit is contained in:
@@ -41,7 +41,19 @@ fun Routing.inbox(
|
|||||||
call.respond(HttpStatusCode.NotImplemented)
|
call.respond(HttpStatusCode.NotImplemented)
|
||||||
}
|
}
|
||||||
post {
|
post {
|
||||||
call.respond(HttpStatusCode.MethodNotAllowed)
|
if (httpSignatureVerifyService.verify(call.request.headers).not()) {
|
||||||
|
throw HttpSignatureVerifyException()
|
||||||
|
}
|
||||||
|
val json = call.receiveText()
|
||||||
|
val activityTypes = activityPubService.parseActivity(json)
|
||||||
|
val response = activityPubService.processActivity(json, activityTypes)
|
||||||
|
when (response) {
|
||||||
|
is ActivityPubObjectResponse -> call.respond(response.httpStatusCode, Config.configData.objectMapper.writeValueAsString(response.message.apply { context =
|
||||||
|
listOf("https://www.w3.org/ns/activitystreams")
|
||||||
|
}))
|
||||||
|
is ActivityPubStringResponse -> call.respond(response.httpStatusCode, response.message)
|
||||||
|
null -> call.respond(HttpStatusCode.NotImplemented)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user