diff options
Diffstat (limited to 'src/remote/activitypub')
| -rw-r--r-- | src/remote/activitypub/renderer/person.ts | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/remote/activitypub/renderer/person.ts b/src/remote/activitypub/renderer/person.ts index efe52cdefb..d4c018fb78 100644 --- a/src/remote/activitypub/renderer/person.ts +++ b/src/remote/activitypub/renderer/person.ts @@ -21,13 +21,24 @@ export async function renderPerson(user: ILocalUser) { ]); const attachment: { - type: string, + type: 'PropertyValue', name: string, value: string, - verified_at?: string, identifier?: IIdentifier }[] = []; + if (profile.fields) { + for (const field of profile.fields) { + attachment.push({ + type: 'PropertyValue', + name: field.name, + value: (field.value != null && field.value.match(/^https?:/)) + ? `<a href="${new URL(field.value).href}" rel="me nofollow noopener" target="_blank">${new URL(field.value).href}</a>` + : field.value + }); + } + } + if (profile.twitter) { attachment.push({ type: 'PropertyValue', |