summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/Messenger.c12
-rw-r--r--docs/Messenger_Protocol.txt3
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.
2648 Username (Send this packet as soon as you connect to a friend or to each friend everytime you change names. 2648 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
2949 Status change
29 30
3064 Chat message 3164 Chat message
316? File transmission. 326? File transmission.
3270 Status change 33