mirror of
https://github.com/nostr-protocol/nips.git
synced 2025-03-17 21:32:11 +01:00
recommend using "k" tag always.
This commit is contained in:
parent
1b86a40df4
commit
23b069d469
6
25.md
6
25.md
@ -31,7 +31,7 @@ The SHOULD be a `p` tag set to the `pubkey` of the event being reacted to. If a
|
||||
|
||||
If 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.
|
||||
|
||||
If 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.
|
||||
The reaction SHOULD include a `k` tag with the stringified kind number of the reacted event as its value.
|
||||
|
||||
**Example code**
|
||||
|
||||
@ -39,9 +39,7 @@ If the target event is not a `kind:1`, then the reaction MAY include a `k` tag w
|
||||
func make_like_event(pubkey: String, privkey: String, liked: NostrEvent) -> NostrEvent {
|
||||
tags.append(["e", liked.id, liked.source_relays.first ?? ""])
|
||||
tags.append(["p", liked.pubkey])
|
||||
if liked.kind != 1 {
|
||||
tags.append(["k", liked.kind])
|
||||
}
|
||||
tags.append(["k", String(liked.kind)])
|
||||
let ev = NostrEvent(content: "+", pubkey: pubkey, kind: 7, tags: tags)
|
||||
ev.calculate_id()
|
||||
ev.sign(privkey: privkey)
|
||||
|
Loading…
x
Reference in New Issue
Block a user