From 52ee21b2ee0798d99dd120f10a7dd282092fe037 Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Fri, 18 Oct 2024 16:47:06 +0900 Subject: [PATCH] =?UTF-8?q?`forciblyFollowedUsers`=20=E3=81=AB=E5=A4=89?= =?UTF-8?q?=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locales/index.d.ts | 4 ++-- locales/ja-JP.yml | 4 ++-- packages/backend/src/core/SignupService.ts | 4 ++-- packages/backend/src/models/Meta.ts | 2 +- .../backend/src/server/api/endpoints/admin/meta.ts | 4 ++-- .../src/server/api/endpoints/admin/update-meta.ts | 12 ++++++------ .../src/server/api/endpoints/blocking/create.ts | 2 +- .../src/server/api/endpoints/following/delete.ts | 2 +- .../backend/src/server/api/endpoints/mute/create.ts | 2 +- .../src/server/api/endpoints/renote-mute/create.ts | 2 +- packages/frontend/src/pages/admin/moderation.vue | 12 ++++++------ packages/misskey-js/src/autogen/types.ts | 4 ++-- 12 files changed, 27 insertions(+), 27 deletions(-) diff --git a/locales/index.d.ts b/locales/index.d.ts index 90d2987a7a..9f422cb501 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -5201,11 +5201,11 @@ export interface Locale extends ILocale { /** * 交流を断てないユーザー */ - "permanentFollowedUsers": string; + "forciblyFollowedUsers": string; /** * 今後アカウントが作成された際には自動でフォローされ、フォローの解除やミュート・ブロックができないユーザーを改行区切りで指定します。 */ - "permanentFollowedUsersDescription": string; + "forciblyFollowedUsersDescription": string; /** * 「デフォルトでフォローするユーザー」と「交流を絶てないユーザー」が重複しています。 */ diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index f6888d4333..54671ec60a 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1295,8 +1295,8 @@ yourNameContainsProhibitedWords: "変更しようとした名前に禁止され yourNameContainsProhibitedWordsDescription: "名前に禁止されている文字列が含まれています。この名前を使用したい場合は、サーバー管理者にお問い合わせください。" defaultFollowedUsers: "デフォルトでフォローするユーザー" defaultFollowedUsersDescription: "今後アカウントが作成された際に自動でフォローされるユーザー(解除可能)を改行区切りで指定します。" -permanentFollowedUsers: "交流を断てないユーザー" -permanentFollowedUsersDescription: "今後アカウントが作成された際には自動でフォローされ、フォローの解除やミュート・ブロックができないユーザーを改行区切りで指定します。" +forciblyFollowedUsers: "交流を断てないユーザー" +forciblyFollowedUsersDescription: "今後アカウントが作成された際には自動でフォローされ、フォローの解除やミュート・ブロックができないユーザーを改行区切りで指定します。" defaultFollowedUsersDuplicated: "「デフォルトでフォローするユーザー」と「交流を絶てないユーザー」が重複しています。" unfollowThisUserIsProhibited: "サーバー管理者はこのユーザーをフォロー解除することを禁止しています。" blockThisUserIsProhibited: "サーバー管理者はこのユーザーをブロックすることを禁止しています。" diff --git a/packages/backend/src/core/SignupService.ts b/packages/backend/src/core/SignupService.ts index 832eb91038..79bc3ebd1c 100644 --- a/packages/backend/src/core/SignupService.ts +++ b/packages/backend/src/core/SignupService.ts @@ -157,11 +157,11 @@ export class SignupService { //#region Default following if ( !isTheFirstUser && - (this.meta.defaultFollowedUsers.length > 0 || this.meta.permanentFollowedUsers.length > 0) + (this.meta.defaultFollowedUsers.length > 0 || this.meta.forciblyFollowedUsers.length > 0) ) { const userIdsToFollow = [ ...this.meta.defaultFollowedUsers, - ...this.meta.permanentFollowedUsers, + ...this.meta.forciblyFollowedUsers, ]; await Promise.allSettled(userIdsToFollow.map(async userId => { diff --git a/packages/backend/src/models/Meta.ts b/packages/backend/src/models/Meta.ts index 8f331b0948..e6fda2d5ff 100644 --- a/packages/backend/src/models/Meta.ts +++ b/packages/backend/src/models/Meta.ts @@ -75,7 +75,7 @@ export class MiMeta { @Column('varchar', { length: 1024, array: true, default: '{}', }) - public permanentFollowedUsers: string[]; + public forciblyFollowedUsers: string[]; @Column('varchar', { length: 1024, array: true, default: '{}', diff --git a/packages/backend/src/server/api/endpoints/admin/meta.ts b/packages/backend/src/server/api/endpoints/admin/meta.ts index 30b11f8562..7c02fa0295 100644 --- a/packages/backend/src/server/api/endpoints/admin/meta.ts +++ b/packages/backend/src/server/api/endpoints/admin/meta.ts @@ -156,7 +156,7 @@ export const meta = { type: 'string', }, }, - permanentFollowedUsers: { + forciblyFollowedUsers: { type: 'array', optional: false, nullable: false, items: { @@ -606,7 +606,7 @@ export default class extends Endpoint { // eslint- cacheRemoteSensitiveFiles: instance.cacheRemoteSensitiveFiles, pinnedUsers: instance.pinnedUsers, defaultFollowedUsers: instance.defaultFollowedUsers, - permanentFollowedUsers: instance.permanentFollowedUsers, + forciblyFollowedUsers: instance.forciblyFollowedUsers, hiddenTags: instance.hiddenTags, blockedHosts: instance.blockedHosts, silencedHosts: instance.silencedHosts, diff --git a/packages/backend/src/server/api/endpoints/admin/update-meta.ts b/packages/backend/src/server/api/endpoints/admin/update-meta.ts index 110d976e18..a8f24eb76b 100644 --- a/packages/backend/src/server/api/endpoints/admin/update-meta.ts +++ b/packages/backend/src/server/api/endpoints/admin/update-meta.ts @@ -20,7 +20,7 @@ export const meta = { errors: { followedUserDuplicated: { - message: 'Some items in "defaultFollowedUsers" and "permanentFollowedUsers" are duplicated.', + message: 'Some items in "defaultFollowedUsers" and "forciblyFollowedUsers" are duplicated.', code: 'FOLLOWED_USER_DUPLICATED', id: 'bcf088ec-fec5-42d0-8b9e-16d3b4797a4d', }, @@ -41,7 +41,7 @@ export const paramDef = { type: 'string', }, }, - permanentFollowedUsers: { + forciblyFollowedUsers: { type: 'array', nullable: true, items: { type: 'string', }, @@ -230,19 +230,19 @@ export default class extends Endpoint { // eslint- } if (Array.isArray(ps.defaultFollowedUsers)) { - if (ps.defaultFollowedUsers.some(x => this.serverSettings.permanentFollowedUsers.includes(x) || ps.permanentFollowedUsers?.includes(x))) { + if (ps.defaultFollowedUsers.some(x => this.serverSettings.forciblyFollowedUsers.includes(x) || ps.forciblyFollowedUsers?.includes(x))) { throw new ApiError(meta.errors.followedUserDuplicated); } set.defaultFollowedUsers = ps.defaultFollowedUsers.filter(Boolean); } - if (Array.isArray(ps.permanentFollowedUsers)) { - if (ps.permanentFollowedUsers.some(x => this.serverSettings.defaultFollowedUsers.includes(x) || ps.defaultFollowedUsers?.includes(x))) { + if (Array.isArray(ps.forciblyFollowedUsers)) { + if (ps.forciblyFollowedUsers.some(x => this.serverSettings.defaultFollowedUsers.includes(x) || ps.defaultFollowedUsers?.includes(x))) { throw new ApiError(meta.errors.followedUserDuplicated); } - set.permanentFollowedUsers = ps.permanentFollowedUsers.filter(Boolean); + set.forciblyFollowedUsers = ps.forciblyFollowedUsers.filter(Boolean); } if (Array.isArray(ps.hiddenTags)) { diff --git a/packages/backend/src/server/api/endpoints/blocking/create.ts b/packages/backend/src/server/api/endpoints/blocking/create.ts index f4ae1fe53a..087140e4fa 100644 --- a/packages/backend/src/server/api/endpoints/blocking/create.ts +++ b/packages/backend/src/server/api/endpoints/blocking/create.ts @@ -113,7 +113,7 @@ export default class extends Endpoint { // eslint- } if ( - this.serverSettings.permanentFollowedUsers.includes(blockee.id) && + this.serverSettings.forciblyFollowedUsers.includes(blockee.id) && !await this.roleService.isModerator(blocker) ) { throw new ApiError(meta.errors.cannotBlockDueToServerPolicy); diff --git a/packages/backend/src/server/api/endpoints/following/delete.ts b/packages/backend/src/server/api/endpoints/following/delete.ts index 91917b5bd4..1709fb8e4c 100644 --- a/packages/backend/src/server/api/endpoints/following/delete.ts +++ b/packages/backend/src/server/api/endpoints/following/delete.ts @@ -110,7 +110,7 @@ export default class extends Endpoint { // eslint- } if ( - this.serverSettings.permanentFollowedUsers.includes(followee.id) && + this.serverSettings.forciblyFollowedUsers.includes(followee.id) && !await this.roleService.isModerator(follower) ) { throw new ApiError(meta.errors.cannotUnfollowDueToServerPolicy); diff --git a/packages/backend/src/server/api/endpoints/mute/create.ts b/packages/backend/src/server/api/endpoints/mute/create.ts index 262e0c0e6c..69762610fa 100644 --- a/packages/backend/src/server/api/endpoints/mute/create.ts +++ b/packages/backend/src/server/api/endpoints/mute/create.ts @@ -108,7 +108,7 @@ export default class extends Endpoint { // eslint- } if ( - this.serverSettings.permanentFollowedUsers.includes(mutee.id) && + this.serverSettings.forciblyFollowedUsers.includes(mutee.id) && !await this.roleService.isModerator(muter) ) { throw new ApiError(meta.errors.cannotMuteDueToServerPolicy); diff --git a/packages/backend/src/server/api/endpoints/renote-mute/create.ts b/packages/backend/src/server/api/endpoints/renote-mute/create.ts index 0716c5b430..709f1b170f 100644 --- a/packages/backend/src/server/api/endpoints/renote-mute/create.ts +++ b/packages/backend/src/server/api/endpoints/renote-mute/create.ts @@ -103,7 +103,7 @@ export default class extends Endpoint { // eslint- } if ( - this.serverSettings.permanentFollowedUsers.includes(mutee.id) && + this.serverSettings.forciblyFollowedUsers.includes(mutee.id) && !await this.roleService.isModerator(muter) ) { throw new ApiError(meta.errors.cannotMuteDueToServerPolicy); diff --git a/packages/frontend/src/pages/admin/moderation.vue b/packages/frontend/src/pages/admin/moderation.vue index 71e7093d5e..505d282b32 100644 --- a/packages/frontend/src/pages/admin/moderation.vue +++ b/packages/frontend/src/pages/admin/moderation.vue @@ -42,9 +42,9 @@ SPDX-License-Identifier: AGPL-3.0-only - - - + + + {{ i18n.ts.save }} @@ -164,7 +164,7 @@ const prohibitedWordsForNameOfUser = ref(''); const hiddenTags = ref(''); const preservedUsernames = ref(''); const defaultFollowedUsers = ref(''); -const permanentFollowedUsers = ref(''); +const forciblyFollowedUsers = ref(''); const blockedHosts = ref(''); const silencedHosts = ref(''); const mediaSilencedHosts = ref(''); @@ -179,7 +179,7 @@ async function init() { hiddenTags.value = meta.hiddenTags.join('\n'); preservedUsernames.value = meta.preservedUsernames.join('\n'); defaultFollowedUsers.value = meta.defaultFollowedUsers.join('\n'); - permanentFollowedUsers.value = meta.permanentFollowedUsers.join('\n'); + forciblyFollowedUsers.value = meta.forciblyFollowedUsers.join('\n'); blockedHosts.value = meta.blockedHosts.join('\n'); silencedHosts.value = meta.silencedHosts?.join('\n') ?? ''; mediaSilencedHosts.value = meta.mediaSilencedHosts.join('\n'); @@ -212,7 +212,7 @@ function save_preservedUsernames() { function save_defaultUsers() { os.apiWithDialog('admin/update-meta', { defaultFollowedUsers: defaultFollowedUsers.value.split('\n'), - permanentFollowedUsers: permanentFollowedUsers.value.split('\n'), + forciblyFollowedUsers: forciblyFollowedUsers.value.split('\n'), }, undefined, { 'bcf088ec-fec5-42d0-8b9e-16d3b4797a4d': { text: i18n.ts.defaultFollowedUsersDuplicated, diff --git a/packages/misskey-js/src/autogen/types.ts b/packages/misskey-js/src/autogen/types.ts index cf532765c1..0bdb560be8 100644 --- a/packages/misskey-js/src/autogen/types.ts +++ b/packages/misskey-js/src/autogen/types.ts @@ -5121,7 +5121,7 @@ export type operations = { mediaSilencedHosts: string[]; pinnedUsers: string[]; defaultFollowedUsers: string[]; - permanentFollowedUsers: string[]; + forciblyFollowedUsers: string[]; hiddenTags: string[]; blockedHosts: string[]; sensitiveWords: string[]; @@ -9462,7 +9462,7 @@ export type operations = { disableRegistration?: boolean | null; pinnedUsers?: string[] | null; defaultFollowedUsers?: string[] | null; - permanentFollowedUsers?: string[] | null; + forciblyFollowedUsers?: string[] | null; hiddenTags?: string[] | null; blockedHosts?: string[] | null; sensitiveWords?: string[] | null;