summaryrefslogtreecommitdiff
path: root/core/Messenger.c
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2013-07-18 15:59:14 -0400
committerirungentoo <irungentoo@gmail.com>2013-07-18 15:59:14 -0400
commitc8d7044efb35a9d9b241adbe8346492965e0b054 (patch)
treecf7bb52d1e65345b0920ba62f5488003b9b96951 /core/Messenger.c
parent8a71941423bf9a5e8ceb44a6e4c46688ab15bf8a (diff)
Status packet is now id 49 (It's cleaner that way).
Diffstat (limited to 'core/Messenger.c')
-rw-r--r--core/Messenger.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/core/Messenger.c b/core/Messenger.c
index 8e22f448..2b9644a3 100644
--- a/core/Messenger.c
+++ b/core/Messenger.c
@@ -334,7 +334,7 @@ static int send_userstatus(int friendnumber, uint8_t * status, uint16_t length)
334{ 334{
335 uint8_t *thepacket = malloc(length + 1); 335 uint8_t *thepacket = malloc(length + 1);
336 memcpy(thepacket + 1, status, length); 336 memcpy(thepacket + 1, status, length);
337 thepacket[0] = 70; 337 thepacket[0] = 49;
338 int written = write_cryptpacket(friendlist[friendnumber].crypt_connection_id, thepacket, length + 1); 338 int written = write_cryptpacket(friendlist[friendnumber].crypt_connection_id, thepacket, length + 1);
339 free(thepacket); 339 free(thepacket);
340 return written; 340 return written;
@@ -463,11 +463,7 @@ static void doFriends()
463 friendlist[i].name[MAX_NAME_LENGTH - 1] = 0;//make sure the NULL terminator is present. 463 friendlist[i].name[MAX_NAME_LENGTH - 1] = 0;//make sure the NULL terminator is present.
464 break; 464 break;
465 } 465 }
466 case 64: { 466 case 49: {
467 (*friend_message)(i, temp + 1, len - 1);
468 break;
469 }
470 case 70: {
471 uint8_t *status = calloc(MIN(len - 1, MAX_USERSTATUS_LENGTH), 1); 467 uint8_t *status = calloc(MIN(len - 1, MAX_USERSTATUS_LENGTH), 1);
472 memcpy(status, temp + 1, MIN(len - 1, MAX_USERSTATUS_LENGTH)); 468 memcpy(status, temp + 1, MIN(len - 1, MAX_USERSTATUS_LENGTH));
473 friend_statuschange(i, status, MIN(len - 1, MAX_USERSTATUS_LENGTH)); 469 friend_statuschange(i, status, MIN(len - 1, MAX_USERSTATUS_LENGTH));
@@ -475,6 +471,10 @@ static void doFriends()
475 free(status); 471 free(status);
476 break; 472 break;
477 } 473 }
474 case 64: {
475 (*friend_message)(i, temp + 1, len - 1);
476 break;
477 }
478 } 478 }
479 } 479 }
480 else 480 else