mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Pass packet ID to custom packet handlers.
We don't expose this to the user code, yet, because it would break the API, but this is useful for future internal code.
This commit is contained in:
parent
7b3d2eda3f
commit
bd7b7fadba
|
@ -1824,7 +1824,7 @@ static int m_handle_lossy_packet(void *object, int friend_num, const uint8_t *pa
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m->lossy_packethandler) {
|
if (m->lossy_packethandler) {
|
||||||
m->lossy_packethandler(m, friend_num, packet, length, userdata);
|
m->lossy_packethandler(m, friend_num, packet[0], packet, length, userdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -1900,7 +1900,7 @@ static int handle_custom_lossless_packet(void *object, int friend_num, const uin
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m->lossless_packethandler) {
|
if (m->lossless_packethandler) {
|
||||||
m->lossless_packethandler(m, friend_num, packet, length, userdata);
|
m->lossless_packethandler(m, friend_num, packet[0], packet, length, userdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
@ -200,10 +200,10 @@ typedef void m_file_chunk_request_cb(Messenger *m, uint32_t friend_number, uint3
|
||||||
size_t length, void *user_data);
|
size_t length, void *user_data);
|
||||||
typedef void m_file_recv_chunk_cb(Messenger *m, uint32_t friend_number, uint32_t file_number, uint64_t position,
|
typedef void m_file_recv_chunk_cb(Messenger *m, uint32_t friend_number, uint32_t file_number, uint64_t position,
|
||||||
const uint8_t *data, size_t length, void *user_data);
|
const uint8_t *data, size_t length, void *user_data);
|
||||||
typedef void m_friend_lossy_packet_cb(Messenger *m, uint32_t friend_number, const uint8_t *data, size_t length,
|
typedef void m_friend_lossy_packet_cb(Messenger *m, uint32_t friend_number, uint8_t packet_id, const uint8_t *data,
|
||||||
void *user_data);
|
size_t length, void *user_data);
|
||||||
typedef void m_friend_lossless_packet_cb(Messenger *m, uint32_t friend_number, const uint8_t *data, size_t length,
|
typedef void m_friend_lossless_packet_cb(Messenger *m, uint32_t friend_number, uint8_t packet_id, const uint8_t *data,
|
||||||
void *user_data);
|
size_t length, void *user_data);
|
||||||
typedef void m_friend_connectionstatuschange_internal_cb(Messenger *m, uint32_t friend_number,
|
typedef void m_friend_connectionstatuschange_internal_cb(Messenger *m, uint32_t friend_number,
|
||||||
uint8_t connection_status, void *user_data);
|
uint8_t connection_status, void *user_data);
|
||||||
typedef void m_conference_invite_cb(Messenger *m, uint32_t friend_number, const uint8_t *cookie, uint16_t length,
|
typedef void m_conference_invite_cb(Messenger *m, uint32_t friend_number, const uint8_t *cookie, uint16_t length,
|
||||||
|
|
|
@ -302,8 +302,8 @@ static void tox_conference_peer_list_changed_handler(Messenger *m, uint32_t conf
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void tox_friend_lossy_packet_handler(Messenger *m, uint32_t friend_number, const uint8_t *data, size_t length,
|
static void tox_friend_lossy_packet_handler(Messenger *m, uint32_t friend_number, uint8_t packet_id,
|
||||||
void *user_data)
|
const uint8_t *data, size_t length, void *user_data)
|
||||||
{
|
{
|
||||||
struct Tox_Userdata *tox_data = (struct Tox_Userdata *)user_data;
|
struct Tox_Userdata *tox_data = (struct Tox_Userdata *)user_data;
|
||||||
|
|
||||||
|
@ -312,8 +312,8 @@ static void tox_friend_lossy_packet_handler(Messenger *m, uint32_t friend_number
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void tox_friend_lossless_packet_handler(Messenger *m, uint32_t friend_number, const uint8_t *data, size_t length,
|
static void tox_friend_lossless_packet_handler(Messenger *m, uint32_t friend_number, uint8_t packet_id,
|
||||||
void *user_data)
|
const uint8_t *data, size_t length, void *user_data)
|
||||||
{
|
{
|
||||||
struct Tox_Userdata *tox_data = (struct Tox_Userdata *)user_data;
|
struct Tox_Userdata *tox_data = (struct Tox_Userdata *)user_data;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user