upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--25.md6
1 files changed, 2 insertions, 4 deletions
diff --git a/25.md b/25.md
index 8c71d47..72109c0 100644
--- a/25.md
+++ b/25.md
@@ -31,7 +31,7 @@ The SHOULD be a `p` tag set to the `pubkey` of the event being reacted to. If a
31 31
32If the event being reacted to is an addressable event, an `a` SHOULD be included together with the `e` tag, it must be set to the coordinates (`kind:pubkey:d-tag`) of the event being reacted to. 32If the event being reacted to is an addressable event, an `a` SHOULD be included together with the `e` tag, it must be set to the coordinates (`kind:pubkey:d-tag`) of the event being reacted to.
33 33
34If the target event is not a `kind:1`, then the reaction MAY include a `k` tag with the stringified kind number of the reacted event as its value. 34The reaction SHOULD include a `k` tag with the stringified kind number of the reacted event as its value.
35 35
36**Example code** 36**Example code**
37 37
@@ -39,9 +39,7 @@ If the target event is not a `kind:1`, then the reaction MAY include a `k` tag w
39func make_like_event(pubkey: String, privkey: String, liked: NostrEvent) -> NostrEvent { 39func make_like_event(pubkey: String, privkey: String, liked: NostrEvent) -> NostrEvent {
40 tags.append(["e", liked.id, liked.source_relays.first ?? ""]) 40 tags.append(["e", liked.id, liked.source_relays.first ?? ""])
41 tags.append(["p", liked.pubkey]) 41 tags.append(["p", liked.pubkey])
42 if liked.kind != 1 { 42 tags.append(["k", String(liked.kind)])
43 tags.append(["k", liked.kind])
44 }
45 let ev = NostrEvent(content: "+", pubkey: pubkey, kind: 7, tags: tags) 43 let ev = NostrEvent(content: "+", pubkey: pubkey, kind: 7, tags: tags)
46 ev.calculate_id() 44 ev.calculate_id()
47 ev.sign(privkey: privkey) 45 ev.sign(privkey: privkey)