wip
This commit is contained in:
parent
16b4563ade
commit
13130f3600
|
@ -66,7 +66,7 @@ export class SystemAccountService {
|
||||||
return systemAccount.user as MiLocalUser;
|
return systemAccount.user as MiLocalUser;
|
||||||
} else {
|
} else {
|
||||||
const created = await this.createCorrespondingUser(type, {
|
const created = await this.createCorrespondingUser(type, {
|
||||||
username: `system.${type}`, // NOTE: (できれば避けたいが)system.から始まるかどうかでシステムアカウントかどうかを判定している処理もあるので変えないように
|
username: `system.${type}`, // NOTE: (できれば避けたいが) . が含まれるかどうかでシステムアカウントかどうかを判定している処理もあるので変えないように
|
||||||
name: this.meta.name,
|
name: this.meta.name,
|
||||||
});
|
});
|
||||||
this.cache.set(type, created);
|
this.cache.set(type, created);
|
||||||
|
|
|
@ -28,6 +28,7 @@ import type {
|
||||||
FollowingsRepository,
|
FollowingsRepository,
|
||||||
FollowRequestsRepository,
|
FollowRequestsRepository,
|
||||||
MiFollowing,
|
MiFollowing,
|
||||||
|
MiMeta,
|
||||||
MiUserNotePining,
|
MiUserNotePining,
|
||||||
MiUserProfile,
|
MiUserProfile,
|
||||||
MutingsRepository,
|
MutingsRepository,
|
||||||
|
@ -100,6 +101,9 @@ export class UserEntityService implements OnModuleInit {
|
||||||
@Inject(DI.config)
|
@Inject(DI.config)
|
||||||
private config: Config,
|
private config: Config,
|
||||||
|
|
||||||
|
@Inject(DI.meta)
|
||||||
|
private meta: MiMeta,
|
||||||
|
|
||||||
@Inject(DI.redis)
|
@Inject(DI.redis)
|
||||||
private redisClient: Redis.Redis,
|
private redisClient: Redis.Redis,
|
||||||
|
|
||||||
|
@ -381,7 +385,11 @@ export class UserEntityService implements OnModuleInit {
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
public getIdenticonUrl(user: MiUser): string {
|
public getIdenticonUrl(user: MiUser): string {
|
||||||
return `${this.config.url}/identicon/${user.username.toLowerCase()}@${user.host ?? this.config.host}`;
|
if ((user.host == null || user.host === this.config.host) && user.username.includes('.') && this.meta.iconUrl) { // ローカルのシステムアカウントの場合
|
||||||
|
return this.meta.iconUrl;
|
||||||
|
} else {
|
||||||
|
return `${this.config.url}/identicon/${user.username.toLowerCase()}@${user.host ?? this.config.host}`;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
|
|
|
@ -22,7 +22,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<MkInfo v-if="user.host == null && user.username.startsWith('system.')">{{ i18n.ts.isSystemAccount }}</MkInfo>
|
<MkInfo v-if="user.host == null && user.username.includes('.')">{{ i18n.ts.isSystemAccount }}</MkInfo>
|
||||||
|
|
||||||
<FormLink v-if="user.host" :to="`/instance-info/${user.host}`">{{ i18n.ts.instanceInfo }}</FormLink>
|
<FormLink v-if="user.host" :to="`/instance-info/${user.host}`">{{ i18n.ts.instanceInfo }}</FormLink>
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
</MkA>
|
</MkA>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="user.host == null && user.username.startsWith('system.')" class="isSystemAccount">
|
<div v-if="user.host == null && user.username.includes('.')" class="isSystemAccount">
|
||||||
<MkInfo>{{ i18n.ts.isSystemAccount }}</MkInfo>
|
<MkInfo>{{ i18n.ts.isSystemAccount }}</MkInfo>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="iAmModerator" class="moderationNote">
|
<div v-if="iAmModerator" class="moderationNote">
|
||||||
|
|
Loading…
Reference in New Issue