diff options
| author | hodlbod <jstaab@protonmail.com> | 2025-05-21 16:06:08 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-21 16:06:08 -0700 |
| commit | 509613b9fa612f662d9339d66dc0918733321529 (patch) | |
| tree | 083201580d3b780ba1b891827c160e15497047b3 /25.md | |
| parent | 0c993526f0c662af44fdf562dfc74f32521df9bb (diff) | |
Add hints to nip 25 (#1702)
Co-authored-by: Jon Staab <shtaab@gmail.com>
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() |