mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 03:19:46 +00:00
eventMatchesTemplate: let the event timestamp be greater than the template
This commit is contained in:
parent
e55ddbd8e6
commit
595fb2cfc6
1 changed files with 9 additions and 1 deletions
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. */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue