summaryrefslogtreecommitdiff
path: root/packages/backend
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2023-03-05 11:09:55 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2023-03-05 11:09:55 +0900
commitb9a3b2c165124b52d41412b4378d892ae6079d27 (patch)
treebf622c6bf99963054c8a106437a2a87b94921d3f /packages/backend
parenttweak of 8e5e6f90cb (diff)
downloadmisskey-b9a3b2c165124b52d41412b4378d892ae6079d27.tar.gz
misskey-b9a3b2c165124b52d41412b4378d892ae6079d27.tar.bz2
misskey-b9a3b2c165124b52d41412b4378d892ae6079d27.zip
enhance(server): make identicon same between local and remote
Resolve #10200
Diffstat (limited to 'packages/backend')
-rw-r--r--packages/backend/src/core/entities/UserEntityService.ts14
1 files changed, 7 insertions, 7 deletions
diff --git a/packages/backend/src/core/entities/UserEntityService.ts b/packages/backend/src/core/entities/UserEntityService.ts
index 8c36e47f1b..78129d32ae 100644
--- a/packages/backend/src/core/entities/UserEntityService.ts
+++ b/packages/backend/src/core/entities/UserEntityService.ts
@@ -278,27 +278,27 @@ export class UserEntityService implements OnModuleInit {
@bindThis
public async getAvatarUrl(user: User): Promise<string> {
if (user.avatar) {
- return this.driveFileEntityService.getPublicUrl(user.avatar, 'avatar') ?? this.getIdenticonUrl(user.id);
+ return this.driveFileEntityService.getPublicUrl(user.avatar, 'avatar') ?? this.getIdenticonUrl(user);
} else if (user.avatarId) {
const avatar = await this.driveFilesRepository.findOneByOrFail({ id: user.avatarId });
- return this.driveFileEntityService.getPublicUrl(avatar, 'avatar') ?? this.getIdenticonUrl(user.id);
+ return this.driveFileEntityService.getPublicUrl(avatar, 'avatar') ?? this.getIdenticonUrl(user);
} else {
- return this.getIdenticonUrl(user.id);
+ return this.getIdenticonUrl(user);
}
}
@bindThis
public getAvatarUrlSync(user: User): string {
if (user.avatar) {
- return this.driveFileEntityService.getPublicUrl(user.avatar, 'avatar') ?? this.getIdenticonUrl(user.id);
+ return this.driveFileEntityService.getPublicUrl(user.avatar, 'avatar') ?? this.getIdenticonUrl(user);
} else {
- return this.getIdenticonUrl(user.id);
+ return this.getIdenticonUrl(user);
}
}
@bindThis
- public getIdenticonUrl(userId: User['id']): string {
- return `${this.config.url}/identicon/${userId}`;
+ public getIdenticonUrl(user: User): string {
+ return `${this.config.url}/identicon/${user.usernameLower}@${user.host ?? this.config.host}`;
}
public async pack<ExpectsMe extends boolean | null = null, D extends boolean = false>(