Small cleanup.

This commit is contained in:
irungentoo 2014-04-20 20:17:24 -04:00
parent 09d9d34a93
commit 1603ca974e
No known key found for this signature in database
GPG Key ID: 10349DC9BED89E98
2 changed files with 4 additions and 7 deletions

View File

@ -689,7 +689,7 @@ static int send_user_istyping(Messenger *m, int32_t friendnumber, uint8_t is_typ
static int send_ping(Messenger *m, int32_t friendnumber)
{
int ret = write_cryptpacket_id(m, friendnumber, PACKET_ID_PING, 0, 0);
int ret = write_cryptpacket_id(m, friendnumber, PACKET_ID_ALIVE, 0, 0);
if (ret == 1)
m->friendlist[friendnumber].ping_lastsent = unix_time();
@ -1928,7 +1928,7 @@ void do_friends(Messenger *m)
uint32_t data_length = len - 1;
switch (packet_id) {
case PACKET_ID_PING: {
case PACKET_ID_ALIVE: {
m->friendlist[i].ping_lastrecv = temp_time;
break;
}

View File

@ -38,7 +38,8 @@
#define FRIEND_ADDRESS_SIZE (crypto_box_PUBLICKEYBYTES + sizeof(uint32_t) + sizeof(uint16_t))
#define PACKET_ID_PING 0
/* NOTE: Packet ids below 16 must never be used. */
#define PACKET_ID_ALIVE 16
#define PACKET_ID_NICKNAME 48
#define PACKET_ID_STATUSMESSAGE 49
#define PACKET_ID_USERSTATUS 50
@ -80,10 +81,6 @@ enum {
FAERR_NOMEM = -8
};
/* Don't assume MAX_STATUSMESSAGE_LENGTH will stay at 128, it may be increased
* to an absurdly large number later.
*/
/* Default start timeout in seconds between friend requests. */
#define FRIENDREQUEST_TIMEOUT 5;