feat: index direct message content (NIP-17 ChatMessageEvent)

ChatMessageEvent (kind 14) is the decrypted NIP-17 rumor; its content is the
plaintext message. Index it so DMs are locally searchable, consistent with
messaging-client search. Opt-in confirmed by the maintainer; private zaps
(9733) remain excluded.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RFdWREvyvixRXnmNXNzmmN
This commit is contained in:
Claude
2026-06-18 20:58:11 +00:00
parent a7bf23a00d
commit ffe3af1035
@@ -30,6 +30,7 @@ import com.vitorpamplona.quartz.nip01Core.tags.people.PTag
import com.vitorpamplona.quartz.nip01Core.tags.people.toPTag
import com.vitorpamplona.quartz.nip17Dm.base.BaseDMGroupEvent
import com.vitorpamplona.quartz.nip31Alts.alt
import com.vitorpamplona.quartz.nip50Search.SearchableEvent
import com.vitorpamplona.quartz.utils.TimeUtils
@Immutable
@@ -40,7 +41,11 @@ class ChatMessageEvent(
tags: Array<Array<String>>,
content: String,
sig: HexKey,
) : BaseDMGroupEvent(id, pubKey, createdAt, KIND, tags, content, sig) {
) : BaseDMGroupEvent(id, pubKey, createdAt, KIND, tags, content, sig),
SearchableEvent {
// content is the decrypted (plaintext) direct-message body.
override fun indexableContent() = content
fun replyTo() = tags.mapNotNull(ETag::parseId)
companion object {