Skip to content

Commit 8d0811a

Browse files
committed
docs: Run prettier-markdown on markdown files.
1 parent 969e3a2 commit 8d0811a

File tree

7 files changed

+372
-280
lines changed

7 files changed

+372
-280
lines changed

.restyled.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
---
22
exclude:
3-
# shfmt doesn't support this file
3+
# shfmt doesn't support this file.
44
- "other/analysis/run-clang-tidy"
5+
# Generated file.
6+
- "CHANGELOG.md"
57

68
restylers:
79
- astyle:
@@ -17,6 +19,7 @@ restylers:
1719
include:
1820
- "**/*.cc"
1921
- "**/*.hh"
22+
- prettier-markdown
2023
- prettier-yaml
2124
- reorder-python-imports
2225
- shellharden

INSTALL.md

Lines changed: 124 additions & 77 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
# ![Project Tox](https://raw.github.com/TokTok/c-toxcore/master/other/tox.png "Project Tox")
22

3-
**Current Coverage:** [![coverage](https://codecov.io/gh/TokTok/c-toxcore/branch/master/graph/badge.svg?token=BRfCKo02De)](https://codecov.io/gh/TokTok/c-toxcore)
3+
**Current Coverage:**
4+
[![coverage](https://codecov.io/gh/TokTok/c-toxcore/branch/master/graph/badge.svg?token=BRfCKo02De)](https://codecov.io/gh/TokTok/c-toxcore)
45

5-
[**Website**](https://tox.chat) **|** [**Wiki**](https://wiki.tox.chat/) **|** [**Blog**](https://blog.tox.chat/) **|** [**FAQ**](https://wiki.tox.chat/doku.php?id=users:faq) **|** [**Binaries/Downloads**](https://tox.chat/download.html) **|** [**Clients**](https://wiki.tox.chat/doku.php?id=clients) **|** [**Compiling**](/INSTALL.md)
6+
[**Website**](https://tox.chat) **|** [**Wiki**](https://wiki.tox.chat/) **|**
7+
[**Blog**](https://blog.tox.chat/) **|**
8+
[**FAQ**](https://wiki.tox.chat/doku.php?id=users:faq) **|**
9+
[**Binaries/Downloads**](https://tox.chat/download.html) **|**
10+
[**Clients**](https://wiki.tox.chat/doku.php?id=clients) **|**
11+
[**Compiling**](/INSTALL.md)
612

713
## What is Tox
814

@@ -16,29 +22,33 @@ and privacy easy to obtain for regular users. It uses
1622
### ![Danger: Experimental](other/tox-warning.png)
1723

1824
This is an **experimental** cryptographic network library. It has not been
19-
formally audited by an independent third party that specializes in
20-
cryptography or cryptanalysis. **Use this library at your own risk.**
25+
formally audited by an independent third party that specializes in cryptography
26+
or cryptanalysis. **Use this library at your own risk.**
2127

2228
The underlying crypto library [libsodium](https://doc.libsodium.org/) provides
2329
reliable encryption, but the security model has not yet been fully specified.
24-
See [issue 210](https://github.com/TokTok/c-toxcore/issues/210) for a
25-
discussion on developing a threat model. See other issues for known weaknesses
26-
(e.g. [issue 426](https://github.com/TokTok/c-toxcore/issues/426) describes
27-
what can happen if your secret key is stolen).
30+
See [issue 210](https://github.com/TokTok/c-toxcore/issues/210) for a discussion
31+
on developing a threat model. See other issues for known weaknesses (e.g.
32+
[issue 426](https://github.com/TokTok/c-toxcore/issues/426) describes what can
33+
happen if your secret key is stolen).
2834

2935
## Toxcore Development Roadmap
3036

31-
The roadmap and changelog are generated from GitHub issues. You may view them
32-
on the website, where they are updated at least once every 24 hours:
37+
The roadmap and changelog are generated from GitHub issues. You may view them on
38+
the website, where they are updated at least once every 24 hours:
3339

34-
- Changelog: https://toktok.ltd/changelog/c-toxcore
35-
- Roadmap: https://toktok.ltd/roadmap/c-toxcore
40+
- Changelog: https://toktok.ltd/changelog/c-toxcore
41+
- Roadmap: https://toktok.ltd/roadmap/c-toxcore
3642

3743
## Installing toxcore
3844

3945
Detailed installation instructions can be found in [INSTALL.md](INSTALL.md).
4046

41-
Be advised that due to the addition of `cmp` as a submodule, you now also need to initialize the git submodules required by toxcore. This can be done by cloning the repo with the following command: `git clone --recurse-submodules https://github.com/Toktok/c-toxcore` or by running `git submodule update --init` in the root directory of the repo.
47+
Be advised that due to the addition of `cmp` as a submodule, you now also need
48+
to initialize the git submodules required by toxcore. This can be done by
49+
cloning the repo with the following command:
50+
`git clone --recurse-submodules https://github.com/Toktok/c-toxcore` or by
51+
running `git submodule update --init` in the root directory of the repo.
4252

4353
In a nutshell, if you have [libsodium](https://github.com/jedisct1/libsodium)
4454
installed, run:
@@ -74,17 +84,17 @@ if (err_new != TOX_ERR_NEW_OK) {
7484
}
7585
```
7686

77-
Here, we simply exit the program, but in a real client you will probably want
78-
to do some error handling and proper error reporting to the user. The `NULL`
87+
Here, we simply exit the program, but in a real client you will probably want to
88+
do some error handling and proper error reporting to the user. The `NULL`
7989
argument given to the first parameter of `tox_new` is the `Tox_Options`. It
80-
contains various write-once network settings and allows you to load a
81-
previously serialised instance. See [toxcore/tox.h](tox.h) for details.
90+
contains various write-once network settings and allows you to load a previously
91+
serialised instance. See [toxcore/tox.h](tox.h) for details.
8292

8393
### Setting up callbacks
8494

85-
Toxcore works with callbacks that you can register to listen for certain
86-
events. Examples of such events are "friend request received" or "friend sent
87-
a message". Search the API for `tox_callback_*` to find all of them.
95+
Toxcore works with callbacks that you can register to listen for certain events.
96+
Examples of such events are "friend request received" or "friend sent a
97+
message". Search the API for `tox_callback_*` to find all of them.
8898

8999
Here, we will set up callbacks for receiving friend requests and receiving
90100
messages. We will always accept any friend request (because we're a bot), and

docs/Group-Chats.md

Lines changed: 76 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,77 +2,122 @@ Group chats.
22

33
Note: we assume everyone in the chat trusts each other.
44

5-
These group chats work by temporarily adding the 4 "closest" people defined by a distance function
6-
in group.c in order to form a circle of connected peers. These peers then relay messages to each other.
7-
8-
A friend invites another friend to a group chat by sending them an invite packet. The friend either ignores
9-
the invite or responds with a response packet if he wants to join the chat. The friend invite contains the type
10-
of groupchat (text only, A/V) the friend is being invited to.
5+
These group chats work by temporarily adding the 4 "closest" people defined by a
6+
distance function in group.c in order to form a circle of connected peers. These
7+
peers then relay messages to each other.
118

9+
A friend invites another friend to a group chat by sending them an invite
10+
packet. The friend either ignores the invite or responds with a response packet
11+
if he wants to join the chat. The friend invite contains the type of groupchat
12+
(text only, A/V) the friend is being invited to.
1213

1314
TODO(irungentoo): write more of this.
1415

1516
## Protocol
1617

1718
Invite packets:
18-
Invite packet:
19+
20+
### Invite packet:
21+
22+
```
1923
[uint8_t id 96][uint8_t id 0][uint16_t group chat number][33 bytes group chat identifier[1 byte type][32 bytes id]]
24+
```
2025

21-
Response packet
26+
### Response packet
27+
28+
```
2229
[uint8_t id 96][uint8_t id 1][uint16_t group chat number(local)][uint16_t group chat number to join][33 bytes group chat identifier[1 byte type][32 bytes id]]
30+
```
2331

32+
### Peer online packet:
2433

25-
Peer online packet:
34+
```
2635
[uint8_t id 97][uint16_t group chat number (local)][33 bytes group chat identifier[1 byte type][32 bytes id]]
36+
```
37+
38+
### Peer leave packet:
2739

28-
Peer leave packet:
40+
```
2941
[uint8_t id 98][uint16_t group chat number][uint8_t id 1]
42+
```
3043

31-
Peer query packet:
44+
### Peer query packet:
45+
46+
```
3247
[uint8_t id 98][uint16_t group chat number][uint8_t id 8]
48+
```
49+
50+
### Peer response packet:
51+
52+
```
53+
[uint8_t id 98][uint16_t group chat number][uint8_t id 9][Repeated times number of peers: [uint16_t peer num][uint8_t 32bytes real public key][uint8_t 32bytes temp DHT public key][uint8_t name length][name]]
54+
```
3355

34-
Peer response packet:
35-
[uint8_t id 98][uint16_t group chat number][uint8_t id 9][Repeated times number of peers: [uint16_t peer num][uint8_t 32bytes real public key][uint8_t 32bytes temp DHT public key][uint8_t name length][name]]
56+
### Title response packet:
3657

37-
Title response packet:
58+
```
3859
[uint8_t id 98][uint16_t group chat number][uint8_t id 10][title]
60+
```
3961

40-
Message packets:
62+
### Message packets:
63+
64+
```
4165
[uint8_t id 99][uint16_t group chat number][uint16_t peer number][uint32_t message number][uint8_t with a value representing id of message][data]
66+
```
67+
68+
### Lossy Message packets:
4269

43-
Lossy Message packets:
70+
```
4471
[uint8_t id 199][uint16_t group chat number][uint16_t peer number][uint16_t message number][uint8_t with a value representing id of message][data]
72+
```
4573

46-
Group chat types:
47-
0: text
48-
1: AV
74+
## Group chat types:
4975

76+
- 0: text
77+
- 1: AV
5078

5179
Note: the message number is increased by 1 for each sent message.
5280

53-
message ids:
54-
0 - ping
55-
sent every ~60 seconds by every peer.
56-
No data.
81+
## message ids:
82+
83+
### 0 - ping
84+
85+
sent every ~60 seconds by every peer. No data.
86+
87+
### 16 - new_peer
5788

58-
16 - new_peer
5989
Tell everyone about a new peer in the chat.
90+
91+
```
6092
[uint16_t peer_num][uint8_t 32bytes real public key][uint8_t 32bytes temp DHT public key]
93+
```
94+
95+
### 17 - kill_peer
6196

62-
17 - kill_peer
97+
```
6398
[uint16_t peer_num]
99+
```
64100

65-
48 - name change
101+
### 48 - name change
102+
103+
```
66104
[uint8_t name[namelen]]
105+
```
106+
107+
### 49 - groupchat title change
67108

68-
49 - groupchat title change
109+
```
69110
[uint8_t title[titlelen]]
111+
```
70112

71-
64 - chat message
72-
[uint8_t message[messagelen]]
113+
### 64 - chat message
73114

74-
65 - action (/me)
115+
```
75116
[uint8_t message[messagelen]]
117+
```
76118

119+
### 65 - action (/me)
77120

78-
121+
```
122+
[uint8_t message[messagelen]]
123+
```

docs/apidsl.md

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)