fix(backend): プロフィールの自己紹介欄のMFMを連合するように(実装漏れ) (#12185)

* (refactor) eliminate nested ternary operation

* fix lint

* Jissou more
This commit is contained in:
かっこかり 2023-10-30 08:20:32 +09:00 committed by GitHub
parent 2de4d3329d
commit 117db08880
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 2 deletions

View File

@ -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,
});