From f3e55f99584e93dc60c41d2bc54684c7efffca0e Mon Sep 17 00:00:00 2001 From: nrobi144 Date: Thu, 19 Mar 2026 09:11:46 +0200 Subject: [PATCH] fix(chats): handle ChatMessageEncryptedFileHeaderEvent in GiftWrap unwrap The GiftWrap inner event handler only processed ChatMessageEvent (kind 14) and ReactionEvent. ChatMessageEncryptedFileHeaderEvent (kind 15) was silently dropped, so encrypted file attachments never appeared in DMs. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../com/vitorpamplona/amethyst/desktop/Main.kt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/Main.kt b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/Main.kt index e61a8bfb4..3d106a9e4 100644 --- a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/Main.kt +++ b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/Main.kt @@ -649,6 +649,18 @@ fun MainContent( ) } + is com.vitorpamplona.quartz.nip17Dm.files.ChatMessageEncryptedFileHeaderEvent -> { + val innerNote = localCache.getOrCreateNote(innerEvent.id) + val innerAuthor = localCache.getOrCreateUser(innerEvent.pubKey) + if (innerNote.event == null) { + innerNote.loadEvent(innerEvent, innerAuthor, emptyList()) + } + iAccount.chatroomList.addMessage( + innerEvent.chatroomKey(iAccount.pubKey), + innerNote, + ) + } + is com.vitorpamplona.quartz.nip25Reactions.ReactionEvent -> { val reactionNote = localCache.getOrCreateNote(innerEvent.id) val reactionAuthor = localCache.getOrCreateUser(innerEvent.pubKey)