diff --git a/locales/index.d.ts b/locales/index.d.ts index 9ab72b3a5a..d7b1c3b9b0 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -5472,6 +5472,14 @@ export interface Locale extends ILocale { * ルームを削除 */ "deleteRoom": string; + /** + * このサーバー、またはこのアカウントでチャットは有効化されていません。 + */ + "chatNotAvailableForThisAccountOrServer": string; + /** + * 相手のアカウントでチャット機能が使えない状態になっています。 + */ + "chatNotAvailableInOtherAccount": string; /** * このユーザーとのチャットを開始できません */ diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 7a2beb7a87..7ab6c24d82 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1365,6 +1365,8 @@ _chat: newline: "改行" muteThisRoom: "このルームをミュート" deleteRoom: "ルームを削除" + chatNotAvailableForThisAccountOrServer: "このサーバー、またはこのアカウントでチャットは有効化されていません。" + chatNotAvailableInOtherAccount: "相手のアカウントでチャット機能が使えない状態になっています。" cannotChatWithTheUser: "このユーザーとのチャットを開始できません" cannotChatWithTheUser_description: "チャットが使えない状態になっているか、相手がチャットを開放していません。" chatWithThisUser: "チャットする" diff --git a/packages/backend/src/core/entities/UserEntityService.ts b/packages/backend/src/core/entities/UserEntityService.ts index 92a684dc1a..ad8052711c 100644 --- a/packages/backend/src/core/entities/UserEntityService.ts +++ b/packages/backend/src/core/entities/UserEntityService.ts @@ -557,6 +557,7 @@ export class UserEntityService implements OnModuleInit { followersVisibility: profile!.followersVisibility, followingVisibility: profile!.followingVisibility, chatScope: user.chatScope, + canChat: this.roleService.getUserPolicies(user.id).then(r => r.canChat), roles: this.roleService.getUserRoles(user.id).then(roles => roles.filter(role => role.isPublic).sort((a, b) => b.displayOrder - a.displayOrder).map(role => ({ id: role.id, name: role.name, diff --git a/packages/backend/src/models/json-schema/user.ts b/packages/backend/src/models/json-schema/user.ts index 0094f25e34..e475296702 100644 --- a/packages/backend/src/models/json-schema/user.ts +++ b/packages/backend/src/models/json-schema/user.ts @@ -363,6 +363,10 @@ export const packedUserDetailedNotMeOnlySchema = { nullable: false, optional: false, enum: ['everyone', 'following', 'followers', 'mutual', 'none'], }, + canChat: { + type: 'boolean', + nullable: false, optional: false, + }, roles: { type: 'array', nullable: false, optional: false, diff --git a/packages/frontend/src/pages/chat/home.home.vue b/packages/frontend/src/pages/chat/home.home.vue index 0affef6333..007e9fc1f4 100644 --- a/packages/frontend/src/pages/chat/home.home.vue +++ b/packages/frontend/src/pages/chat/home.home.vue @@ -5,7 +5,9 @@ SPDX-License-Identifier: AGPL-3.0-only