summaryrefslogtreecommitdiff
path: root/toxcore/onion_client.h
diff options
context:
space:
mode:
Diffstat (limited to 'toxcore/onion_client.h')
-rw-r--r--toxcore/onion_client.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/toxcore/onion_client.h b/toxcore/onion_client.h
index 417e7f80..78587846 100644
--- a/toxcore/onion_client.h
+++ b/toxcore/onion_client.h
@@ -27,7 +27,7 @@
27#include "onion_announce.h" 27#include "onion_announce.h"
28 28
29#define MAX_ONION_CLIENTS 8 29#define MAX_ONION_CLIENTS 8
30#define ONION_NODE_TIMEOUT 200 30#define ONION_NODE_TIMEOUT 240
31 31
32/* The interval in seconds at which to tell our friends where we are */ 32/* The interval in seconds at which to tell our friends where we are */
33#define ONION_FAKEID_INTERVAL 60 33#define ONION_FAKEID_INTERVAL 60
@@ -43,6 +43,7 @@ typedef struct {
43 43
44typedef struct { 44typedef struct {
45 uint8_t status; /* 0 if friend is not valid, 1 if friend is valid.*/ 45 uint8_t status; /* 0 if friend is not valid, 1 if friend is valid.*/
46 uint8_t is_online; /* Set by the onion_set_friend_status function. */
46 47
47 uint8_t fake_client_id[crypto_box_PUBLICKEYBYTES]; 48 uint8_t fake_client_id[crypto_box_PUBLICKEYBYTES];
48 uint8_t real_client_id[crypto_box_PUBLICKEYBYTES]; 49 uint8_t real_client_id[crypto_box_PUBLICKEYBYTES];
@@ -94,6 +95,17 @@ int onion_addfriend(Onion_Client *onion_c, uint8_t *client_id);
94 */ 95 */
95int onion_delfriend(Onion_Client *onion_c, int friend_num); 96int onion_delfriend(Onion_Client *onion_c, int friend_num);
96 97
98/* Set if friend is online or not.
99 * NOTE: This function is there and should be used so that we don't send useless packets to the friend if he is online.
100 *
101 * is_online 1 means friend is online.
102 * is_online 0 means friend is offline
103 *
104 * return -1 on failure.
105 * return 0 on success.
106 */
107int onion_set_friend_online(Onion_Client *onion_c, int friend_num, uint8_t is_online);
108
97/* Get the ip of friend friendnum and put it in ip_port 109/* Get the ip of friend friendnum and put it in ip_port
98 * 110 *
99 * return -1, -- if client_id does NOT refer to a friend 111 * return -1, -- if client_id does NOT refer to a friend