upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/22.md
diff options
context:
space:
mode:
authorJeff Thibault <jdthibault2@gmail.com>2022-08-14 11:26:39 -0400
committerGitHub <noreply@github.com>2022-08-14 11:26:39 -0400
commit903cc0992eedd752a688ce11c77d8a7bea57ae82 (patch)
tree87b59b9aba0b58f089d302a161b617ba22459c07 /22.md
parente8a501c08ffb9f99eb823419957cce5cf80a3e44 (diff)
add Giszmo, add comment in code example
Diffstat (limited to '22.md')
-rw-r--r--22.md5
1 files changed, 3 insertions, 2 deletions
diff --git a/22.md b/22.md
index c212802..e4cea51 100644
--- a/22.md
+++ b/22.md
@@ -4,11 +4,11 @@ NIP-22
4Event `created_at` Limits 4Event `created_at` Limits
5--------------------------- 5---------------------------
6 6
7`draft` `optional` `author:jeffthibault` 7`draft` `optional` `author:jeffthibault` `author:Giszmo`
8 8
9Relays may define both upper and lower limits within which they will consider an event's `created_at` to be acceptable. Both the upper and lower limits MUST be unix timestamps in seconds as defined in [NIP-01](01.md). 9Relays may define both upper and lower limits within which they will consider an event's `created_at` to be acceptable. Both the upper and lower limits MUST be unix timestamps in seconds as defined in [NIP-01](01.md).
10 10
11If a relay supports this NIP, the relay SHOULD send the client a `NOTICE` message saying the event was not stored for the `created_at` not being within the permitted limits. 11If a relay supports this NIP, the relay SHOULD send the client a `NOTICE` message saying the event was not stored for the `created_at` timestamp not being within the permitted limits.
12 12
13Client Behavior 13Client Behavior
14--------------- 14---------------
@@ -37,5 +37,6 @@ LOWER_LIMIT = TIME - (60 * 60 * 24) # Define lower limit as 1 day into the past
37UPPER_LIMIT = TIME + (60 * 15) # Define upper limit as 15 minutes into the future 37UPPER_LIMIT = TIME + (60 * 15) # Define upper limit as 15 minutes into the future
38 38
39if event.created_at not in range(LOWER_LIMIT, UPPER_LIMIT): 39if event.created_at not in range(LOWER_LIMIT, UPPER_LIMIT):
40 # NOTE: This is one example of a notice message. Relays can change this to notify clients however they like.
40 ws.send('["NOTICE", "The event created_at field is out of the acceptable range (-24h, +15min) for this relay and was not stored."]') 41 ws.send('["NOTICE", "The event created_at field is out of the acceptable range (-24h, +15min) for this relay and was not stored."]')
41``` 42```