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,