summaryrefslogtreecommitdiff
path: root/src/remote/activitypub/renderer
diff options
context:
space:
mode:
authorMeiMei <30769358+mei23@users.noreply.github.com>2019-07-18 00:11:39 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2019-07-18 00:11:39 +0900
commitef44eda69eefbdeeb1efee1c8351be081938cae5 (patch)
tree7a83740fbbc3ffec0fe3c661db1f939399e91220 /src/remote/activitypub/renderer
parentResolve #5117 (#5171) (diff)
downloadsharkey-ef44eda69eefbdeeb1efee1c8351be081938cae5.tar.gz
sharkey-ef44eda69eefbdeeb1efee1c8351be081938cae5.tar.bz2
sharkey-ef44eda69eefbdeeb1efee1c8351be081938cae5.zip
Mastodonのリンクの所有者認証に対応 (#5161)
* Profile metadata を設定できるように * API desc
Diffstat (limited to 'src/remote/activitypub/renderer')
-rw-r--r--src/remote/activitypub/renderer/person.ts15
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',