mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-09 06:12:56 +00:00
Fix comment event matching for uppercase addresses
This commit is contained in:
1 parent
71df75a8d1
commit
c882139e90
2 files changed
+69
-10
No files matched your search
+33
-10
@@ -916,13 +916,27 @@ function isVideoCommentEvent(event, descriptor) {
|
||||
descriptor && typeof descriptor === "object" ? descriptor : {};
|
||||
|
||||
const tags = Array.isArray(event.tags) ? event.tags : [];
|
||||
const requiresRootIdentifierMatch = Boolean(targetDescriptor.rootIdentifier);
|
||||
const normalizedRootIdentifier = normalizeTagValue(
|
||||
targetDescriptor.rootIdentifier,
|
||||
);
|
||||
const normalizedVideoDefinitionAddress = normalizeTagValue(
|
||||
targetDescriptor.videoDefinitionAddress,
|
||||
);
|
||||
const normalizedVideoEventId = normalizeTagValue(
|
||||
targetDescriptor.videoEventId,
|
||||
);
|
||||
const normalizedParentCommentId = normalizeTagValue(
|
||||
targetDescriptor.parentCommentId,
|
||||
);
|
||||
|
||||
const requiresRootIdentifierMatch = Boolean(normalizedRootIdentifier);
|
||||
const requiresAddressMatch =
|
||||
!requiresRootIdentifierMatch && Boolean(targetDescriptor.videoDefinitionAddress);
|
||||
!requiresRootIdentifierMatch && Boolean(normalizedVideoDefinitionAddress);
|
||||
const requiresEventMatch =
|
||||
!requiresRootIdentifierMatch && !requiresAddressMatch &&
|
||||
Boolean(targetDescriptor.videoEventId);
|
||||
const requiresParentTag = Boolean(targetDescriptor.parentCommentId);
|
||||
!requiresRootIdentifierMatch &&
|
||||
!requiresAddressMatch &&
|
||||
Boolean(normalizedVideoEventId);
|
||||
const requiresParentTag = Boolean(normalizedParentCommentId);
|
||||
|
||||
let hasIdentifierTag = !requiresRootIdentifierMatch;
|
||||
let hasDefinitionTag = !requiresAddressMatch;
|
||||
@@ -972,20 +986,29 @@ function isVideoCommentEvent(event, descriptor) {
|
||||
}
|
||||
|
||||
if (lowerName === "i") {
|
||||
if (normalizedValue === targetDescriptor.rootIdentifier) {
|
||||
if (
|
||||
normalizedRootIdentifier &&
|
||||
normalizedValue === normalizedRootIdentifier
|
||||
) {
|
||||
hasIdentifierTag = true;
|
||||
}
|
||||
} else if (lowerName === "a") {
|
||||
if (normalizedValue === targetDescriptor.videoDefinitionAddress) {
|
||||
if (
|
||||
normalizedVideoDefinitionAddress &&
|
||||
normalizedValue === normalizedVideoDefinitionAddress
|
||||
) {
|
||||
hasDefinitionTag = true;
|
||||
}
|
||||
} else if (lowerName === "e") {
|
||||
if (normalizedValue === targetDescriptor.videoEventId) {
|
||||
if (
|
||||
normalizedVideoEventId &&
|
||||
normalizedValue === normalizedVideoEventId
|
||||
) {
|
||||
hasEventTag = true;
|
||||
}
|
||||
if (
|
||||
targetDescriptor.parentCommentId &&
|
||||
normalizedValue === targetDescriptor.parentCommentId
|
||||
normalizedParentCommentId &&
|
||||
normalizedValue === normalizedParentCommentId
|
||||
) {
|
||||
hasParentTag = true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user