From a7ddf6aed2d9ec4ccfd7bc517a34fc2ae4f66645 Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Mon, 28 Oct 2024 15:51:38 +0900 Subject: [PATCH] =?UTF-8?q?enhance:=20=E3=83=97=E3=83=AD=E3=82=AD=E3=82=B7?= =?UTF-8?q?=E3=82=A2=E3=82=AB=E3=82=A6=E3=83=B3=E3=83=88=E3=81=A7=E3=81=82?= =?UTF-8?q?=E3=82=8B=E3=81=93=E3=81=A8=E3=82=92=E8=A1=A8=E7=A4=BA=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/backend/src/core/entities/UserEntityService.ts | 5 +++++ packages/backend/src/models/json-schema/user.ts | 4 ++++ packages/backend/test/e2e/users.ts | 2 ++ packages/frontend/src/pages/user/home.vue | 1 + packages/misskey-js/src/autogen/types.ts | 1 + 5 files changed, 13 insertions(+) diff --git a/packages/backend/src/core/entities/UserEntityService.ts b/packages/backend/src/core/entities/UserEntityService.ts index d3c087a153..b71e9f0f7d 100644 --- a/packages/backend/src/core/entities/UserEntityService.ts +++ b/packages/backend/src/core/entities/UserEntityService.ts @@ -28,6 +28,7 @@ import type { FollowingsRepository, FollowRequestsRepository, MiFollowing, + MiMeta, MiUserNotePining, MiUserProfile, MutingsRepository, @@ -98,6 +99,9 @@ export class UserEntityService implements OnModuleInit { @Inject(DI.config) private config: Config, + @Inject(DI.meta) + private meta: MiMeta, + @Inject(DI.redis) private redisClient: Redis.Redis, @@ -490,6 +494,7 @@ export class UserEntityService implements OnModuleInit { }))) : [], isBot: user.isBot, isCat: user.isCat, + isProxy: this.meta.proxyAccountId === user.id, requireSigninToViewContents: user.requireSigninToViewContents === false ? undefined : true, makeNotesFollowersOnlyBefore: user.makeNotesFollowersOnlyBefore ?? undefined, makeNotesHiddenBefore: user.makeNotesHiddenBefore ?? undefined, diff --git a/packages/backend/src/models/json-schema/user.ts b/packages/backend/src/models/json-schema/user.ts index 38631f907d..0388fa994a 100644 --- a/packages/backend/src/models/json-schema/user.ts +++ b/packages/backend/src/models/json-schema/user.ts @@ -115,6 +115,10 @@ export const packedUserLiteSchema = { type: 'boolean', nullable: false, optional: true, }, + isProxy: { + type: 'boolean', + nullable: false, optional: true, + }, requireSigninToViewContents: { type: 'boolean', nullable: false, optional: true, diff --git a/packages/backend/test/e2e/users.ts b/packages/backend/test/e2e/users.ts index 822ca14ae6..ba90d494a8 100644 --- a/packages/backend/test/e2e/users.ts +++ b/packages/backend/test/e2e/users.ts @@ -40,6 +40,7 @@ describe('ユーザー', () => { avatarDecorations: user.avatarDecorations, isBot: user.isBot, isCat: user.isCat, + isProxy: user.isProxy, instance: user.instance, emojis: user.emojis, onlineStatus: user.onlineStatus, @@ -310,6 +311,7 @@ describe('ユーザー', () => { assert.deepStrictEqual(response.avatarDecorations, []); assert.strictEqual(response.isBot, false); assert.strictEqual(response.isCat, false); + assert.strictEqual(response.isProxy, false); assert.strictEqual(response.instance, undefined); assert.deepStrictEqual(response.emojis, {}); assert.strictEqual(response.onlineStatus, 'unknown'); diff --git a/packages/frontend/src/pages/user/home.vue b/packages/frontend/src/pages/user/home.vue index 00b5740639..24654b4ebd 100644 --- a/packages/frontend/src/pages/user/home.vue +++ b/packages/frontend/src/pages/user/home.vue @@ -26,6 +26,7 @@ SPDX-License-Identifier: AGPL-3.0-only + diff --git a/packages/misskey-js/src/autogen/types.ts b/packages/misskey-js/src/autogen/types.ts index 560960f018..fe56ce7556 100644 --- a/packages/misskey-js/src/autogen/types.ts +++ b/packages/misskey-js/src/autogen/types.ts @@ -3736,6 +3736,7 @@ export type components = { }[]; isBot?: boolean; isCat?: boolean; + isProxy?: boolean; requireSigninToViewContents?: boolean; makeNotesFollowersOnlyBefore?: number | null; makeNotesHiddenBefore?: number | null;