summaryrefslogtreecommitdiff
path: root/toxcore/group.h
diff options
context:
space:
mode:
Diffstat (limited to 'toxcore/group.h')
-rw-r--r--toxcore/group.h22
1 files changed, 18 insertions, 4 deletions
diff --git a/toxcore/group.h b/toxcore/group.h
index a5b5723c..94ae28bf 100644
--- a/toxcore/group.h
+++ b/toxcore/group.h
@@ -29,11 +29,14 @@
29 29
30enum { 30enum {
31 GROUPCHAT_STATUS_NONE, 31 GROUPCHAT_STATUS_NONE,
32 GROUPCHAT_STATUS_VALID 32 GROUPCHAT_STATUS_VALID,
33 GROUPCHAT_STATUS_CONNECTED
33}; 34};
34 35
35typedef struct { 36typedef struct {
36 uint8_t client_id[crypto_box_PUBLICKEYBYTES]; 37 uint8_t real_pk[crypto_box_PUBLICKEYBYTES];
38 uint8_t temp_pk[crypto_box_PUBLICKEYBYTES];
39
37 uint64_t pingid; 40 uint64_t pingid;
38 uint64_t last_pinged; 41 uint64_t last_pinged;
39 42
@@ -50,13 +53,14 @@ typedef struct {
50 uint16_t peer_number; 53 uint16_t peer_number;
51} Group_Peer; 54} Group_Peer;
52 55
53#define DESIRED_CLOSE_CONNECTIONS 3 56#define DESIRED_CLOSE_CONNECTIONS 4
54#define MAX_GROUP_CONNECTIONS 16 57#define MAX_GROUP_CONNECTIONS 16
55#define GROUP_IDENTIFIER_LENGTH crypto_box_KEYBYTES /* So we can use new_symmetric_key(...) to fill it */ 58#define GROUP_IDENTIFIER_LENGTH crypto_box_KEYBYTES /* So we can use new_symmetric_key(...) to fill it */
56 59
57enum { 60enum {
58 GROUPCHAT_CLOSE_NONE, 61 GROUPCHAT_CLOSE_NONE,
59 GROUPCHAT_CLOSE_CONNECTION 62 GROUPCHAT_CLOSE_CONNECTION,
63 GROUPCHAT_CLOSE_ONLINE
60}; 64};
61 65
62typedef struct { 66typedef struct {
@@ -67,10 +71,19 @@ typedef struct {
67 71
68 struct { 72 struct {
69 uint8_t type; /* GROUPCHAT_CLOSE_* */ 73 uint8_t type; /* GROUPCHAT_CLOSE_* */
74 uint8_t closest;
70 uint32_t number; 75 uint32_t number;
71 uint16_t group_number; 76 uint16_t group_number;
72 } close[MAX_GROUP_CONNECTIONS]; 77 } close[MAX_GROUP_CONNECTIONS];
73 78
79 uint8_t real_pk[crypto_box_PUBLICKEYBYTES];
80 struct {
81 uint8_t entry;
82 uint8_t real_pk[crypto_box_PUBLICKEYBYTES];
83 uint8_t temp_pk[crypto_box_PUBLICKEYBYTES];
84 } closest_peers[DESIRED_CLOSE_CONNECTIONS];
85 uint8_t changed;
86
74 uint8_t identifier[GROUP_IDENTIFIER_LENGTH]; 87 uint8_t identifier[GROUP_IDENTIFIER_LENGTH];
75 88
76 uint32_t message_number; 89 uint32_t message_number;
@@ -79,6 +92,7 @@ typedef struct {
79 92
80typedef struct { 93typedef struct {
81 Messenger *m; 94 Messenger *m;
95 Friend_Connections *fr_c;
82 96
83 Group_c *chats; 97 Group_c *chats;
84 uint32_t num_chats; 98 uint32_t num_chats;