summaryrefslogtreecommitdiff
path: root/toxcore/Messenger.c
diff options
context:
space:
mode:
Diffstat (limited to 'toxcore/Messenger.c')
-rw-r--r--toxcore/Messenger.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c
index aefa3a68..3fa3315d 100644
--- a/toxcore/Messenger.c
+++ b/toxcore/Messenger.c
@@ -1699,7 +1699,7 @@ int m_msi_packet(Messenger *m, int32_t friendnumber, uint8_t *data, uint16_t len
1699 return write_cryptpacket_id(m, friendnumber, PACKET_ID_MSI, data, length); 1699 return write_cryptpacket_id(m, friendnumber, PACKET_ID_MSI, data, length);
1700} 1700}
1701 1701
1702static int handle_custom_user_packet(void *object, int friend_num, uint8_t *packet, uint16_t length) 1702static int handle_custom_lossy_packet(void *object, int friend_num, uint8_t *packet, uint16_t length)
1703{ 1703{
1704 Messenger *m = object; 1704 Messenger *m = object;
1705 1705
@@ -1714,8 +1714,8 @@ static int handle_custom_user_packet(void *object, int friend_num, uint8_t *pack
1714} 1714}
1715 1715
1716 1716
1717int custom_user_packet_registerhandler(Messenger *m, int32_t friendnumber, uint8_t byte, 1717int custom_lossy_packet_registerhandler(Messenger *m, int32_t friendnumber, uint8_t byte,
1718 int (*packet_handler_callback)(void *object, uint8_t *data, uint32_t len), void *object) 1718 int (*packet_handler_callback)(void *object, uint8_t *data, uint32_t len), void *object)
1719{ 1719{
1720 if (friend_not_valid(m, friendnumber)) 1720 if (friend_not_valid(m, friendnumber))
1721 return -1; 1721 return -1;
@@ -1731,7 +1731,7 @@ int custom_user_packet_registerhandler(Messenger *m, int32_t friendnumber, uint8
1731 return 0; 1731 return 0;
1732} 1732}
1733 1733
1734int send_custom_user_packet(Messenger *m, int32_t friendnumber, uint8_t *data, uint32_t length) 1734int send_custom_lossy_packet(Messenger *m, int32_t friendnumber, uint8_t *data, uint32_t length)
1735{ 1735{
1736 if (friend_not_valid(m, friendnumber)) 1736 if (friend_not_valid(m, friendnumber))
1737 return -1; 1737 return -1;
@@ -1781,7 +1781,7 @@ static int handle_new_connections(void *object, New_Connection *n_c)
1781 int id = accept_crypto_connection(m->net_crypto, n_c); 1781 int id = accept_crypto_connection(m->net_crypto, n_c);
1782 connection_status_handler(m->net_crypto, id, &handle_status, m, friend_id); 1782 connection_status_handler(m->net_crypto, id, &handle_status, m, friend_id);
1783 connection_data_handler(m->net_crypto, id, &handle_packet, m, friend_id); 1783 connection_data_handler(m->net_crypto, id, &handle_packet, m, friend_id);
1784 connection_lossy_data_handler(m->net_crypto, id, &handle_custom_user_packet, m, friend_id); 1784 connection_lossy_data_handler(m->net_crypto, id, &handle_custom_lossy_packet, m, friend_id);
1785 m->friendlist[friend_id].crypt_connection_id = id; 1785 m->friendlist[friend_id].crypt_connection_id = id;
1786 set_friend_status(m, friend_id, FRIEND_CONFIRMED); 1786 set_friend_status(m, friend_id, FRIEND_CONFIRMED);
1787 return 0; 1787 return 0;
@@ -2206,7 +2206,7 @@ static int friend_new_connection(Messenger *m, int32_t friendnumber, uint8_t *re
2206 m->friendlist[friendnumber].crypt_connection_id = id; 2206 m->friendlist[friendnumber].crypt_connection_id = id;
2207 connection_status_handler(m->net_crypto, id, &handle_status, m, friendnumber); 2207 connection_status_handler(m->net_crypto, id, &handle_status, m, friendnumber);
2208 connection_data_handler(m->net_crypto, id, &handle_packet, m, friendnumber); 2208 connection_data_handler(m->net_crypto, id, &handle_packet, m, friendnumber);
2209 connection_lossy_data_handler(m->net_crypto, id, &handle_custom_user_packet, m, friendnumber); 2209 connection_lossy_data_handler(m->net_crypto, id, &handle_custom_lossy_packet, m, friendnumber);
2210 return 0; 2210 return 0;
2211} 2211}
2212 2212