Status packet is now id 49 (It's cleaner that way).

This commit is contained in:
irungentoo 2013-07-18 15:59:14 -04:00
parent 8a71941423
commit c8d7044efb
2 changed files with 8 additions and 7 deletions

View File

@ -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

View File

@ -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