mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-04-11 07:56:50 +02:00
revert: restore reply preview logic in NIP-10 adapter
Reverted changes to eventToMessage() that removed reply previews for root replies. The UI-level hiding of reply interactions on the root message is sufficient - reply previews can still be shown for consistency with other messages. Changes: - Restored rootEventId parameter (removed underscore prefix) - Restored full reply detection logic (reply, root, or fallback) - Reply previews now shown for all replies including root replies
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user