diff options
author | Michael Rose <michael_rose@gmx.de> | 2013-08-19 14:40:15 +0200 |
---|---|---|
committer | Michael Rose <michael_rose@gmx.de> | 2013-08-19 14:40:15 +0200 |
commit | 0aabb5bc49eb86c4168bbf4f369f72fa97d50c53 (patch) | |
tree | 7f68fd93e728f7de5f350ad1bc9e4f6a467cd08a /core/Messenger.h | |
parent | d6ae8dce983925a3f1462d111b5243fff3be31ec (diff) | |
parent | 4b480381ee7e1b5bbf3c253c0c4bf045e43f0a0e (diff) |
Merge with upstream
Diffstat (limited to 'core/Messenger.h')
-rw-r--r-- | core/Messenger.h | 9 |
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 | ||
105 | typedef struct Messenger { | 114 | typedef struct Messenger { |