diff options
| author | Vitor Pamplona <vitor@vitorpamplona.com> | 2023-12-29 17:25:26 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-29 17:25:26 -0500 |
| commit | 2986982106fc10647459ad698ab12ab86cca1327 (patch) | |
| tree | 7c194ca6ed282af2a30ce611320876f60ffadc99 | |
| parent | 000c51ef44c3ff1e0842139ada3859ba0a9b540f (diff) | |
| parent | ec08d65665fd533be685702501b69fe9ce7bdd24 (diff) | |
Merge pull request #914 from tyiu/nip52-amendments
Amend NIP-52 to require the content field to be provided, and decouple calendar identifier from calendar name
| -rw-r--r-- | 24.md | 1 | ||||
| -rw-r--r-- | 52.md | 34 |
2 files changed, 25 insertions, 10 deletions
| @@ -39,3 +39,4 @@ tags | |||
| 39 | These tags may be present in multiple event kinds. Whenever a different meaning is not specified by some more specific NIP, they have the following meanings: | 39 | These tags may be present in multiple event kinds. Whenever a different meaning is not specified by some more specific NIP, they have the following meanings: |
| 40 | 40 | ||
| 41 | - `r`: a web URL the event is referring to in some way | 41 | - `r`: a web URL the event is referring to in some way |
| 42 | - `title`: title of the event | ||
| @@ -22,19 +22,22 @@ This kind of calendar event starts on a date and ends before a different date in | |||
| 22 | 22 | ||
| 23 | The format uses a parameterized replaceable event kind `31922`. | 23 | The format uses a parameterized replaceable event kind `31922`. |
| 24 | 24 | ||
| 25 | The `.content` of these events is optional and should be a detailed description of the calendar event. | 25 | The `.content` of these events should be a detailed description of the calendar event. It is required but can be an empty string. |
| 26 | 26 | ||
| 27 | The list of tags are as follows: | 27 | The list of tags are as follows: |
| 28 | * `d` (required) universally unique identifier (UUID). Generated by the client creating the calendar event. | 28 | * `d` (required) universally unique identifier (UUID). Generated by the client creating the calendar event. |
| 29 | * `name` (required) name of the calendar event | 29 | * `title` (required) title of the calendar event |
| 30 | * `start` (required) inclusive start date in ISO 8601 format (YYYY-MM-DD). Must be less than `end`, if it exists. | 30 | * `start` (required) inclusive start date in ISO 8601 format (YYYY-MM-DD). Must be less than `end`, if it exists. |
| 31 | * `end` (optional) exclusive end date in ISO 8601 format (YYYY-MM-DD). If omitted, the calendar event ends on the same date as `start`. | 31 | * `end` (optional) exclusive end date in ISO 8601 format (YYYY-MM-DD). If omitted, the calendar event ends on the same date as `start`. |
| 32 | * `location` (optional) location of the calendar event. e.g. address, GPS coordinates, meeting room name, link to video call | 32 | * `location` (optional, repeated) location of the calendar event. e.g. address, GPS coordinates, meeting room name, link to video call |
| 33 | * `g` (optional) [geohash](https://en.wikipedia.org/wiki/Geohash) to associate calendar event with a searchable physical location | 33 | * `g` (optional) [geohash](https://en.wikipedia.org/wiki/Geohash) to associate calendar event with a searchable physical location |
| 34 | * `p` (optional, repeated) 32-bytes hex pubkey of a participant, optional recommended relay URL, and participant's role in the meeting | 34 | * `p` (optional, repeated) 32-bytes hex pubkey of a participant, optional recommended relay URL, and participant's role in the meeting |
| 35 | * `t` (optional, repeated) hashtag to categorize calendar event | 35 | * `t` (optional, repeated) hashtag to categorize calendar event |
| 36 | * `r` (optional, repeated) references / links to web pages, documents, video calls, recorded videos, etc. | 36 | * `r` (optional, repeated) references / links to web pages, documents, video calls, recorded videos, etc. |
| 37 | 37 | ||
| 38 | The following tags are deprecated: | ||
| 39 | * `name` name of the calendar event. Use only if `title` is not available. | ||
| 40 | |||
| 38 | ```json | 41 | ```json |
| 39 | { | 42 | { |
| 40 | "id": <32-bytes lowercase hex-encoded SHA-256 of the the serialized event data>, | 43 | "id": <32-bytes lowercase hex-encoded SHA-256 of the the serialized event data>, |
| @@ -45,7 +48,7 @@ The list of tags are as follows: | |||
| 45 | "tags": [ | 48 | "tags": [ |
| 46 | ["d", "<UUID>"], | 49 | ["d", "<UUID>"], |
| 47 | 50 | ||
| 48 | ["name", "<name of calendar event>"], | 51 | ["title", "<title of calendar event>"], |
| 49 | 52 | ||
| 50 | // Dates | 53 | // Dates |
| 51 | ["start", "<YYYY-MM-DD>"], | 54 | ["start", "<YYYY-MM-DD>"], |
| @@ -78,21 +81,24 @@ This kind of calendar event spans between a start time and end time. | |||
| 78 | 81 | ||
| 79 | The format uses a parameterized replaceable event kind `31923`. | 82 | The format uses a parameterized replaceable event kind `31923`. |
| 80 | 83 | ||
| 81 | The `.content` of these events is optional and should be a detailed description of the calendar event. | 84 | The `.content` of these events should be a detailed description of the calendar event. It is required but can be an empty string. |
| 82 | 85 | ||
| 83 | The list of tags are as follows: | 86 | The list of tags are as follows: |
| 84 | * `d` (required) universally unique identifier (UUID). Generated by the client creating the calendar event. | 87 | * `d` (required) universally unique identifier (UUID). Generated by the client creating the calendar event. |
| 85 | * `name` (required) name of the calendar event | 88 | * `title` (required) title of the calendar event |
| 86 | * `start` (required) inclusive start Unix timestamp in seconds. Must be less than `end`, if it exists. | 89 | * `start` (required) inclusive start Unix timestamp in seconds. Must be less than `end`, if it exists. |
| 87 | * `end` (optional) exclusive end Unix timestamp in seconds. If omitted, the calendar event ends instantaneously. | 90 | * `end` (optional) exclusive end Unix timestamp in seconds. If omitted, the calendar event ends instantaneously. |
| 88 | * `start_tzid` (optional) time zone of the start timestamp, as defined by the IANA Time Zone Database. e.g., `America/Costa_Rica` | 91 | * `start_tzid` (optional) time zone of the start timestamp, as defined by the IANA Time Zone Database. e.g., `America/Costa_Rica` |
| 89 | * `end_tzid` (optional) time zone of the end timestamp, as defined by the IANA Time Zone Database. e.g., `America/Costa_Rica`. If omitted and `start_tzid` is provided, the time zone of the end timestamp is the same as the start timestamp. | 92 | * `end_tzid` (optional) time zone of the end timestamp, as defined by the IANA Time Zone Database. e.g., `America/Costa_Rica`. If omitted and `start_tzid` is provided, the time zone of the end timestamp is the same as the start timestamp. |
| 90 | * `location` (optional) location of the calendar event. e.g. address, GPS coordinates, meeting room name, link to video call | 93 | * `location` (optional, repeated) location of the calendar event. e.g. address, GPS coordinates, meeting room name, link to video call |
| 91 | * `g` (optional) [geohash](https://en.wikipedia.org/wiki/Geohash) to associate calendar event with a searchable physical location | 94 | * `g` (optional) [geohash](https://en.wikipedia.org/wiki/Geohash) to associate calendar event with a searchable physical location |
| 92 | * `p` (optional, repeated) 32-bytes hex pubkey of a participant, optional recommended relay URL, and participant's role in the meeting | 95 | * `p` (optional, repeated) 32-bytes hex pubkey of a participant, optional recommended relay URL, and participant's role in the meeting |
| 93 | * `t` (optional, repeated) hashtag to categorize calendar event | 96 | * `t` (optional, repeated) hashtag to categorize calendar event |
| 94 | * `r` (optional, repeated) references / links to web pages, documents, video calls, recorded videos, etc. | 97 | * `r` (optional, repeated) references / links to web pages, documents, video calls, recorded videos, etc. |
| 95 | 98 | ||
| 99 | The following tags are deprecated: | ||
| 100 | * `name` name of the calendar event. Use only if `title` is not available. | ||
| 101 | |||
| 96 | ```json | 102 | ```json |
| 97 | { | 103 | { |
| 98 | "id": <32-bytes lowercase hex-encoded SHA-256 of the the serialized event data>, | 104 | "id": <32-bytes lowercase hex-encoded SHA-256 of the the serialized event data>, |
| @@ -103,7 +109,7 @@ The list of tags are as follows: | |||
| 103 | "tags": [ | 109 | "tags": [ |
| 104 | ["d", "<UUID>"], | 110 | ["d", "<UUID>"], |
| 105 | 111 | ||
| 106 | ["name", "<name of calendar event>"], | 112 | ["title", "<title of calendar event>"], |
| 107 | 113 | ||
| 108 | // Timestamps | 114 | // Timestamps |
| 109 | ["start", "<Unix timestamp in seconds>"], | 115 | ["start", "<Unix timestamp in seconds>"], |
| @@ -137,15 +143,23 @@ A calendar is a collection of calendar events, represented as a custom replaceab | |||
| 137 | 143 | ||
| 138 | ### Format | 144 | ### Format |
| 139 | 145 | ||
| 146 | The `.content` of these events should be a detailed description of the calendar. It is required but can be an empty string. | ||
| 147 | |||
| 140 | The format uses a custom replaceable list of kind `31924` with a list of tags as described below: | 148 | The format uses a custom replaceable list of kind `31924` with a list of tags as described below: |
| 141 | * `d` (required) calendar name | 149 | * `d` (required) universally unique identifier. Generated by the client creating the calendar. |
| 150 | * `title` (required) calendar title | ||
| 142 | * `a` (repeated) reference tag to kind `31922` or `31923` calendar event being responded to | 151 | * `a` (repeated) reference tag to kind `31922` or `31923` calendar event being responded to |
| 143 | 152 | ||
| 144 | ```json | 153 | ```json |
| 145 | { | 154 | { |
| 155 | "id": <32-bytes lowercase hex-encoded SHA-256 of the the serialized event data>, | ||
| 156 | "pubkey": <32-bytes lowercase hex-encoded public key of the event creator>, | ||
| 157 | "created_at": <Unix timestamp in seconds>, | ||
| 146 | "kind": 31924, | 158 | "kind": 31924, |
| 159 | "content": "<description of calendar>", | ||
| 147 | "tags": [ | 160 | "tags": [ |
| 148 | ["d", "<calendar name>"], | 161 | ["d", "<UUID>"], |
| 162 | ["title", "<calendar title>"], | ||
| 149 | ["a", "<31922 or 31923>:<calendar event author pubkey>:<d-identifier of calendar event>", "<optional relay url>"], | 163 | ["a", "<31922 or 31923>:<calendar event author pubkey>:<d-identifier of calendar event>", "<optional relay url>"], |
| 150 | ["a", "<31922 or 31923>:<calendar event author pubkey>:<d-identifier of calendar event>", "<optional relay url>"] | 164 | ["a", "<31922 or 31923>:<calendar event author pubkey>:<d-identifier of calendar event>", "<optional relay url>"] |
| 151 | ] | 165 | ] |