enhance(federation/profile): 相互リンクのテキストが連合するように (MisskeyIO#705)
This commit is contained in:
parent
f11d0461d7
commit
08fcb3b3fa
@ -466,7 +466,7 @@ export class ApRendererService {
|
||||
this.userProfilesRepository.findOneByOrFail({ userId: user.id }),
|
||||
]);
|
||||
|
||||
const attachment = profile.fields.map(field => ({
|
||||
const profileFields = profile.fields.map(field => ({
|
||||
type: 'PropertyValue',
|
||||
name: field.name,
|
||||
value: (field.value.startsWith('http://') || field.value.startsWith('https://'))
|
||||
@ -474,6 +474,16 @@ export class ApRendererService {
|
||||
: 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 apemojis = emojis.filter(emoji => !emoji.localOnly).map(emoji => this.renderEmoji(emoji));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user