1
0
Fork 0
mirror of https://github.com/paricafe/misskey.git synced 2025-03-31 13:19:29 -05:00

enhance(frontend): チャットが開放されていない場合のUIを改善

This commit is contained in:
syuilo 2025-03-28 10:48:13 +09:00
parent dec3e86e5e
commit c37f9d38a3
4 changed files with 13 additions and 1 deletions
locales
packages/frontend/src
pages/chat
utility

4
locales/index.d.ts vendored
View file

@ -5476,6 +5476,10 @@ export interface Locale extends ILocale {
*
*/
"chatNotAvailableForThisAccountOrServer": string;
/**
* 使
*/
"chatNotAvailableInOtherAccount": string;
/**
*
*/

View file

@ -1366,6 +1366,7 @@ _chat:
muteThisRoom: "このルームをミュート"
deleteRoom: "ルームを削除"
chatNotAvailableForThisAccountOrServer: "このサーバー、またはこのアカウントでチャットは有効化されていません。"
chatNotAvailableInOtherAccount: "相手のアカウントでチャット機能が使えない状態になっています。"
cannotChatWithTheUser: "このユーザーとのチャットを開始できません"
cannotChatWithTheUser_description: "チャットが使えない状態になっているか、相手がチャットを開放していません。"
chatWithThisUser: "チャットする"

View file

@ -41,6 +41,12 @@ SPDX-License-Identifier: AGPL-3.0-only
<XMessage v-for="message in messages.toReversed()" :key="message.id" :message="message"/>
</TransitionGroup>
</div>
<div v-if="user && !user.canChat">
<MkInfo warn>{{ i18n.ts._chat.chatNotAvailableInOtherAccount }}</MkInfo>
</div>
<MkInfo v-if="!$i.policies.canChat" warn>{{ i18n.ts._chat.chatNotAvailableForThisAccountOrServer }}</MkInfo>
</MkSpacer>
<MkSpacer v-else-if="tab === 'search'" :contentMax="700">
@ -93,6 +99,7 @@ import { prefer } from '@/preferences.js';
import MkButton from '@/components/MkButton.vue';
import { useRouter } from '@/router.js';
import { useMutationObserver } from '@/use/use-mutation-observer.js';
import MkInfo from '@/components/MkInfo.vue';
const $i = ensureSignin();
const router = useRouter();

View file

@ -364,7 +364,7 @@ export function getUserMenu(user: Misskey.entities.UserDetailed, router: Router
},
});
if ($i.policies.canChat) {
if ($i.policies.canChat && user.canChat) {
menuItems.push({
type: 'link',
icon: 'ti ti-messages',