From 23e2a870cc4327f27abb269e85d7a7b1daf2ae54 Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Sun, 21 Jun 2020 14:09:01 +0900 Subject: プロフィールの「場所」「誕生日」を連合するように Resove #6461 (#6463) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * AP birthday, location * unset is null * isCatを検証対象に --- src/remote/activitypub/renderer/index.ts | 3 +++ src/remote/activitypub/renderer/person.ts | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'src/remote/activitypub/renderer') diff --git a/src/remote/activitypub/renderer/index.ts b/src/remote/activitypub/renderer/index.ts index e84a7d90ac..cf0fd8d85a 100644 --- a/src/remote/activitypub/renderer/index.ts +++ b/src/remote/activitypub/renderer/index.ts @@ -49,6 +49,9 @@ export const attachLdSignature = async (activity: any, user: ILocalUser): Promis '_misskey_reaction': 'misskey:_misskey_reaction', '_misskey_votes': 'misskey:_misskey_votes', '_misskey_talk': 'misskey:_misskey_talk', + 'isCat': 'misskey:isCat', + // vcard + vcard: 'http://www.w3.org/2006/vcard/ns#', }; activity['@context'].push(obj); diff --git a/src/remote/activitypub/renderer/person.ts b/src/remote/activitypub/renderer/person.ts index bc8a462d2e..87dca19acd 100644 --- a/src/remote/activitypub/renderer/person.ts +++ b/src/remote/activitypub/renderer/person.ts @@ -52,7 +52,7 @@ export async function renderPerson(user: ILocalUser) { const keypair = await UserKeypairs.findOne(user.id).then(ensure); - return { + const person = { type: isSystem ? 'Application' : user.isBot ? 'Service' : 'Person', id, inbox: `${id}/inbox`, @@ -73,5 +73,15 @@ export async function renderPerson(user: ILocalUser) { publicKey: renderKey(user, keypair, `#main-key`), isCat: user.isCat, attachment: attachment.length ? attachment : undefined - }; + } as any; + + if (profile?.birthday) { + person['vcard:bday'] = profile.birthday; + } + + if (profile?.location) { + person['vcard:Address'] = profile.location; + } + + return person; } -- cgit v1.2.3-freya