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/models/person.ts | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/remote/activitypub/models') diff --git a/src/remote/activitypub/models/person.ts b/src/remote/activitypub/models/person.ts index 4b8fa9a551..a3093786d0 100644 --- a/src/remote/activitypub/models/person.ts +++ b/src/remote/activitypub/models/person.ts @@ -138,6 +138,8 @@ export async function createPerson(uri: string, resolver?: Resolver): Promise tag.toLowerCase()).splice(0, 32); + const bday = person['vcard:bday']?.match(/^\d{4}-\d{2}-\d{2}/); + const updates = { lastFetchedAt: new Date(), inbox: person.inbox, @@ -356,6 +362,8 @@ export async function updatePerson(uri: string, resolver?: Resolver | null, hint url: getOneApHrefNullable(person.url), fields, description: person.summary ? htmlToMfm(person.summary, person.tag) : null, + birthday: bday ? bday[0] : null, + location: person['vcard:Address'] || null, }); // ハッシュタグ更新 -- cgit v1.2.3-freya