fix: detect and decrypt NIP-04 encrypted bookmark content

Added explicit NIP-04 detection in bookmarkProcessing.ts:
- Check for ?iv= in content (NIP-04 format)
- Previously only checked Helpers.hasHiddenContent() (NIP-44 only)
- Now decrypts both NIP-04 and NIP-44 encrypted bookmarks

This fixes individual bookmark decryption returning 0 private items
despite having encrypted content.
This commit is contained in:
Gigi
2025-10-17 21:39:15 +02:00
parent 21228cd212
commit 2fb25da9d6

View File

@@ -166,7 +166,15 @@ export async function collectBookmarksFromEvents(
)
// Schedule decrypt if needed
if (signerCandidate && ((Helpers.hasHiddenTags(evt) && !Helpers.isHiddenTagsUnlocked(evt)) || Helpers.hasHiddenContent(evt))) {
// Check for NIP-44 (Helpers.hasHiddenContent), NIP-04 (?iv= in content), or encrypted tags
const hasNip04Content = evt.content && evt.content.includes('?iv=')
const needsDecrypt = signerCandidate && (
(Helpers.hasHiddenTags(evt) && !Helpers.isHiddenTagsUnlocked(evt)) ||
Helpers.hasHiddenContent(evt) ||
hasNip04Content
)
if (needsDecrypt) {
decryptJobs.push({ evt, metadata })
} else {
// Check for already-unlocked hidden bookmarks