diff options
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) |