diff options
Diffstat (limited to '25.md')
| -rw-r--r-- | 25.md | 11 |
1 files changed, 8 insertions, 3 deletions
| @@ -33,12 +33,17 @@ If the event being reacted to is an addressable event, an `a` SHOULD be included | |||
| 33 | 33 | ||
| 34 | The reaction SHOULD include a `k` tag with the stringified kind number of the reacted event as its value. | 34 | The reaction SHOULD include a `k` tag with the stringified kind number of the reacted event as its value. |
| 35 | 35 | ||
| 36 | The `e` and `a` tags SHOULD include relay and pubkey hints. The `p` tags SHOULD include relay hints. | ||
| 37 | |||
| 38 | The reaction event MAY include a `k` tag with the stringified kind number of the reacted event as its value. | ||
| 39 | |||
| 36 | **Example code** | 40 | **Example code** |
| 37 | 41 | ||
| 38 | ```swift | 42 | ```swift |
| 39 | func make_like_event(pubkey: String, privkey: String, liked: NostrEvent) -> NostrEvent { | 43 | func make_like_event(pubkey: String, privkey: String, liked: NostrEvent, hint: String) -> NostrEvent { |
| 40 | tags.append(["e", liked.id, liked.source_relays.first ?? ""]) | 44 | var tags: [[String]] = [] |
| 41 | tags.append(["p", liked.pubkey]) | 45 | tags.append(["e", liked.id, hint, liked.pubkey]) |
| 46 | tags.append(["p", liked.pubkey, hint]) | ||
| 42 | tags.append(["k", String(liked.kind)]) | 47 | tags.append(["k", String(liked.kind)]) |
| 43 | let ev = NostrEvent(content: "+", pubkey: pubkey, kind: 7, tags: tags) | 48 | let ev = NostrEvent(content: "+", pubkey: pubkey, kind: 7, tags: tags) |
| 44 | ev.calculate_id() | 49 | ev.calculate_id() |