diff --git a/js/nostr/commentEvents.js b/js/nostr/commentEvents.js index f40c9be4..b60213c0 100644 --- a/js/nostr/commentEvents.js +++ b/js/nostr/commentEvents.js @@ -943,6 +943,9 @@ function isVideoCommentEvent(event, descriptor) { let hasEventTag = !requiresEventMatch; let hasParentTag = false; + let matchedDefinitionPointer = false; + let matchedEventPointer = false; + const expectedRootKind = normalizeDescriptorString( targetDescriptor.rootKind || targetDescriptor.videoKind, ); @@ -998,6 +1001,7 @@ function isVideoCommentEvent(event, descriptor) { normalizedValue === normalizedVideoDefinitionAddress ) { hasDefinitionTag = true; + matchedDefinitionPointer = true; } } else if (lowerName === "e") { if ( @@ -1005,6 +1009,7 @@ function isVideoCommentEvent(event, descriptor) { normalizedValue === normalizedVideoEventId ) { hasEventTag = true; + matchedEventPointer = true; } if ( normalizedParentCommentId && @@ -1043,6 +1048,10 @@ function isVideoCommentEvent(event, descriptor) { } } + if (!hasDefinitionTag && requiresAddressMatch && matchedEventPointer) { + hasDefinitionTag = true; + } + if (!hasIdentifierTag || !hasDefinitionTag || !hasEventTag) { return false; }