diff --git a/src/lib/chat/adapters/nip-10-adapter.ts b/src/lib/chat/adapters/nip-10-adapter.ts index ffc33b3..07b8959 100644 --- a/src/lib/chat/adapters/nip-10-adapter.ts +++ b/src/lib/chat/adapters/nip-10-adapter.ts @@ -847,7 +847,7 @@ export class Nip10Adapter extends ChatProtocolAdapter { private eventToMessage( event: NostrEvent, conversationId: string, - _rootEventId: string, + rootEventId: string, ): Message | null { // Handle zap receipts (kind 9735) if (event.kind === 9735) { @@ -867,12 +867,14 @@ export class Nip10Adapter extends ChatProtocolAdapter { let replyTo: string | undefined; if (refs.reply?.e) { - // Replying to another reply - show reply preview + // Replying to another reply replyTo = refs.reply.e.id; + } else if (refs.root?.e) { + // Replying directly to root + replyTo = refs.root.e.id; } else { - // Replying directly to root or malformed - don't show reply preview - // (replying to root is implied in thread chat context) - replyTo = undefined; + // Malformed or legacy reply - assume replying to root + replyTo = rootEventId; } return {