Skip to content

Commit 496e5e0

Browse files
committed
getEventReplyingTo fix
1 parent 3e94c98 commit 496e5e0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/utils/nostr.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ export function getEventReplyingTo(event: NDKEvent) {
2121
if (replyTag) {
2222
return replyTag[1]
2323
}
24+
// If there's a root tag and it's the only e tag (besides mentions),
25+
// it's a direct reply to the root
26+
const rootTag = event.tags?.find((tag) => tag[0] === "e" && tag[3] === "root")
27+
if (rootTag && replyTags.length === 1) {
28+
return rootTag[1]
29+
}
2430
return undefined
2531
}
2632

0 commit comments

Comments
 (0)