mirror of
https://github.com/aljazceru/ditto.git
synced 2026-01-10 17:14:20 +01:00
eventMatchesTemplate: let the event timestamp be greater than the template
This commit is contained in:
10
src/utils.ts
10
src/utils.ts
@@ -123,7 +123,15 @@ function eventMatchesTemplate(event: Event, template: EventTemplate): boolean {
|
||||
event = stripTags(event, whitelist);
|
||||
template = stripTags(template, whitelist);
|
||||
|
||||
return getEventHash(event) === getEventHash({ pubkey: event.pubkey, ...template });
|
||||
if (template.created_at > event.created_at) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return getEventHash(event) === getEventHash({
|
||||
pubkey: event.pubkey,
|
||||
...template,
|
||||
created_at: event.created_at,
|
||||
});
|
||||
}
|
||||
|
||||
/** Test whether the value is a Nostr ID. */
|
||||
|
||||
Reference in New Issue
Block a user