upleb.uk

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

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Thibault <jdthibault2@gmail.com>2022-08-13 10:03:37 -0400
committerGitHub <noreply@github.com>2022-08-13 10:03:37 -0400
commita902083bac9b95ec1ed9e4e1dc1d018b4a7f2696 (patch)
treefb4e6124971c8b012326ec52e6f0cf58e94779ff
parentd1b6bdb18e522fa34ff7cfec3d56318da596fdff (diff)
parent7fe572ec5a7321726c9469f70a93bb278be8d774 (diff)
Merge branch 'nostr-protocol:master' into nip22-unacceptable-event-time
-rw-r--r--16.md2
-rw-r--r--25.md49
-rw-r--r--README.md2
3 files changed, 52 insertions, 1 deletions
diff --git a/16.md b/16.md
index dba1b9c..3f22901 100644
--- a/16.md
+++ b/16.md
@@ -21,7 +21,7 @@ Upon an ephemeral event being received, the relay SHOULD send it to all clients
21Client Behavior 21Client Behavior
22--------------- 22---------------
23 23
24Clients SHOULD use the `supported_nips` field to learn if a relay supports generic tag queries. Clients SHOULD NOT send ephemeral events to relays that do not support this NIP; they will most likely be persisted. Clients MAY send replaceable events to relays that may not support this NIP, and clients querying SHOULD be prepared for the relay to send multiple events and should use the latest one. 24Clients SHOULD use the `supported_nips` field to learn if a relay supports this NIP. Clients SHOULD NOT send ephemeral events to relays that do not support this NIP; they will most likely be persisted. Clients MAY send replaceable events to relays that may not support this NIP, and clients querying SHOULD be prepared for the relay to send multiple events and should use the latest one.
25 25
26Suggested Use Cases 26Suggested Use Cases
27------------------- 27-------------------
diff --git a/25.md b/25.md
new file mode 100644
index 0000000..b294255
--- /dev/null
+++ b/25.md
@@ -0,0 +1,49 @@
1
2NIP-25
3======
4
5Reactions
6---------
7
8`draft` `optional` `author:jb55`
9
10A reaction is a `kind 7` note that is used to react to `kind 1` text notes.
11
12The generic reaction, represented by the `content` set to a `+` string, SHOULD
13be interpreted as a "like" or "upvote".
14
15A reaction with `content` set to `-` SHOULD be interepreted as a "dislike" or
16"downvote". It SHOULD NOT be counted as a "like", and MAY be displayed as a
17downvote or dislike on a post. A client MAY also choose to tally likes against
18dislikes in a reddit-like system of upvotes and downvotes, or display them as
19separate tallys.
20
21The `content` MAY be an emoji, in this case it MAY be interpreted as a "like",
22or the client MAY display this emoji reaction on the post.
23
24Tags
25----
26
27The reaction event SHOULD include `e` and `p` tags from the note the user is
28reacting to. This allows users to be notified of reactions to posts they were
29mentioned in. Including the `e` tags enables clients to pull all the reactions
30associated with individual posts or all the posts in a thread.
31
32The last `e` tag MUST be the `id` of the note that is being reacted to.
33
34The last `p` tag MUST be the `pubkey` of the event being reacted to.
35
36Example code
37
38```swift
39func make_like_event(pubkey: String, privkey: String, liked: NostrEvent) -> NostrEvent {
40 var tags: [[String]] = liked.tags.filter {
41 tag in tag.count >= 2 && (tag[0] == "e" || tag[0] == "p")
42 }
43 tags.append(["e", liked.id])
44 tags.append(["p", liked.pubkey])
45 let ev = NostrEvent(content: "", pubkey: pubkey, kind: 7, tags: tags)
46 ev.calculate_id()
47 ev.sign(privkey: privkey)
48 return ev
49}
diff --git a/README.md b/README.md
index 446003e..acf8689 100644
--- a/README.md
+++ b/README.md
@@ -18,6 +18,7 @@ NIPs stand for **Nostr Implementation Possibilities**. They exist to document wh
18- [NIP-14: Subject tag in text events.](14.md) 18- [NIP-14: Subject tag in text events.](14.md)
19- [NIP-15: End of Stored Events Notice](15.md) 19- [NIP-15: End of Stored Events Notice](15.md)
20- [NIP-16: Event Treatment](16.md) 20- [NIP-16: Event Treatment](16.md)
21- [NIP-25: Reactions](25.md)
21 22
22## Event Kinds 23## Event Kinds
23 24
@@ -29,6 +30,7 @@ NIPs stand for **Nostr Implementation Possibilities**. They exist to document wh
29| 3 | Contacts | 2 | 30| 3 | Contacts | 2 |
30| 4 | Encrypted Direct Messages | 4 | 31| 4 | Encrypted Direct Messages | 4 |
31| 5 | Event Deletion | 9 | 32| 5 | Event Deletion | 9 |
33| 7 | Reaction | 25 |
32 34
33Please update this list when proposing NIPs introducing new event kinds. 35Please update this list when proposing NIPs introducing new event kinds.
34 36