mirror of https://github.com/usbharu/Hideout.git
fix: nameがnullのときpreferredUsernameを変わりに使用するように
This commit is contained in:
parent
ced1abe69c
commit
a19b448df2
|
@ -16,6 +16,7 @@ import io.ktor.client.*
|
|||
import io.ktor.client.request.*
|
||||
import io.ktor.client.statement.*
|
||||
import io.ktor.http.*
|
||||
import org.slf4j.LoggerFactory
|
||||
|
||||
class ActivityPubUserServiceImpl(
|
||||
private val userService: UserService,
|
||||
|
@ -23,6 +24,8 @@ class ActivityPubUserServiceImpl(
|
|||
private val httpClient: HttpClient
|
||||
) :
|
||||
ActivityPubUserService {
|
||||
|
||||
private val logger = LoggerFactory.getLogger(this::class.java)
|
||||
override suspend fun getPersonByName(name: String): Person {
|
||||
// TODO: JOINで書き直し
|
||||
val userEntity = userService.findByName(name)
|
||||
|
@ -91,7 +94,7 @@ class ActivityPubUserServiceImpl(
|
|||
name = person.preferredUsername
|
||||
?: throw IllegalActivityPubObjectException("preferredUsername is null"),
|
||||
domain = url.substringAfter(":").substringBeforeLast("/"),
|
||||
screenName = person.name ?: throw IllegalActivityPubObjectException("name is null"),
|
||||
screenName = (person.name ?: person.preferredUsername) ?: throw IllegalActivityPubObjectException("preferredUsername is null"),
|
||||
description = person.summary ?: throw IllegalActivityPubObjectException("summary is null"),
|
||||
inbox = person.inbox ?: throw IllegalActivityPubObjectException("inbox is null"),
|
||||
outbox = person.outbox ?: throw IllegalActivityPubObjectException("outbox is null"),
|
||||
|
|
|
@ -9,4 +9,6 @@
|
|||
</root>
|
||||
<logger name="org.eclipse.jetty" level="INFO"/>
|
||||
<logger name="io.netty" level="INFO"/>
|
||||
<logger name="kjob.core.internal.scheduler.JobServiceImpl" level="INFO"/>
|
||||
<logger name="Exposed" level="INFO"/>
|
||||
</configuration>
|
||||
|
|
Loading…
Reference in New Issue