mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-01 01:32:09 +01:00
parent
f0b08d3936
commit
0875460974
2 changed files with 4 additions and 4 deletions
|
@ -166,8 +166,8 @@ export async function createPerson(value: any, resolver?: Resolver): Promise<IUs
|
|||
|
||||
const avatarId = avatar ? avatar._id : null;
|
||||
const bannerId = banner ? banner._id : null;
|
||||
const avatarUrl = avatar && avatar.metadata.url ? avatar.metadata.url : null;
|
||||
const bannerUrl = banner && banner.metadata.url ? banner.metadata.url : null;
|
||||
const avatarUrl = (avatar && avatar.metadata.thumbnailUrl) ? avatar.metadata.thumbnailUrl : (avatar && avatar.metadata.url) ? avatar.metadata.url : null;
|
||||
const bannerUrl = (banner && banner.metadata.url) ? banner.metadata.url : null;
|
||||
|
||||
await User.update({ _id: user._id }, {
|
||||
$set: {
|
||||
|
@ -255,7 +255,7 @@ export async function updatePerson(value: string | IObject, resolver?: Resolver)
|
|||
sharedInbox: person.sharedInbox,
|
||||
avatarId: avatar ? avatar._id : null,
|
||||
bannerId: banner ? banner._id : null,
|
||||
avatarUrl: avatar && avatar.metadata.url ? avatar.metadata.url : null,
|
||||
avatarUrl: (avatar && avatar.metadata.thumbnailUrl) ? avatar.metadata.thumbnailUrl : (avatar && avatar.metadata.url) ? avatar.metadata.url : null,
|
||||
bannerUrl: banner && banner.metadata.url ? banner.metadata.url : null,
|
||||
description: htmlToMFM(person.summary),
|
||||
followersCount,
|
||||
|
|
|
@ -84,7 +84,7 @@ export default async (params: any, user: ILocalUser, app: IApp) => new Promise(a
|
|||
|
||||
if (avatar == null) return rej('avatar not found');
|
||||
|
||||
updates.avatarUrl = avatar.metadata.url || `${config.drive_url}/${avatar._id}`;
|
||||
updates.avatarUrl = avatar.metadata.thumbnailUrl || avatar.metadata.url || `${config.drive_url}/${avatar._id}`;
|
||||
|
||||
if (avatar.metadata.properties.avgColor) {
|
||||
updates.avatarColor = avatar.metadata.properties.avgColor;
|
||||
|
|
Loading…
Reference in a new issue