mirror of https://github.com/usbharu/Hideout.git
fix: 軽微な修正、ロガーを追加
This commit is contained in:
parent
e4046b5c77
commit
4ac23c225a
|
@ -31,10 +31,11 @@ fun Routing.usersAP(activityPubUserService: ActivityPubUserService, userService:
|
|||
}
|
||||
|
||||
class ContentTypeRouteSelector(private vararg val contentType: ContentType) : RouteSelector() {
|
||||
override fun evaluate(context: RoutingResolveContext, segmentIndex: Int): RouteSelectorEvaluation {
|
||||
override fun evaluate(context: RoutingResolveContext, segmentIndex: Int): RouteSelectorEvaluation {
|
||||
|
||||
val requestContentType =
|
||||
ContentType.parse(context.call.request.accept() ?: return RouteSelectorEvaluation.FailedParameter)
|
||||
context.call.application.log.debug("Content-Type: {}", contentType)
|
||||
return if (contentType.any { contentType -> contentType.match(requestContentType) }) {
|
||||
RouteSelectorEvaluation.Constant
|
||||
} else {
|
||||
|
|
|
@ -45,7 +45,7 @@ class ActivityPubNoteServiceImpl(
|
|||
attributedTo = actor,
|
||||
content = postEntity.text,
|
||||
published = Instant.ofEpochMilli(postEntity.createdAt).toString(),
|
||||
to = listOf("https://www.w3.org/ns/activitystreams#Public", actor + "/followers")
|
||||
to = listOf("https://www.w3.org/ns/activitystreams#Public", actor + "/follower")
|
||||
)
|
||||
val inbox = props[DeliverPostJob.inbox]
|
||||
logger.debug("createNoteJob: actor={}, note={}, inbox={}", actor, postEntity, inbox)
|
||||
|
|
|
@ -89,7 +89,7 @@ class ActivityPubUserServiceImpl(
|
|||
RemoteUserCreateDto(
|
||||
name = person.preferredUsername
|
||||
?: throw IllegalActivityPubObjectException("preferredUsername is null"),
|
||||
domain = url.substringAfter("://").substringBefore("/"),
|
||||
domain = url.substringAfter("://").substringBeforeLast("/"),
|
||||
screenName = (person.name ?: person.preferredUsername) ?: throw IllegalActivityPubObjectException("preferredUsername is null"),
|
||||
description = person.summary ?: "",
|
||||
inbox = person.inbox ?: throw IllegalActivityPubObjectException("inbox is null"),
|
||||
|
|
Loading…
Reference in New Issue