diff --git a/packages/backend/src/core/activitypub/models/ApPersonService.ts b/packages/backend/src/core/activitypub/models/ApPersonService.ts index 7164feec9d..d6a7de0601 100644 --- a/packages/backend/src/core/activitypub/models/ApPersonService.ts +++ b/packages/backend/src/core/activitypub/models/ApPersonService.ts @@ -319,9 +319,17 @@ export class ApPersonService implements OnModuleInit { emojis, })) as MiRemoteUser; + let _description: string | null = null; + + if (person._misskey_summary) { + _description = truncate(person._misskey_summary, summaryLength); + } else if (person.summary) { + _description = this.apMfmService.htmlToMfm(truncate(person.summary, summaryLength), person.tag); + } + await transactionalEntityManager.save(new MiUserProfile({ userId: user.id, - description: person._misskey_summary ? truncate(person._misskey_summary, summaryLength) : person.summary ? this.apMfmService.htmlToMfm(truncate(person.summary, summaryLength), person.tag) : null, + description: _description, url, fields, birthday: bday?.[0] ?? null, @@ -487,10 +495,18 @@ export class ApPersonService implements OnModuleInit { }); } + let _description: string | null = null; + + if (person._misskey_summary) { + _description = truncate(person._misskey_summary, summaryLength); + } else if (person.summary) { + _description = this.apMfmService.htmlToMfm(truncate(person.summary, summaryLength), person.tag); + } + await this.userProfilesRepository.update({ userId: exist.id }, { url, fields, - description: person.summary ? this.apMfmService.htmlToMfm(truncate(person.summary, summaryLength), person.tag) : null, + description: _description, birthday: bday?.[0] ?? null, location: person['vcard:Address'] ?? null, });