diff --git a/locales/index.d.ts b/locales/index.d.ts index db9bb63bad..db9db93c5b 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -1554,6 +1554,10 @@ export interface Locale extends ILocale { * リモートユーザーのため、情報が不完全です。 */ "remoteUserCaution": string; + /** + * センシティブなユーザーです。 + */ + "sensitiveUserCaution": string; /** * アクティビティ */ diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 761496c80c..4da9fed64c 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -383,6 +383,7 @@ termsOfService: "利用規約" start: "始める" home: "ホーム" remoteUserCaution: "リモートユーザーのため、情報が不完全です。" +sensitiveUserCaution: "センシティブなユーザーです。" activity: "アクティビティ" images: "画像" image: "画像" diff --git a/packages/backend/migration/1722353293595-AddSensitiveProfile.js b/packages/backend/migration/1722353293595-AddSensitiveProfile.js new file mode 100644 index 0000000000..23dcdc672e --- /dev/null +++ b/packages/backend/migration/1722353293595-AddSensitiveProfile.js @@ -0,0 +1,11 @@ +export class AddSensitiveProfile1722353293595 { + name = 'AddSensitiveProfile1722353293595' + + async up(queryRunner) { + await queryRunner.query(`ALTER TABLE "user_profile" ADD "isSensitive" boolean NOT NULL DEFAULT false`); + } + + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "isSensitive"`); + } +} diff --git a/packages/backend/src/core/entities/UserEntityService.ts b/packages/backend/src/core/entities/UserEntityService.ts index eb852759aa..4b2f5a0ef0 100644 --- a/packages/backend/src/core/entities/UserEntityService.ts +++ b/packages/backend/src/core/entities/UserEntityService.ts @@ -569,6 +569,7 @@ export class UserEntityService implements OnModuleInit { isLocked: user.isLocked, isSilenced: this.roleService.getUserPolicies(user.id).then(r => !r.canPublicNote), isSuspended: user.isSuspended, + isSensitive: user.isSensitive, description: profile!.description, location: profile!.location, birthday: profile!.birthday, diff --git a/packages/backend/src/models/UserProfile.ts b/packages/backend/src/models/UserProfile.ts index f082dada00..71b093e6a6 100644 --- a/packages/backend/src/models/UserProfile.ts +++ b/packages/backend/src/models/UserProfile.ts @@ -177,6 +177,12 @@ export class MiUserProfile { }) public isIndexable: boolean; + @Column('boolean', { + default: false, + comment: 'Whether User is sensitive.', + }) + public isSensitive: boolean; + @Column('boolean', { default: true, }) diff --git a/packages/backend/src/models/json-schema/user.ts b/packages/backend/src/models/json-schema/user.ts index c928d643f7..ef5695040e 100644 --- a/packages/backend/src/models/json-schema/user.ts +++ b/packages/backend/src/models/json-schema/user.ts @@ -254,6 +254,11 @@ export const packedUserDetailedNotMeOnlySchema = { nullable: false, optional: false, example: false, }, + isSensitive: { + type: 'boolean', + nullable: false, optional: false, + example: false, + }, description: { type: 'string', nullable: true, optional: false, diff --git a/packages/backend/src/server/api/endpoints/i/update.ts b/packages/backend/src/server/api/endpoints/i/update.ts index 6b13f97aa6..ee92a74bc0 100644 --- a/packages/backend/src/server/api/endpoints/i/update.ts +++ b/packages/backend/src/server/api/endpoints/i/update.ts @@ -330,7 +330,10 @@ export default class extends Endpoint { // eslint- updates.isIndexable = ps.isIndexable; profileUpdates.isIndexable = ps.isIndexable; }; - if (typeof ps.isSensitive === 'boolean') updates.isSensitive = ps.isSensitive; + if (typeof ps.isSensitive === 'boolean') { + updates.isSensitive = ps.isSensitive; + profileUpdates.isSensitive = ps.isSensitive; + }; if (typeof ps.isCat === 'boolean') updates.isCat = ps.isCat; if (typeof ps.injectFeaturedNote === 'boolean') profileUpdates.injectFeaturedNote = ps.injectFeaturedNote; if (typeof ps.receiveAnnouncementEmail === 'boolean') profileUpdates.receiveAnnouncementEmail = ps.receiveAnnouncementEmail; diff --git a/packages/cherrypick-js/src/autogen/types.ts b/packages/cherrypick-js/src/autogen/types.ts index a493dac965..3814104b51 100644 --- a/packages/cherrypick-js/src/autogen/types.ts +++ b/packages/cherrypick-js/src/autogen/types.ts @@ -4033,6 +4033,8 @@ export type components = { isSilenced: boolean; /** @example false */ isSuspended: boolean; + /** @example false */ + isSensitive: boolean; /** @example Hi masters, I am Ai! */ description: string | null; location: string | null; diff --git a/packages/frontend/src/components/MkUserSensitiveCaution.vue b/packages/frontend/src/components/MkUserSensitiveCaution.vue new file mode 100644 index 0000000000..d0890bfc93 --- /dev/null +++ b/packages/frontend/src/components/MkUserSensitiveCaution.vue @@ -0,0 +1,19 @@ + + + + + diff --git a/packages/frontend/src/pages/user/home.vue b/packages/frontend/src/pages/user/home.vue index e0178623cc..aeee1a7ab0 100644 --- a/packages/frontend/src/pages/user/home.vue +++ b/packages/frontend/src/pages/user/home.vue @@ -14,6 +14,7 @@ SPDX-License-Identifier: AGPL-3.0-only
+