fix: isReplyToThis

This commit is contained in:
kieran 2024-05-01 18:22:11 +01:00
parent e4f611834e
commit 746021d40a
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941

View File

@ -127,7 +127,7 @@ export class NostrLink implements ToNostrEventTag {
if (NonNip10Kinds.includes(ev.kind)) { if (NonNip10Kinds.includes(ev.kind)) {
const links = removeUndefined(ev.tags.filter(a => a[0] === "e" || a[0] === "a").map(a => NostrLink.fromTag(a))); const links = removeUndefined(ev.tags.filter(a => a[0] === "e" || a[0] === "a").map(a => NostrLink.fromTag(a)));
if (links.length === 0) return false; if (links.length === 0) return false;
return links.some(a => a.matchesEvent(ev)); return links.some(a => a.equals(this));
} else { } else {
const thread = EventExt.extractThread(ev); const thread = EventExt.extractThread(ev);
if (!thread) return false; // non-thread events are not replies if (!thread) return false; // non-thread events are not replies
@ -177,8 +177,7 @@ export class NostrLink implements ToNostrEventTag {
} }
equals(other: NostrLink) { equals(other: NostrLink) {
if (other.type === this.type && this.type === NostrPrefix.Address) { return other.tagKey === this.tagKey;
}
} }
static fromTag(tag: Array<string>, author?: string, kind?: number) { static fromTag(tag: Array<string>, author?: string, kind?: number) {