fix: show 'Encrypted direct messages not supported' for kind 4 events (#754)

* fix: show 'Encrypted direct messages not supported' for kind 4 events (#753)

Co-authored-by: The Daniel <dmnyc@users.noreply.github.com>

* i18n: add translations for 'Encrypted direct messages not supported'

Also use kinds.EncryptedDirectMessage constant instead of magic number 4.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: The Daniel 🖖 <3638467+dmnyc@users.noreply.github.com>
Co-authored-by: The Daniel <dmnyc@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Cody Tseng 2026-02-18 13:43:19 +08:00 committed by GitHub
parent 2fbbe6ce1d
commit ae8a534103
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 33 additions and 3 deletions

View file

@ -110,5 +110,13 @@ export default function ContentPreview({
return <FollowPackPreview event={event} className={className} />
}
return <div className={className}>[{t('Cannot handle event of kind k', { k: event.kind })}]</div>
return (
<div className={className}>
[
{event.kind === kinds.EncryptedDirectMessage
? t('Encrypted direct messages not supported')
: t('Cannot handle event of kind k', { k: event.kind })}
]
</div>
)
}

View file

@ -1,5 +1,5 @@
import { cn } from '@/lib/utils'
import { Event } from 'nostr-tools'
import { Event, kinds } from 'nostr-tools'
import { useTranslation } from 'react-i18next'
import ClientSelect from '../ClientSelect'
@ -13,7 +13,11 @@ export default function UnknownNote({ event, className }: { event: Event; classN
className
)}
>
<div>{t('Cannot handle event of kind k', { k: event.kind })}</div>
<div>
{event.kind === kinds.EncryptedDirectMessage
? t('Encrypted direct messages not supported')
: t('Cannot handle event of kind k', { k: event.kind })}
</div>
<ClientSelect event={event} />
</div>
)

View file

@ -178,6 +178,7 @@ export default {
'Supported NIPs': 'NIPs المدعومة',
'Open in a': 'فتح في {{a}}',
'Cannot handle event of kind k': 'لا يمكن معالجة الحدث من النوع {{k}}',
'Encrypted direct messages not supported': 'الرسائل المباشرة المشفرة غير مدعومة',
'Sorry! The note cannot be found 😔': 'عذراً! لا يمكن العثور على الملاحظة 😔',
'This user has been muted': 'تم كتم هذا المستخدم',
Wallet: 'المحفظة',

View file

@ -182,6 +182,7 @@ export default {
'Supported NIPs': 'Unterstützte NIPs',
'Open in a': 'Öffnen in {{a}}',
'Cannot handle event of kind k': 'Ereignis des Typs {{k}} kann nicht verarbeitet werden',
'Encrypted direct messages not supported': 'Verschlüsselte Direktnachrichten werden nicht unterstützt',
'Sorry! The note cannot be found 😔': 'Entschuldigung! Die Notiz wurde nicht gefunden 😔',
'This user has been muted': 'Dieser Benutzer wurde stummgeschaltet',
Wallet: 'Wallet',

View file

@ -179,6 +179,7 @@ export default {
'Supported NIPs': 'Supported NIPs',
'Open in a': 'Open in {{a}}',
'Cannot handle event of kind k': 'Cannot handle event of kind {{k}}',
'Encrypted direct messages not supported': 'Encrypted direct messages not supported',
'Sorry! The note cannot be found 😔': 'Sorry! The note cannot be found 😔',
'This user has been muted': 'This user has been muted',
Wallet: 'Wallet',

View file

@ -182,6 +182,7 @@ export default {
'Supported NIPs': 'NIPs soportados',
'Open in a': 'Abrir en {{a}}',
'Cannot handle event of kind k': 'No se puede manejar el evento de tipo {{k}}',
'Encrypted direct messages not supported': 'Mensajes directos cifrados no compatibles',
'Sorry! The note cannot be found 😔': '¡Lo siento! No se pudo encontrar la nota 😔',
'This user has been muted': 'Este usuario ha sido silenciado',
Wallet: 'Billetera',

View file

@ -180,6 +180,7 @@ export default {
'Supported NIPs': 'NIPهای پشتیبانی شده',
'Open in a': 'باز کردن در {{a}}',
'Cannot handle event of kind k': 'نمی‌توان رویداد از نوع {{k}} را پردازش کرد',
'Encrypted direct messages not supported': 'پیام‌های مستقیم رمزگذاری‌شده پشتیبانی نمی‌شوند',
'Sorry! The note cannot be found 😔': 'متأسفانه! یادداشت یافت نشد 😔',
'This user has been muted': 'این کاربر بی‌صدا شده است',
Wallet: 'کیف پول',

View file

@ -181,6 +181,7 @@ export default {
'Supported NIPs': 'NIPs supportés',
'Open in a': 'Ouvrir dans {{a}}',
'Cannot handle event of kind k': "Impossible de traiter l'événement de type {{k}}",
'Encrypted direct messages not supported': 'Messages directs chiffrés non pris en charge',
'Sorry! The note cannot be found 😔': 'Désolé ! La note est introuvable 😔',
'This user has been muted': 'Cet utilisateur a été mis en sourdine',
Wallet: 'Portefeuille',

View file

@ -181,6 +181,7 @@ export default {
'Supported NIPs': 'समर्थित NIPs',
'Open in a': '{{a}} में खोलें',
'Cannot handle event of kind k': 'प्रकार {{k}} के इवेंट को हैंडल नहीं कर सकते',
'Encrypted direct messages not supported': 'एन्क्रिप्टेड डायरेक्ट मैसेज समर्थित नहीं हैं',
'Sorry! The note cannot be found 😔': 'माफ करें! नोट नहीं मिल सका 😔',
'This user has been muted': 'इस उपयोगकर्ता को म्यूट कर दिया गया है',
Wallet: 'वॉलेट',

View file

@ -180,6 +180,7 @@ export default {
'Supported NIPs': 'Támogatott NIP-ek',
'Open in a': 'Megnyitás itt: {{a}}',
'Cannot handle event of kind k': 'Nem támogatott ez a fajta esemény: {{k}}',
'Encrypted direct messages not supported': 'A titkosított közvetlen üzenetek nem támogatottak',
'Sorry! The note cannot be found 😔': 'Ejj! A poszt nem található 😔',
'This user has been muted': 'Ez a felhasználó némítva van',
Wallet: 'Tárca',

View file

@ -181,6 +181,7 @@ export default {
'Supported NIPs': 'NIP supportati',
'Open in a': 'Apri in {{a}}',
'Cannot handle event of kind k': 'Impossibile gestire un evento di tipo {{k}}',
'Encrypted direct messages not supported': 'Messaggi diretti crittografati non supportati',
'Sorry! The note cannot be found 😔': 'Spiacente! La nota non può essere trovata 😔',
'This user has been muted': 'Questo utente è stato zittito',
Wallet: 'Wallet',

View file

@ -180,6 +180,7 @@ export default {
'Supported NIPs': '対応NIP',
'Open in a': '{{a}}で開く',
'Cannot handle event of kind k': '種類{{k}}のイベントは処理できません',
'Encrypted direct messages not supported': '暗号化ダイレクトメッセージには対応していません',
'Sorry! The note cannot be found 😔': '申し訳ありません!ノートが見つかりません 😔',
'This user has been muted': 'このユーザーはミュートされています',
Wallet: 'ウォレット',

View file

@ -181,6 +181,7 @@ export default {
'Supported NIPs': '지원 NIP',
'Open in a': '{{a}}에서 열기',
'Cannot handle event of kind k': '{{k}} 유형의 이벤트를 처리할 수 없습니다',
'Encrypted direct messages not supported': '암호화된 다이렉트 메시지는 지원되지 않습니다',
'Sorry! The note cannot be found 😔': '죄송합니다! 해당 노트를 찾을 수 없습니다 😔',
'This user has been muted': '이 사용자는 차단되었습니다',
Wallet: '지갑',

View file

@ -178,6 +178,7 @@ export default {
'Supported NIPs': 'Obsługiwane NIP-y',
'Open in a': 'Otwórz w {{a}}',
'Cannot handle event of kind k': 'Nie można obsłużyć zdarzenia typu {{k}}',
'Encrypted direct messages not supported': 'Szyfrowane wiadomości bezpośrednie nie są obsługiwane',
'Sorry! The note cannot be found 😔 ': 'Przepraszam! Nie można znaleźć wpisu 😔',
'This user has been muted': 'Ten użytkownik został przyblokowany',
Wallet: 'Portfel',

View file

@ -181,6 +181,7 @@ export default {
'Supported NIPs': 'NIPs Suportados',
'Open in a': 'Abrir em {{a}}',
'Cannot handle event of kind k': 'Não é possível lidar com o evento do tipo {{k}}',
'Encrypted direct messages not supported': 'Mensagens diretas criptografadas não suportadas',
'Sorry! The note cannot be found 😔': 'Desculpe! A nota não pode ser encontrada 😔',
'This user has been muted': 'Este usuário foi silenciado',
Wallet: 'Carteira',

View file

@ -181,6 +181,7 @@ export default {
'Supported NIPs': 'NIPs Suportados',
'Open in a': 'Abrir em {{a}}',
'Cannot handle event of kind k': 'Não é possível lidar com o evento do tipo {{k}}',
'Encrypted direct messages not supported': 'Mensagens diretas encriptadas não suportadas',
'Sorry! The note cannot be found 😔': 'Desculpe! A nota não pode ser encontrada 😔',
'This user has been muted': 'Este usuário foi silenciado',
Wallet: 'Carteira',

View file

@ -183,6 +183,7 @@ export default {
'Supported NIPs': 'Поддерживаемые NIP',
'Open in a': 'Открыть в {{a}}',
'Cannot handle event of kind k': 'Невозможно обработать событие типа {{k}}',
'Encrypted direct messages not supported': 'Зашифрованные личные сообщения не поддерживаются',
'Sorry! The note cannot be found 😔': 'Извините! Заметка не найдена 😔',
'This user has been muted': 'Этот пользователь заглушен',
Wallet: 'Кошелёк',

View file

@ -178,6 +178,7 @@ export default {
'Supported NIPs': 'NIP ที่รองรับ',
'Open in a': 'เปิดใน {{a}}',
'Cannot handle event of kind k': 'ไม่สามารถจัดการเหตุการณ์ประเภท {{k}}',
'Encrypted direct messages not supported': 'ไม่รองรับข้อความส่วนตัวที่เข้ารหัส',
'Sorry! The note cannot be found 😔': 'ขออภัย! ไม่พบโน้ต 😔',
'This user has been muted': 'ผู้ใช้นี้ถูกปิดเสียง',
Wallet: 'กระเป๋าสตางค์',

View file

@ -180,6 +180,7 @@ export default {
'Supported NIPs': '支援的 NIP',
'Open in a': '在 {{a}} 中開啟',
'Cannot handle event of kind k': '無法處理類型為 {{k}} 的事件',
'Encrypted direct messages not supported': '不支援加密私訊',
'Sorry! The note cannot be found 😔': '抱歉!找不到該筆記 😔',
'This user has been muted': '該使用者已被封鎖',
Wallet: '錢包',

View file

@ -180,6 +180,7 @@ export default {
'Supported NIPs': '支持的 NIP',
'Open in a': '在 {{a}} 中打开',
'Cannot handle event of kind k': '无法处理类型为 {{k}} 的事件',
'Encrypted direct messages not supported': '不支持加密私信',
'Sorry! The note cannot be found 😔': '抱歉!找不到该笔记 😔',
'This user has been muted': '该用户已被屏蔽',
Wallet: '钱包',