This commit is contained in:
usbharu 2023-12-13 16:07:43 +09:00
parent b3723da219
commit 8a7ff91a95
2 changed files with 19 additions and 19 deletions

View File

@ -6,9 +6,9 @@ open class Person
@Suppress("LongParameterList") @Suppress("LongParameterList")
constructor( constructor(
type: List<String> = emptyList(), type: List<String> = emptyList(),
override val name: String, val name: String?,
override val id: String, override val id: String,
var preferredUsername: String?, var preferredUsername: String,
var summary: String?, var summary: String?,
var inbox: String, var inbox: String,
var outbox: String, var outbox: String,
@ -19,7 +19,7 @@ constructor(
var followers: String?, var followers: String?,
var following: String?, var following: String?,
val manuallyApprovesFollowers: Boolean? = false val manuallyApprovesFollowers: Boolean? = false
) : Object(add(type, "Person")), HasId, HasName { ) : Object(add(type, "Person")), HasId {
@Suppress("CyclomaticComplexMethod", "CognitiveComplexMethod") @Suppress("CyclomaticComplexMethod", "CognitiveComplexMethod")
override fun equals(other: Any?): Boolean { override fun equals(other: Any?): Boolean {

View File

@ -96,7 +96,7 @@ class APUserServiceImpl(
name = person.preferredUsername name = person.preferredUsername
?: throw IllegalActivityPubObjectException("preferredUsername is null"), ?: throw IllegalActivityPubObjectException("preferredUsername is null"),
domain = id.substringAfter("://").substringBefore("/"), domain = id.substringAfter("://").substringBefore("/"),
screenName = person.name, screenName = person.name ?: person.preferredUsername,
description = person.summary.orEmpty(), description = person.summary.orEmpty(),
inbox = person.inbox, inbox = person.inbox,
outbox = person.outbox, outbox = person.outbox,