summaryrefslogtreecommitdiff
path: root/protocols/Tox/libtox/src/toxcore/tox.c
diff options
context:
space:
mode:
authoraunsane <aunsane@gmail.com>2018-07-21 13:14:47 +0300
committeraunsane <aunsane@gmail.com>2018-07-21 13:14:47 +0300
commit5db1ff0c224b88e0d545f6e6e2858ceb638893ac (patch)
tree37d08393980b6a5347d1f8d8f647cb23418bdd1b /protocols/Tox/libtox/src/toxcore/tox.c
parent868597861af9aeef8b8e9e7573f12a9c2193a7f0 (diff)
Tox: libtox update to v0.2.4
Diffstat (limited to 'protocols/Tox/libtox/src/toxcore/tox.c')
-rw-r--r--protocols/Tox/libtox/src/toxcore/tox.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/protocols/Tox/libtox/src/toxcore/tox.c b/protocols/Tox/libtox/src/toxcore/tox.c
index cae2dcb36b..80ff42c343 100644
--- a/protocols/Tox/libtox/src/toxcore/tox.c
+++ b/protocols/Tox/libtox/src/toxcore/tox.c
@@ -1522,7 +1522,9 @@ bool tox_friend_send_lossy_packet(Tox *tox, uint32_t friend_number, const uint8_
return 0;
}
- if (data[0] < (PACKET_ID_LOSSY_RANGE_START + PACKET_LOSSY_AV_RESERVED)) {
+ // TODO(oxij): this feels ugly, this is needed only because m_send_custom_lossy_packet in Messenger.c
+ // sends both AV and custom packets despite its name and this API hides those AV packets
+ if (data[0] <= PACKET_ID_RANGE_LOSSY_AV_END) {
SET_ERROR_PARAMETER(error, TOX_ERR_FRIEND_CUSTOM_PACKET_INVALID);
return 0;
}