enhance: プロキシアカウントであることを表示するように

This commit is contained in:
kakkokari-gtyih 2024-10-28 15:51:38 +09:00
parent b1073714ba
commit a7ddf6aed2
5 changed files with 13 additions and 0 deletions

View File

@ -28,6 +28,7 @@ import type {
FollowingsRepository, FollowingsRepository,
FollowRequestsRepository, FollowRequestsRepository,
MiFollowing, MiFollowing,
MiMeta,
MiUserNotePining, MiUserNotePining,
MiUserProfile, MiUserProfile,
MutingsRepository, MutingsRepository,
@ -98,6 +99,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,
@ -490,6 +494,7 @@ export class UserEntityService implements OnModuleInit {
}))) : [], }))) : [],
isBot: user.isBot, isBot: user.isBot,
isCat: user.isCat, isCat: user.isCat,
isProxy: this.meta.proxyAccountId === user.id,
requireSigninToViewContents: user.requireSigninToViewContents === false ? undefined : true, requireSigninToViewContents: user.requireSigninToViewContents === false ? undefined : true,
makeNotesFollowersOnlyBefore: user.makeNotesFollowersOnlyBefore ?? undefined, makeNotesFollowersOnlyBefore: user.makeNotesFollowersOnlyBefore ?? undefined,
makeNotesHiddenBefore: user.makeNotesHiddenBefore ?? undefined, makeNotesHiddenBefore: user.makeNotesHiddenBefore ?? undefined,

View File

@ -115,6 +115,10 @@ export const packedUserLiteSchema = {
type: 'boolean', type: 'boolean',
nullable: false, optional: true, nullable: false, optional: true,
}, },
isProxy: {
type: 'boolean',
nullable: false, optional: true,
},
requireSigninToViewContents: { requireSigninToViewContents: {
type: 'boolean', type: 'boolean',
nullable: false, optional: true, nullable: false, optional: true,

View File

@ -40,6 +40,7 @@ describe('ユーザー', () => {
avatarDecorations: user.avatarDecorations, avatarDecorations: user.avatarDecorations,
isBot: user.isBot, isBot: user.isBot,
isCat: user.isCat, isCat: user.isCat,
isProxy: user.isProxy,
instance: user.instance, instance: user.instance,
emojis: user.emojis, emojis: user.emojis,
onlineStatus: user.onlineStatus, onlineStatus: user.onlineStatus,
@ -310,6 +311,7 @@ describe('ユーザー', () => {
assert.deepStrictEqual(response.avatarDecorations, []); assert.deepStrictEqual(response.avatarDecorations, []);
assert.strictEqual(response.isBot, false); assert.strictEqual(response.isBot, false);
assert.strictEqual(response.isCat, false); assert.strictEqual(response.isCat, false);
assert.strictEqual(response.isProxy, false);
assert.strictEqual(response.instance, undefined); assert.strictEqual(response.instance, undefined);
assert.deepStrictEqual(response.emojis, {}); assert.deepStrictEqual(response.emojis, {});
assert.strictEqual(response.onlineStatus, 'unknown'); assert.strictEqual(response.onlineStatus, 'unknown');

View File

@ -26,6 +26,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<span v-if="user.isAdmin" :title="i18n.ts.isAdmin" style="color: var(--MI_THEME-badge);"><i class="ti ti-shield"></i></span> <span v-if="user.isAdmin" :title="i18n.ts.isAdmin" style="color: var(--MI_THEME-badge);"><i class="ti ti-shield"></i></span>
<span v-if="user.isLocked" :title="i18n.ts.isLocked"><i class="ti ti-lock"></i></span> <span v-if="user.isLocked" :title="i18n.ts.isLocked"><i class="ti ti-lock"></i></span>
<span v-if="user.isBot" :title="i18n.ts.isBot"><i class="ti ti-robot"></i></span> <span v-if="user.isBot" :title="i18n.ts.isBot"><i class="ti ti-robot"></i></span>
<span v-if="user.isProxy" :title="i18n.ts.proxyAccount"><i class="ti ti-ghost"></i></span>
<button v-if="$i && !isEditingMemo && !memoDraft" class="_button add-note-button" @click="showMemoTextarea"> <button v-if="$i && !isEditingMemo && !memoDraft" class="_button add-note-button" @click="showMemoTextarea">
<i class="ti ti-edit"/> {{ i18n.ts.addMemo }} <i class="ti ti-edit"/> {{ i18n.ts.addMemo }}
</button> </button>

View File

@ -3736,6 +3736,7 @@ export type components = {
}[]; }[];
isBot?: boolean; isBot?: boolean;
isCat?: boolean; isCat?: boolean;
isProxy?: boolean;
requireSigninToViewContents?: boolean; requireSigninToViewContents?: boolean;
makeNotesFollowersOnlyBefore?: number | null; makeNotesFollowersOnlyBefore?: number | null;
makeNotesHiddenBefore?: number | null; makeNotesHiddenBefore?: number | null;