fix(backend): プロフィールの自己紹介欄のMFMを連合するように(実装漏れ) (#12185)
* (refactor) eliminate nested ternary operation * fix lint * Jissou more
This commit is contained in:
parent
2de4d3329d
commit
117db08880
|
@ -319,9 +319,17 @@ export class ApPersonService implements OnModuleInit {
|
||||||
emojis,
|
emojis,
|
||||||
})) as MiRemoteUser;
|
})) 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({
|
await transactionalEntityManager.save(new MiUserProfile({
|
||||||
userId: user.id,
|
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,
|
url,
|
||||||
fields,
|
fields,
|
||||||
birthday: bday?.[0] ?? null,
|
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 }, {
|
await this.userProfilesRepository.update({ userId: exist.id }, {
|
||||||
url,
|
url,
|
||||||
fields,
|
fields,
|
||||||
description: person.summary ? this.apMfmService.htmlToMfm(truncate(person.summary, summaryLength), person.tag) : null,
|
description: _description,
|
||||||
birthday: bday?.[0] ?? null,
|
birthday: bday?.[0] ?? null,
|
||||||
location: person['vcard:Address'] ?? null,
|
location: person['vcard:Address'] ?? null,
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue