diff options
| author | Don <ukanikola@gmail.com> | 2023-10-11 20:55:27 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-11 08:55:27 -0300 |
| commit | 324c7aafdcd316fb971c1f26b964d2b53c939a10 (patch) | |
| tree | 9a6d527d87bee9871dcc6871b4dc65b395c4aaef /25.md | |
| parent | 21c6c12c524cb71f18e068c9bcf223cda0214b5f (diff) | |
Change wording to imply that reactions can target any event (#815)
* kind:17 generic reactions.
* `kind 7` is available for all kind events.
* `k` tag is not required.
Diffstat (limited to '25.md')
| -rw-r--r-- | 25.md | 6 |
1 files changed, 5 insertions, 1 deletions
| @@ -7,7 +7,7 @@ Reactions | |||
| 7 | 7 | ||
| 8 | `draft` `optional` `author:jb55` | 8 | `draft` `optional` `author:jb55` |
| 9 | 9 | ||
| 10 | A reaction is a `kind 7` note that is used to react to other notes. | 10 | A reaction is a `kind 7` event that is used to react to other events. |
| 11 | 11 | ||
| 12 | The generic reaction, represented by the `content` set to a `+` string, SHOULD | 12 | The generic reaction, represented by the `content` set to a `+` string, SHOULD |
| 13 | be interpreted as a "like" or "upvote". | 13 | be interpreted as a "like" or "upvote". |
| @@ -34,6 +34,9 @@ The last `e` tag MUST be the `id` of the note that is being reacted to. | |||
| 34 | 34 | ||
| 35 | The last `p` tag MUST be the `pubkey` of the event being reacted to. | 35 | The last `p` tag MUST be the `pubkey` of the event being reacted to. |
| 36 | 36 | ||
| 37 | The reaction event MAY include a `k` tag with the stringified kind number | ||
| 38 | of the reacted event as its value. | ||
| 39 | |||
| 37 | Example code | 40 | Example code |
| 38 | 41 | ||
| 39 | ```swift | 42 | ```swift |
| @@ -43,6 +46,7 @@ func make_like_event(pubkey: String, privkey: String, liked: NostrEvent) -> Nost | |||
| 43 | } | 46 | } |
| 44 | tags.append(["e", liked.id]) | 47 | tags.append(["e", liked.id]) |
| 45 | tags.append(["p", liked.pubkey]) | 48 | tags.append(["p", liked.pubkey]) |
| 49 | tags.append(["k", liked.kind]) | ||
| 46 | let ev = NostrEvent(content: "+", pubkey: pubkey, kind: 7, tags: tags) | 50 | let ev = NostrEvent(content: "+", pubkey: pubkey, kind: 7, tags: tags) |
| 47 | ev.calculate_id() | 51 | ev.calculate_id() |
| 48 | ev.sign(privkey: privkey) | 52 | ev.sign(privkey: privkey) |