summaryrefslogtreecommitdiff
path: root/testing/nTox.c
diff options
context:
space:
mode:
Diffstat (limited to 'testing/nTox.c')
-rw-r--r--testing/nTox.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/testing/nTox.c b/testing/nTox.c
index 92827554..1051155f 100644
--- a/testing/nTox.c
+++ b/testing/nTox.c
@@ -96,6 +96,10 @@ void send_filesenders(Tox *m)
96 if (file_senders[i].piecelength == 0) { 96 if (file_senders[i].piecelength == 0) {
97 fclose(file_senders[i].file); 97 fclose(file_senders[i].file);
98 file_senders[i].file = 0; 98 file_senders[i].file = 0;
99 file_control(m, file_senders[i].friendnum, 0, file_senders[i].filenumber, 3, 0, 0);
100 char msg[512];
101 sprintf(msg, "[t] %u file transfer: %u completed", file_senders[i].friendnum, file_senders[i].filenumber);
102 new_lines(msg);
99 break; 103 break;
100 } 104 }
101 } 105 }
@@ -661,14 +665,15 @@ void file_request_accept(Tox *m, int friendnumber, uint8_t filenumber, uint64_t
661 sprintf(msg, "[t] %u is sending us: %s of size %llu", friendnumber, filename, filesize); 665 sprintf(msg, "[t] %u is sending us: %s of size %llu", friendnumber, filename, filesize);
662 new_lines(msg); 666 new_lines(msg);
663 667
664 if (file_control(m, friendnumber, filenumber, 0, 0, 0)) { 668 if (file_control(m, friendnumber, 1, filenumber, 0, 0, 0)) {
665 sprintf(msg, "Accepted file transfer. (saving file as: %u.%u.bin)", friendnumber, filenumber); 669 sprintf(msg, "Accepted file transfer. (saving file as: %u.%u.bin)", friendnumber, filenumber);
666 new_lines(msg); 670 new_lines(msg);
667 } else 671 } else
668 new_lines("Could not accept file transfer."); 672 new_lines("Could not accept file transfer.");
669} 673}
670 674
671void file_print_control(Tox *m, int friendnumber, uint8_t filenumber, uint8_t control_type, uint8_t *data, 675void file_print_control(Tox *m, int friendnumber, uint8_t send_recieve, uint8_t filenumber, uint8_t control_type,
676 uint8_t *data,
672 uint16_t length, void *userdata) 677 uint16_t length, void *userdata)
673{ 678{
674 char msg[512] = {0}; 679 char msg[512] = {0};
@@ -690,7 +695,7 @@ void write_file(Tox *m, int friendnumber, uint8_t filenumber, uint8_t *data, uin
690 FILE *pFile = fopen(filename, "a"); 695 FILE *pFile = fopen(filename, "a");
691 696
692 if (file_dataremaining(m, friendnumber, filenumber, 1) == 0) { 697 if (file_dataremaining(m, friendnumber, filenumber, 1) == 0) {
693 file_control(m, friendnumber, filenumber, 3, 0, 0); 698 //file_control(m, friendnumber, 1, filenumber, 3, 0, 0);
694 char msg[512]; 699 char msg[512];
695 sprintf(msg, "[t] %u file transfer: %u completed", friendnumber, filenumber); 700 sprintf(msg, "[t] %u file transfer: %u completed", friendnumber, filenumber);
696 new_lines(msg); 701 new_lines(msg);