Skip to content

Commit

Permalink
fix(backend): プロフィールの自己紹介欄のMFMを連合するように (misskey-dev#12184)
Browse files Browse the repository at this point in the history
  • Loading branch information
u1-liquid committed Oct 29, 2023
1 parent 42bc281 commit c3a9c5e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/backend/src/core/activitypub/ApRendererService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@ export class ApRendererService {
preferredUsername: user.username,
name: user.name,
summary: profile.description ? this.mfmService.toHtml(mfm.parse(profile.description)) : null,
_misskey_summary: profile.description,
icon: avatar ? this.renderImage(avatar) : null,
image: banner ? this.renderImage(banner) : null,
tag,
Expand Down Expand Up @@ -645,6 +646,7 @@ export class ApRendererService {
'_misskey_quote': 'misskey:_misskey_quote',
'_misskey_reaction': 'misskey:_misskey_reaction',
'_misskey_votes': 'misskey:_misskey_votes',
'_misskey_summary': 'misskey:_misskey_summary',
'isCat': 'misskey:isCat',
// vcard
vcard: 'http://www.w3.org/2006/vcard/ns#',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ export class ApPersonService implements OnModuleInit {

await transactionalEntityManager.save(new MiUserProfile({
userId: user.id,
description: person.summary ? this.apMfmService.htmlToMfm(truncate(person.summary, summaryLength), person.tag) : null,
description: person._misskey_summary ? truncate(person._misskey_summary, summaryLength) : person.summary ? this.apMfmService.htmlToMfm(truncate(person.summary, summaryLength), person.tag) : null,
url,
fields,
birthday: bday?.[0] ?? null,
Expand Down
1 change: 1 addition & 0 deletions packages/backend/src/core/activitypub/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export interface IObject {
id?: string;
name?: string | null;
summary?: string;
_misskey_summary?: string;
published?: string;
cc?: ApObject;
to?: ApObject;
Expand Down

0 comments on commit c3a9c5e

Please sign in to comment.