mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Status packet is now id 49 (It's cleaner that way).
This commit is contained in:
parent
8a71941423
commit
c8d7044efb
|
@ -334,7 +334,7 @@ static int send_userstatus(int friendnumber, uint8_t * status, uint16_t length)
|
|||
{
|
||||
uint8_t *thepacket = malloc(length + 1);
|
||||
memcpy(thepacket + 1, status, length);
|
||||
thepacket[0] = 70;
|
||||
thepacket[0] = 49;
|
||||
int written = write_cryptpacket(friendlist[friendnumber].crypt_connection_id, thepacket, length + 1);
|
||||
free(thepacket);
|
||||
return written;
|
||||
|
@ -463,11 +463,7 @@ static void doFriends()
|
|||
friendlist[i].name[MAX_NAME_LENGTH - 1] = 0;//make sure the NULL terminator is present.
|
||||
break;
|
||||
}
|
||||
case 64: {
|
||||
(*friend_message)(i, temp + 1, len - 1);
|
||||
break;
|
||||
}
|
||||
case 70: {
|
||||
case 49: {
|
||||
uint8_t *status = calloc(MIN(len - 1, MAX_USERSTATUS_LENGTH), 1);
|
||||
memcpy(status, temp + 1, MIN(len - 1, MAX_USERSTATUS_LENGTH));
|
||||
friend_statuschange(i, status, MIN(len - 1, MAX_USERSTATUS_LENGTH));
|
||||
|
@ -475,6 +471,10 @@ static void doFriends()
|
|||
free(status);
|
||||
break;
|
||||
}
|
||||
case 64: {
|
||||
(*friend_message)(i, temp + 1, len - 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -26,7 +26,8 @@ ids 0 to 16 are reserved.
|
|||
48 Username (Send this packet as soon as you connect to a friend or to each friend everytime you change names.
|
||||
Username is maximum 128 bytes long with the null terminator included)
|
||||
|
||||
49 Status change
|
||||
|
||||
64 Chat message
|
||||
6? File transmission.
|
||||
70 Status change
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user