summaryrefslogtreecommitdiff
path: root/testing/nTox.c
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2015-03-13 15:29:34 -0400
committerirungentoo <irungentoo@gmail.com>2015-03-13 15:29:34 -0400
commit8e2957ec50fda43b8e7a705081e63c19d70107e1 (patch)
tree4256c0696b89f6d6fc9ce7a175acc77cea2c8b1a /testing/nTox.c
parent96d9cef66c551feae380596d77e6f120525ad0ca (diff)
parent64fefb6f43e9213db9f3313aa7e8af7c36bf8538 (diff)
Merge branch 'newer_api' of https://github.com/dubslow/toxcore into new_api
Diffstat (limited to 'testing/nTox.c')
-rw-r--r--testing/nTox.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/testing/nTox.c b/testing/nTox.c
index de9c9db2..e566c79f 100644
--- a/testing/nTox.c
+++ b/testing/nTox.c
@@ -389,13 +389,13 @@ void line_eval(Tox *m, char *line)
389 389
390 new_lines(numstring); 390 new_lines(numstring);
391 } else if (inpt_command == 'd') { 391 } else if (inpt_command == 'd') {
392 tox_iteration(m); 392 tox_iterate(m);
393 } else if (inpt_command == 'm') { //message command: /m friendnumber messsage 393 } else if (inpt_command == 'm') { //message command: /m friendnumber messsage
394 char *posi[1]; 394 char *posi[1];
395 int num = strtoul(line + prompt_offset, posi, 0); 395 int num = strtoul(line + prompt_offset, posi, 0);
396 396
397 if (**posi != 0) { 397 if (**posi != 0) {
398 if (tox_send_message(m, num, (uint8_t *) *posi + 1, strlen(*posi + 1), NULL) < 1) { 398 if (tox_friend_send_message(m, num, (uint8_t *) *posi + 1, strlen(*posi + 1), NULL) < 1) {
399 char sss[256]; 399 char sss[256];
400 sprintf(sss, "[i] could not send message to friend num %u", num); 400 sprintf(sss, "[i] could not send message to friend num %u", num);
401 new_lines(sss); 401 new_lines(sss);
@@ -607,7 +607,7 @@ void line_eval(Tox *m, char *line)
607 if (conversation_default != 0) { 607 if (conversation_default != 0) {
608 if (conversation_default > 0) { 608 if (conversation_default > 0) {
609 int friendnumber = conversation_default - 1; 609 int friendnumber = conversation_default - 1;
610 uint32_t res = tox_send_message(m, friendnumber, (uint8_t *)line, strlen(line), NULL); 610 uint32_t res = tox_friend_send_message(m, friendnumber, (uint8_t *)line, strlen(line), NULL);
611 611
612 if (res == 0) { 612 if (res == 0) {
613 char sss[128]; 613 char sss[128];
@@ -1132,7 +1132,7 @@ void file_request_accept(Tox *tox, uint32_t friend_number, uint32_t file_number,
1132{ 1132{
1133 if (type != TOX_FILE_KIND_DATA) { 1133 if (type != TOX_FILE_KIND_DATA) {
1134 new_lines("Refused invalid file type."); 1134 new_lines("Refused invalid file type.");
1135 tox_file_control(tox, friend_number, file_number, TOX_FILE_CONTROL_CANCEL, 0); 1135 tox_file_send_control(tox, friend_number, file_number, TOX_FILE_CONTROL_CANCEL, 0);
1136 return; 1136 return;
1137 } 1137 }
1138 1138
@@ -1140,7 +1140,7 @@ void file_request_accept(Tox *tox, uint32_t friend_number, uint32_t file_number,
1140 sprintf(msg, "[t] %u is sending us: %s of size %llu", friend_number, filename, (long long unsigned int)file_size); 1140 sprintf(msg, "[t] %u is sending us: %s of size %llu", friend_number, filename, (long long unsigned int)file_size);
1141 new_lines(msg); 1141 new_lines(msg);
1142 1142
1143 if (tox_file_control(tox, friend_number, file_number, TOX_FILE_CONTROL_RESUME, 0)) { 1143 if (tox_file_send_control(tox, friend_number, file_number, TOX_FILE_CONTROL_RESUME, 0)) {
1144 sprintf(msg, "Accepted file transfer. (saving file as: %u.%u.bin)", friend_number, file_number); 1144 sprintf(msg, "Accepted file transfer. (saving file as: %u.%u.bin)", friend_number, file_number);
1145 new_lines(msg); 1145 new_lines(msg);
1146 } else 1146 } else
@@ -1270,7 +1270,7 @@ int main(int argc, char *argv[])
1270 tox_callback_group_invite(m, print_invite, NULL); 1270 tox_callback_group_invite(m, print_invite, NULL);
1271 tox_callback_group_message(m, print_groupmessage, NULL); 1271 tox_callback_group_message(m, print_groupmessage, NULL);
1272 tox_callback_file_receive_chunk(m, write_file, NULL); 1272 tox_callback_file_receive_chunk(m, write_file, NULL);
1273 tox_callback_file_control(m, file_print_control, NULL); 1273 tox_callback_file_recv_control(m, file_print_control, NULL);
1274 tox_callback_file_receive(m, file_request_accept, NULL); 1274 tox_callback_file_receive(m, file_request_accept, NULL);
1275 tox_callback_file_request_chunk(m, tox_file_request_chunk, NULL); 1275 tox_callback_file_request_chunk(m, tox_file_request_chunk, NULL);
1276 tox_callback_group_namelist_change(m, print_groupnamelistchange, NULL); 1276 tox_callback_group_namelist_change(m, print_groupnamelistchange, NULL);
@@ -1326,7 +1326,7 @@ int main(int argc, char *argv[])
1326 } 1326 }
1327 } 1327 }
1328 1328
1329 tox_iteration(m); 1329 tox_iterate(m);
1330 do_refresh(); 1330 do_refresh();
1331 1331
1332 int c = timeout_getch(m); 1332 int c = timeout_getch(m);