mirror of
https://github.com/nostr-protocol/nips.git
synced 2025-12-09 00:28:51 +00:00
Add hints to nip 25 (#1702)
Co-authored-by: Jon Staab <shtaab@gmail.com>
This commit is contained in:
11
25.md
11
25.md
@@ -33,12 +33,17 @@ If the event being reacted to is an addressable event, an `a` SHOULD be included
|
|||||||
|
|
||||||
The reaction SHOULD include a `k` tag with the stringified kind number of the reacted event as its value.
|
The reaction SHOULD include a `k` tag with the stringified kind number of the reacted event as its value.
|
||||||
|
|
||||||
|
The `e` and `a` tags SHOULD include relay and pubkey hints. The `p` tags SHOULD include relay hints.
|
||||||
|
|
||||||
|
The reaction event MAY include a `k` tag with the stringified kind number of the reacted event as its value.
|
||||||
|
|
||||||
**Example code**
|
**Example code**
|
||||||
|
|
||||||
```swift
|
```swift
|
||||||
func make_like_event(pubkey: String, privkey: String, liked: NostrEvent) -> NostrEvent {
|
func make_like_event(pubkey: String, privkey: String, liked: NostrEvent, hint: String) -> NostrEvent {
|
||||||
tags.append(["e", liked.id, liked.source_relays.first ?? ""])
|
var tags: [[String]] = []
|
||||||
tags.append(["p", liked.pubkey])
|
tags.append(["e", liked.id, hint, liked.pubkey])
|
||||||
|
tags.append(["p", liked.pubkey, hint])
|
||||||
tags.append(["k", String(liked.kind)])
|
tags.append(["k", String(liked.kind)])
|
||||||
let ev = NostrEvent(content: "+", pubkey: pubkey, kind: 7, tags: tags)
|
let ev = NostrEvent(content: "+", pubkey: pubkey, kind: 7, tags: tags)
|
||||||
ev.calculate_id()
|
ev.calculate_id()
|
||||||
|
|||||||
Reference in New Issue
Block a user