enhance(federation/profile): 相互リンクのテキストが連合するように (MisskeyIO#705)
This commit is contained in:
parent
f11d0461d7
commit
08fcb3b3fa
1 changed files with 11 additions and 1 deletions
|
@ -466,7 +466,7 @@ export class ApRendererService {
|
||||||
this.userProfilesRepository.findOneByOrFail({ userId: user.id }),
|
this.userProfilesRepository.findOneByOrFail({ userId: user.id }),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const attachment = profile.fields.map(field => ({
|
const profileFields = profile.fields.map(field => ({
|
||||||
type: 'PropertyValue',
|
type: 'PropertyValue',
|
||||||
name: field.name,
|
name: field.name,
|
||||||
value: (field.value.startsWith('http://') || field.value.startsWith('https://'))
|
value: (field.value.startsWith('http://') || field.value.startsWith('https://'))
|
||||||
|
@ -474,6 +474,16 @@ export class ApRendererService {
|
||||||
: field.value,
|
: field.value,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
const mutualLinks = profile.mutualLinkSections.flatMap(section =>
|
||||||
|
section.mutualLinks.map(link => ({
|
||||||
|
type: 'PropertyValue',
|
||||||
|
name: section.name ?? link.description ?? 'Link',
|
||||||
|
value: `<a href="${link.url}" target="_blank">${link.description ?? link.url}</a>`,
|
||||||
|
})),
|
||||||
|
);
|
||||||
|
|
||||||
|
const attachment = mutualLinks.concat(profileFields);
|
||||||
|
|
||||||
const emojis = await this.getEmojis(user.emojis);
|
const emojis = await this.getEmojis(user.emojis);
|
||||||
const apemojis = emojis.filter(emoji => !emoji.localOnly).map(emoji => this.renderEmoji(emoji));
|
const apemojis = emojis.filter(emoji => !emoji.localOnly).map(emoji => this.renderEmoji(emoji));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue