fix: 🐛

This commit is contained in:
codytseng
2025-06-25 11:01:53 +08:00
parent cb32439896
commit 6c2cd0ff42
7 changed files with 131 additions and 19 deletions

View File

@@ -187,10 +187,12 @@ export async function createCommentDraftEvent(
const {
quoteEventIds,
rootEventId,
rootCoordinateTag,
rootKind,
rootPubkey,
rootUrl,
parentEventId,
parentCoordinate,
parentKind,
parentPubkey
} = await extractCommentMentions(content, parentEvent)
@@ -207,7 +209,9 @@ export async function createCommentDraftEvent(
tags.push(...mentions.filter((pubkey) => pubkey !== parentPubkey).map((pubkey) => ['p', pubkey]))
if (rootEventId) {
if (rootCoordinateTag) {
tags.push(rootCoordinateTag)
} else if (rootEventId) {
tags.push(
rootPubkey
? ['E', rootEventId, client.getEventHint(rootEventId), rootPubkey]
@@ -225,7 +229,9 @@ export async function createCommentDraftEvent(
}
tags.push(
...[
['e', parentEventId, client.getEventHint(parentEventId), parentPubkey],
parentCoordinate
? ['a', parentCoordinate, client.getEventHint(parentEventId)]
: ['e', parentEventId, client.getEventHint(parentEventId), parentPubkey],
['k', parentKind.toString()],
['p', parentPubkey]
]