feat: diff-sync follows

This commit is contained in:
2024-04-15 22:31:51 +01:00
parent edf64e4125
commit 5a7657a95d
25 changed files with 320 additions and 154 deletions

View File

@ -78,7 +78,10 @@ export class NostrLink implements ToNostrEventTag {
return true;
}
} else if (this.type === NostrPrefix.Event || this.type === NostrPrefix.Note) {
return this.id === ev.id;
const ifSetCheck = <T>(a: T | undefined, b: T) => {
return !Boolean(a) || a === b;
};
return ifSetCheck(this.id, ev.id) && ifSetCheck(this.author, ev.pubkey) && ifSetCheck(this.kind, ev.kind);
}
return false;