From 95ba7e43b1370a0233b03d63dd1b13247aba219c Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 24 Nov 2018 17:29:32 +0900 Subject: [PATCH] =?UTF-8?q?Fix=20bug:=20=E3=83=AA=E3=83=A2=E3=83=BC?= =?UTF-8?q?=E3=83=88=E3=83=A6=E3=83=BC=E3=82=B6=E3=83=BC=E3=81=AE=E3=82=A2?= =?UTF-8?q?=E3=82=A4=E3=82=B3=E3=83=B3=E3=81=A8=E3=83=90=E3=83=8A=E3=83=BC?= =?UTF-8?q?=E3=81=AE=E8=89=B2=E3=81=8C=E5=8F=96=E5=BE=97=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=81=A6=E3=81=84=E3=81=AA=E3=81=84=E5=95=8F=E9=A1=8C=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/models/user.ts | 2 ++ src/remote/activitypub/models/person.ts | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/models/user.ts b/src/models/user.ts index bea0261dc..241af892a 100644 --- a/src/models/user.ts +++ b/src/models/user.ts @@ -38,6 +38,8 @@ type IUserBase = { bannerId: mongo.ObjectID; avatarUrl?: string; bannerUrl?: string; + avatarColor?: any; + bannerColor?: any; wallpaperId: mongo.ObjectID; wallpaperUrl?: string; data: any; diff --git a/src/remote/activitypub/models/person.ts b/src/remote/activitypub/models/person.ts index b2ca2ecca..6f694a6ec 100644 --- a/src/remote/activitypub/models/person.ts +++ b/src/remote/activitypub/models/person.ts @@ -212,13 +212,17 @@ export async function createPerson(uri: string, resolver?: Resolver): Promise console.log(err)); @@ -306,6 +312,8 @@ export async function updatePerson(uri: string, resolver?: Resolver, hint?: obje bannerId: banner ? banner._id : null, avatarUrl: getDriveFileUrl(avatar, true), bannerUrl: getDriveFileUrl(banner, false), + avatarColor: avatar && avatar.metadata.properties.avgColor ? avatar.metadata.properties.avgColor : null, + bannerColor: banner && banner.metadata.properties.avgColor ? banner.metadata.properties.avgColor : null, description: htmlToMFM(person.summary), followersCount, followingCount,