diff options
| author | fiatjaf_ <fiatjaf@gmail.com> | 2023-08-09 07:26:51 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-09 07:26:51 -0300 |
| commit | 5026747008c0a84c14079c39807296eebd409c36 (patch) | |
| tree | adbc9bf9038d776d74ad7fdd62f7b49132f5a1db /25.md | |
| parent | 9fa9045d19b93f4cbac231bff39558108a6e82ae (diff) | |
| parent | ce7e6b2100918648ec4341c5fe517d076e8d225c (diff) | |
Merge branch 'master' into vending-machine
Diffstat (limited to '25.md')
| -rw-r--r-- | 25.md | 24 |
1 files changed, 23 insertions, 1 deletions
| @@ -18,7 +18,7 @@ downvote or dislike on a post. A client MAY also choose to tally likes against | |||
| 18 | dislikes in a reddit-like system of upvotes and downvotes, or display them as | 18 | dislikes in a reddit-like system of upvotes and downvotes, or display them as |
| 19 | separate tallies. | 19 | separate tallies. |
| 20 | 20 | ||
| 21 | The `content` MAY be an emoji, in this case it MAY be interpreted as a "like" or "dislike", | 21 | The `content` MAY be an emoji, or [NIP-30](30.md) custom emoji in this case it MAY be interpreted as a "like" or "dislike", |
| 22 | or the client MAY display this emoji reaction on the post. | 22 | or the client MAY display this emoji reaction on the post. |
| 23 | 23 | ||
| 24 | Tags | 24 | Tags |
| @@ -47,3 +47,25 @@ func make_like_event(pubkey: String, privkey: String, liked: NostrEvent) -> Nost | |||
| 47 | ev.sign(privkey: privkey) | 47 | ev.sign(privkey: privkey) |
| 48 | return ev | 48 | return ev |
| 49 | } | 49 | } |
| 50 | ``` | ||
| 51 | |||
| 52 | Custom Emoji Reaction | ||
| 53 | --------------------- | ||
| 54 | |||
| 55 | The client may specify a custom emoji ([NIP-30](30.md)) `:shortcode:` in the | ||
| 56 | reaction content. The client should refer to the emoji tag and render the | ||
| 57 | content as an emoji if shortcode is specified. | ||
| 58 | |||
| 59 | ```json | ||
| 60 | { | ||
| 61 | "kind": 7, | ||
| 62 | "content": ":soapbox:", | ||
| 63 | "tags": [ | ||
| 64 | ["emoji", "soapbox", "https://gleasonator.com/emoji/Gleasonator/soapbox.png"] | ||
| 65 | ], | ||
| 66 | "pubkey": "79c2cae114ea28a981e7559b4fe7854a473521a8d22a66bbab9fa248eb820ff6", | ||
| 67 | "created_at": 1682790000 | ||
| 68 | } | ||
| 69 | ``` | ||
| 70 | |||
| 71 | The content can be set only one `:shortcode:`. And emoji tag should be one. | ||