From b2c5e16132686f05c6726cd41e117656f3f1e636 Mon Sep 17 00:00:00 2001 From: irungentoo Date: Sat, 5 Oct 2013 10:55:28 -0400 Subject: [PATCH] Fixed file sending bug. --- toxcore/Messenger.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c index 32243053..65e55bfb 100644 --- a/toxcore/Messenger.c +++ b/toxcore/Messenger.c @@ -1044,8 +1044,13 @@ int file_control(Messenger *m, int friendnumber, uint8_t send_receive, uint8_t f if (friend_not_valid(m, friendnumber)) return 0; - if (m->friendlist[friendnumber].file_receiving[filenumber].status == FILESTATUS_NONE) - return 0; + if (send_receive == 1) { + if (m->friendlist[friendnumber].file_receiving[filenumber].status == FILESTATUS_NONE) + return 0; + } else { + if (m->friendlist[friendnumber].file_sending[filenumber].status == FILESTATUS_NONE) + return 0; + } if (send_receive > 1) return 0;