mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Small cleanup.
This commit is contained in:
parent
09d9d34a93
commit
1603ca974e
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user