From 09d34493093b7587ccf3cebb7ee9806377c517ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B2=E3=81=9F=E3=82=8A=E3=82=93?= Date: Wed, 9 Oct 2024 12:51:25 +0900 Subject: [PATCH] Merge pull request #45 from lqvp/master MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit feat: ドライブの写真をプロフィールから見れなくする --- DIFFERENCE.md | 12 +++++------- locales/en-US.yml | 2 ++ locales/index.d.ts | 8 ++++++++ locales/ja-JP.yml | 2 ++ .../1710146785086-feat-hide-profilefile.js | 9 +++++++++ .../src/core/entities/UserEntityService.ts | 1 + packages/backend/src/models/UserProfile.ts | 5 +++++ packages/backend/src/models/json-schema/user.ts | 4 ++++ .../backend/src/server/api/endpoints/i/update.ts | 2 ++ packages/frontend/src/pages/settings/privacy.vue | 15 +++++++++++++++ packages/frontend/src/pages/user/home.vue | 6 +++--- packages/misskey-js/src/autogen/types.ts | 4 +++- 12 files changed, 59 insertions(+), 11 deletions(-) create mode 100644 packages/backend/migration/1710146785086-feat-hide-profilefile.js diff --git a/DIFFERENCE.md b/DIFFERENCE.md index 602c14efbe..320a935131 100755 --- a/DIFFERENCE.md +++ b/DIFFERENCE.md @@ -1,14 +1,14 @@ # DIFFRENCE -<<<<<<< HEAD + +## 2024.9.0-yami-1.3.2 +## Feat +- ドライブの写真をプロフィールから見れなくする + ## 2024.9.0-yami-1.3.1 ## Client - フォロー/フォロワー/アナウンス/みつける/Play/ギャラリー/チャンネル/TL/ユーザー/ノートのページをログイン必須に - hideReactionUsersをデフォルトで有効に(未ログインユーザーからリアクションしたユーザーを隠せます) -## 2024.9.0-yami-1.3.0 -## Feat -- ロールで引用通知の設定を制限出来るように - ## 2024.9.0-yami-1.2.9 ## Feat - ノート数を隠せるように(連合しません) @@ -29,8 +29,6 @@ ### Server - `notes/show`, `users/notes`の認証を不要に(revert?) -======= ->>>>>>> 12828a4aa2 (Merge pull request #35 from lqvp/master) ## 2024.9.0-yami-1.2.5 ### Feat - フォロー解除時にも通知するように diff --git a/locales/en-US.yml b/locales/en-US.yml index 59e87061d7..58e7148f1b 100755 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -1347,6 +1347,8 @@ scheduledNoteDelete: "Time Bomb" noteDeletationAt: "This note will be deleted at {time}" hideActivity: "Hide Activity" hideActivityDescription: "This option prevents others from viewing your activity on your profile (Summary/Activity tab). Even with this option enabled, you can still view your activity from the Activity tab on your profile." +hideProfileFiles: "Hide Profile Files" +hideProfileFilesDescription: "Prevent viewing your profile files." hideReactionUsers: "Hide Users Who Reacted" hideReactionUsersDescription: "This option hides the list of users who reacted when hovering over the reaction and the list of users who reacted in the reactions tab on the note detail page." hideReactionCount: "Hide Reaction Count" diff --git a/locales/index.d.ts b/locales/index.d.ts index c61abd2520..2f341bff64 100755 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -5413,6 +5413,14 @@ export interface Locale extends ILocale { * 自分のプロフィールのアクティビティ (概要/アクティビティタブ) を他人が見れないようにします。このオプションを有効にしても、自分であればプロフィールのアクティビティタブから引き続き閲覧できます。 */ "hideActivityDescription": string; + /** + * プロフィールのファイルを非公開にする + */ + "hideProfileFiles": string; + /** + * 自分のプロフィールのファイルを他人が見れないようにします。 + */ + "hideProfileFilesDescription": string; /** * 誰がリアクションをしたのかを非表示にする */ diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 5d4a867cc4..3e979c0211 100755 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1351,6 +1351,8 @@ cannotScheduleLaterThanOneYear: "1年以上先の日時を指定することは defaultScheduledNoteDelete: "デフォルトでノートが自己消滅するように" hideActivity: "アクティビティを非公開にする" hideActivityDescription: "自分のプロフィールのアクティビティ (概要/アクティビティタブ) を他人が見れないようにします。このオプションを有効にしても、自分であればプロフィールのアクティビティタブから引き続き閲覧できます。" +hideProfileFiles: "プロフィールのファイルを非公開にする" +hideProfileFilesDescription: "自分のプロフィールのファイルを見れないようにします。" hideReactionUsers: "誰がリアクションをしたのかを非表示にする" hideReactionUsersDescription: "リアクションをホバーした際のユーザー一覧と、ノート詳細ページのリアクションタブにあるリアクションをしたユーザー一覧を非表示にします" hideReactionCount: "リアクション数の非表示" diff --git a/packages/backend/migration/1710146785086-feat-hide-profilefile.js b/packages/backend/migration/1710146785086-feat-hide-profilefile.js new file mode 100644 index 0000000000..534c8b4dab --- /dev/null +++ b/packages/backend/migration/1710146785086-feat-hide-profilefile.js @@ -0,0 +1,9 @@ +export class FeatHideProfileFile1710146785086 { + name = 'FeatHideProfileFile1710146785086' + async up(queryRunner) { + await queryRunner.query(`ALTER TABLE "user_profile" ADD "hideProfileFiles" boolean NOT NULL DEFAULT false`); + } + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "hideProfileFiles"`); + } +} diff --git a/packages/backend/src/core/entities/UserEntityService.ts b/packages/backend/src/core/entities/UserEntityService.ts index a16b2b7d41..ed06ab682a 100755 --- a/packages/backend/src/core/entities/UserEntityService.ts +++ b/packages/backend/src/core/entities/UserEntityService.ts @@ -588,6 +588,7 @@ export class UserEntityService implements OnModuleInit { pinnedPage: profile!.pinnedPageId ? this.pageEntityService.pack(profile!.pinnedPageId, me) : null, publicReactions: this.isLocalUser(user) ? profile!.publicReactions : false, // https://github.com/misskey-dev/misskey/issues/12964 hideActivity: this.isLocalUser(user) ? profile!.hideActivity : false, // + hideProfileFiles: this.isLocalUser(user) ? profile!.hideProfileFiles : false, followersVisibility: profile!.followersVisibility, followingVisibility: profile!.followingVisibility, twoFactorEnabled: profile!.twoFactorEnabled, diff --git a/packages/backend/src/models/UserProfile.ts b/packages/backend/src/models/UserProfile.ts index 34cc86d49f..bb57d14715 100755 --- a/packages/backend/src/models/UserProfile.ts +++ b/packages/backend/src/models/UserProfile.ts @@ -117,6 +117,11 @@ export class MiUserProfile { }) public hideActivity: boolean; + @Column('boolean', { + default: true, + }) + public hideProfileFiles: boolean; + @Column('varchar', { length: 128, nullable: true, }) diff --git a/packages/backend/src/models/json-schema/user.ts b/packages/backend/src/models/json-schema/user.ts index 1806c3dace..c99ac7efc2 100755 --- a/packages/backend/src/models/json-schema/user.ts +++ b/packages/backend/src/models/json-schema/user.ts @@ -373,6 +373,10 @@ export const packedUserDetailedNotMeOnlySchema = { type: 'boolean', nullable: false, optional: false, }, + hideProfileFiles: { + type: 'boolean', + nullable: false, optional: false, + }, followingVisibility: { type: 'string', nullable: false, 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 2e940894a5..451357bb8b 100755 --- a/packages/backend/src/server/api/endpoints/i/update.ts +++ b/packages/backend/src/server/api/endpoints/i/update.ts @@ -182,6 +182,7 @@ export const paramDef = { hideOnlineStatus: { type: 'boolean' }, publicReactions: { type: 'boolean' }, hideActivity: { type: 'boolean' }, + hideProfileFiles: { type: 'boolean' }, carefulBot: { type: 'boolean' }, autoAcceptFollowed: { type: 'boolean' }, autoRejectFollowRequest: { type: 'boolean' }, @@ -337,6 +338,7 @@ export default class extends Endpoint { // eslint- if (typeof ps.publicReactions === 'boolean') profileUpdates.publicReactions = ps.publicReactions; if (typeof ps.noindex === 'boolean') updates.noindex = ps.noindex; if (typeof ps.hideActivity === 'boolean') profileUpdates.hideActivity = ps.hideActivity; + if (typeof ps.hideProfileFiles === 'boolean') profileUpdates.hideProfileFiles = ps.hideProfileFiles; if (typeof ps.isBot === 'boolean') updates.isBot = ps.isBot; if (typeof ps.carefulBot === 'boolean') profileUpdates.carefulBot = ps.carefulBot; if (typeof ps.autoAcceptFollowed === 'boolean') profileUpdates.autoAcceptFollowed = ps.autoAcceptFollowed; diff --git a/packages/frontend/src/pages/settings/privacy.vue b/packages/frontend/src/pages/settings/privacy.vue index eca135cf30..cf5439b761 100755 --- a/packages/frontend/src/pages/settings/privacy.vue +++ b/packages/frontend/src/pages/settings/privacy.vue @@ -22,6 +22,11 @@ SPDX-License-Identifier: AGPL-3.0-only + + {{ i18n.ts.hideProfileFiles }}{{ i18n.ts.originalFeature }} + + + @@ -103,6 +108,11 @@ const isExplorable = ref($i.isExplorable); const hideOnlineStatus = ref($i.hideOnlineStatus); const publicReactions = ref($i.publicReactions); const hideActivity = ref($i.hideActivity); +<<<<<<< HEAD +======= +const hideProfileFiles = ref($i.hideProfileFiles); +const notesVisibility = ref($i.notesVisibility); +>>>>>>> 57b9d89d55 (Merge pull request #45 from lqvp/master) const followingVisibility = ref($i.followingVisibility); const followersVisibility = ref($i.followersVisibility); @@ -122,6 +132,11 @@ function save() { hideOnlineStatus: !!hideOnlineStatus.value, publicReactions: !!publicReactions.value, hideActivity: !!hideActivity.value, +<<<<<<< HEAD +======= + hideProfileFiles: !!hideProfileFiles.value, + notesVisibility: notesVisibility.value, +>>>>>>> 57b9d89d55 (Merge pull request #45 from lqvp/master) followingVisibility: followingVisibility.value, followersVisibility: followersVisibility.value, }); diff --git a/packages/frontend/src/pages/user/home.vue b/packages/frontend/src/pages/user/home.vue index 6eaf06c51d..611a98688e 100755 --- a/packages/frontend/src/pages/user/home.vue +++ b/packages/frontend/src/pages/user/home.vue @@ -126,7 +126,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts.userPagePinTip }}