プロフィールの「場所」「誕生日」を連合するように Resove #6461 (#6463)

* AP birthday, location

* unset is null

* isCatを検証対象に
This commit is contained in:
MeiMei 2020-06-21 14:09:01 +09:00 committed by GitHub
parent dc8eb7d4fe
commit 23e2a870cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 2 deletions

View file

@ -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;
}