diff options
author | irungentoo <irungentoo@gmail.com> | 2013-07-18 15:59:14 -0400 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2013-07-18 15:59:14 -0400 |
commit | c8d7044efb35a9d9b241adbe8346492965e0b054 (patch) | |
tree | cf7bb52d1e65345b0920ba62f5488003b9b96951 | |
parent | 8a71941423bf9a5e8ceb44a6e4c46688ab15bf8a (diff) |
Status packet is now id 49 (It's cleaner that way).
-rw-r--r-- | core/Messenger.c | 12 | ||||
-rw-r--r-- | docs/Messenger_Protocol.txt | 3 |
2 files changed, 8 insertions, 7 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 |
diff --git a/docs/Messenger_Protocol.txt b/docs/Messenger_Protocol.txt index 78f756ae..dc92c303 100644 --- a/docs/Messenger_Protocol.txt +++ b/docs/Messenger_Protocol.txt | |||
@@ -26,7 +26,8 @@ ids 0 to 16 are reserved. | |||
26 | 48 Username (Send this packet as soon as you connect to a friend or to each friend everytime you change names. | 26 | 48 Username (Send this packet as soon as you connect to a friend or to each friend everytime you change names. |
27 | Username is maximum 128 bytes long with the null terminator included) | 27 | Username is maximum 128 bytes long with the null terminator included) |
28 | 28 | ||
29 | 49 Status change | ||
29 | 30 | ||
30 | 64 Chat message | 31 | 64 Chat message |
31 | 6? File transmission. | 32 | 6? File transmission. |
32 | 70 Status change | 33 | |