Specify chat2 message format (#440)

* Specify chat2 message format

* Clarify payload is UTF8 encoded
This commit is contained in:
Hanno Cornelius 2021-03-31 17:06:20 +02:00 committed by GitHub
parent e4fc68b6ea
commit 27844c9a20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 1 deletions

View File

@ -68,4 +68,18 @@ This will bypass the random peer selection process and connect to the specified
| --- | --- |
| `/help` | displays available in-chat commands |
| `/connect` | interactively connect to a new peer |
| `/nick` | change nickname for current chat session |
| `/nick` | change nickname for current chat session |
## `chat2` message protobuf format
Each `chat2` message is encoded as follows
```protobuf
message Chat2Message {
uint64 timestamp = 1;
string nick = 2;
bytes payload = 3;
}
```
where `timestamp` is the Unix timestamp of the message, `nick` is the relevant `chat2` user's selected nickname and `payload` is the actual chat message being sent. The `payload` is the byte array representation of a UTF8 encoded string.