Skip to content

Commit 968faff

Browse files
authored
Added EmojiReaction payload types (#145)
* Added EmojiReaction payload types * I'm an author now * wordlist update * Moved MessageType protobuf into dedicated section With the inclusion of emoji reactions the MessageType protobuf was split out from the ChatMessage protobuf so that the MessageType enums could be used in multiple protobuf message types.
1 parent 3692daa commit 968faff

File tree

2 files changed

+73
-12
lines changed

2 files changed

+73
-12
lines changed

docs/draft/6-payloads.md

Lines changed: 67 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ title: 6/PAYLOADS
66

77
# 6/PAYLOADS
88

9-
> Version: 0.4
9+
> Version: 0.5
1010
>
1111
> Status: Draft
1212
>
13-
> Authors: Adam Babik <[email protected]>, Andrea Maria Piana <[email protected]>, Oskar Thorén <[email protected]> (alphabetical order)
13+
> Authors: Adam Babik <[email protected]>, Andrea Maria Piana <[email protected]>, Oskar Thorén <[email protected]>, Samuel Hawksby-Robinson <[email protected]> (alphabetical order)
1414
1515
## Abstract
1616

@@ -42,6 +42,7 @@ as various clients created using different technologies.
4242
- [Contact Update](#contact-update)
4343
- [Payload](#payload-2)
4444
- [Contact update](#contact-update-1)
45+
- [EmojiReaction](#emojireaction)
4546
- [SyncInstallationContact](#syncinstallationcontact)
4647
- [Payload](#payload-3)
4748
- [SyncInstallationPublicChat](#syncinstallationpublicchat)
@@ -117,13 +118,6 @@ message ChatMessage {
117118
AudioMessage audio = 11;
118119
}
119120
120-
enum MessageType {
121-
UNKNOWN_MESSAGE_TYPE = 0;
122-
ONE_TO_ONE = 1;
123-
PUBLIC_GROUP = 2;
124-
PRIVATE_GROUP = 3;
125-
// Only local
126-
SYSTEM_MESSAGE_PRIVATE_GROUP = 4;}
127121
enum ContentType {
128122
UNKNOWN_CONTENT_TYPE = 0;
129123
TEXT_PLAIN = 1;
@@ -151,7 +145,7 @@ message ChatMessage {
151145
| 6 | chat_id | `string` | The local ID of the chat the message is sent to |
152146
| 7 | message_type | `MessageType` | The type of message, different for one-to-one, public or group chats |
153147
| 8 | content_type | `ContentType` | The type of the content of the message |
154-
| 9 | payload | `Sticker|Image|Audio|nil` | The payload of the message based on the content type |
148+
| 9 | payload | `Sticker` I `Image` I `Audio` I `nil` | The payload of the message based on the content type |
155149

156150
#### Content types
157151

@@ -235,8 +229,6 @@ message AudioMessage {
235229
UNKNOWN_AUDIO_TYPE = 0;
236230
AAC = 1;
237231
AMR = 2;
238-
}
239-
}
240232
```
241233

242234
#### Message types
@@ -251,6 +243,17 @@ The following messages types MUST be supported:
251243
* `PUBLIC_GROUP` is a private message
252244
* `PRIVATE_GROUP` is a message to the private group.
253245

246+
```protobuf
247+
enum MessageType {
248+
UNKNOWN_MESSAGE_TYPE = 0;
249+
ONE_TO_ONE = 1;
250+
PUBLIC_GROUP = 2;
251+
PRIVATE_GROUP = 3;
252+
// Only local
253+
SYSTEM_MESSAGE_PRIVATE_GROUP = 4;
254+
}
255+
```
256+
254257
#### Clock vs Timestamp and message ordering
255258

256259
If a user sends a new message before the messages sent while the user was offline are received, the new
@@ -316,6 +319,52 @@ A client SHOULD send a `ContactUpdate` to all the contacts each time:
316319

317320
A client SHOULD also periodically send a `ContactUpdate` to all the contacts, the interval is up to the client, the Status official client sends these updates every 48 hours.
318321

322+
### EmojiReaction
323+
324+
`EmojiReaction`s represents a user's "reaction" to a specific chat message. For more information about the concept of
325+
emoji reactions see [Facebook Reactions](https://en.wikipedia.org/wiki/Facebook_like_button#Use_on_Facebook).
326+
327+
This specification RECOMMENDS that the UI/UX implementation of sending `EmojiReactions` requires only a single click
328+
operation, as users have an expectation that emoji reactions are effortless and simple to perform.
329+
330+
```protobuf
331+
message EmojiReaction {
332+
// clock Lamport timestamp of the chat message
333+
uint64 clock = 1;
334+
335+
// chat_id the ID of the chat the message belongs to, for query efficiency the chat_id is stored in the db even though the
336+
// target message also stores the chat_id
337+
string chat_id = 2;
338+
339+
// message_id the ID of the target message that the user wishes to react to
340+
string message_id = 3;
341+
342+
// message_type is (somewhat confusingly) the ID of the type of chat the message belongs to
343+
MessageType message_type = 4;
344+
345+
// type the ID of the emoji the user wishes to react with
346+
Type type = 5;
347+
348+
enum Type {
349+
UNKNOWN_EMOJI_REACTION_TYPE = 0;
350+
LOVE = 1;
351+
THUMBS_UP = 2;
352+
THUMBS_DOWN = 3;
353+
LAUGH = 4;
354+
SAD = 5;
355+
ANGRY = 6;
356+
}
357+
358+
// whether this is a retraction of a previously sent emoji
359+
bool retracted = 6;
360+
}
361+
```
362+
363+
Clients MUST specify `clock`, `chat_id`, `message_id`, `type` and `message_type`.
364+
365+
This specification RECOMMENDS that the UI/UX implementation of retracting an `EmojiReaction`s requires only a single
366+
click operation, as users have an expectation that emoji reaction removals are effortless and simple to perform.
367+
319368
### SyncInstallationContact
320369

321370
The node uses `SyncInstallationContact` messages to synchronize in a best-effort the contacts to other devices.
@@ -400,6 +449,12 @@ There are two ways to upgrade the protocol without breaking compatibility:
400449

401450
## Changelog
402451

452+
### Version 0.5
453+
454+
Released [//TODO]()
455+
456+
- Added support for emoji reactions
457+
403458
### Version 0.4
404459

405460
Released [July 16, 2020](https://github.com/status-im/specs/commit/ad45cd5fed3c0f79dfa472253a404f670dd47396)

wordlist.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
Ack
22
activePublicKey
33
ACL
4+
AAC
5+
AMR
6+
AudioType
47
AES
58
APIs
69
APN
@@ -76,6 +79,8 @@ EE
7679
Eigenmann
7780
EIP
7881
EIPs
82+
EmojiReaction
83+
EmojiReactionRetraction
7984
EncodeToString
8085
enode
8186
enr
@@ -219,6 +224,7 @@ requestMessages
219224
RLP
220225
RLPx
221226
RPC
227+
retraction
222228
scalability
223229
scalable
224230
secp

0 commit comments

Comments
 (0)