summaryrefslogtreecommitdiff
path: root/core/Messenger.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/Messenger.h')
-rw-r--r--core/Messenger.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/Messenger.h b/core/Messenger.h
index 20ea33fb..9016be93 100644
--- a/core/Messenger.h
+++ b/core/Messenger.h
@@ -40,6 +40,7 @@ extern "C" {
40 40
41#define FRIEND_ADDRESS_SIZE (crypto_box_PUBLICKEYBYTES + sizeof(uint32_t) + sizeof(uint16_t)) 41#define FRIEND_ADDRESS_SIZE (crypto_box_PUBLICKEYBYTES + sizeof(uint32_t) + sizeof(uint16_t))
42 42
43#define PACKET_ID_PING 0
43#define PACKET_ID_NICKNAME 48 44#define PACKET_ID_NICKNAME 48
44#define PACKET_ID_STATUSMESSAGE 49 45#define PACKET_ID_STATUSMESSAGE 49
45#define PACKET_ID_USERSTATUS 50 46#define PACKET_ID_USERSTATUS 50
@@ -71,6 +72,12 @@ extern "C" {
71/* Default start timeout in seconds between friend requests */ 72/* Default start timeout in seconds between friend requests */
72#define FRIENDREQUEST_TIMEOUT 5; 73#define FRIENDREQUEST_TIMEOUT 5;
73 74
75/* interval between the sending of ping packets.*/
76#define FRIEND_PING_INTERVAL 5
77
78/* If no packets are recieved from friend in this time interval, kill the connection.*/
79#define FRIEND_CONNECTION_TIMEOUT (FRIEND_PING_INTERVAL * 2)
80
74/* USERSTATUS 81/* USERSTATUS
75 * Represents userstatuses someone can have. */ 82 * Represents userstatuses someone can have. */
76 83
@@ -100,6 +107,8 @@ typedef struct {
100 uint32_t message_id; /* a semi-unique id used in read receipts */ 107 uint32_t message_id; /* a semi-unique id used in read receipts */
101 uint8_t receives_read_receipts; /* shall we send read receipts to this person? */ 108 uint8_t receives_read_receipts; /* shall we send read receipts to this person? */
102 uint32_t friendrequest_nospam; /*The nospam number used in the friend request*/ 109 uint32_t friendrequest_nospam; /*The nospam number used in the friend request*/
110 uint64_t ping_lastrecv;
111 uint64_t ping_lastsent;
103} Friend; 112} Friend;
104 113
105typedef struct Messenger { 114typedef struct Messenger {