summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2013-07-31 09:50:50 -0700
committerirungentoo <irungentoo@gmail.com>2013-07-31 09:50:50 -0700
commit14bf0699e77de713816103328ab05c6971858cff (patch)
treeea4cdcdfdf39d1b3f21e2f33a95c3b556b322c16
parentd0888f750c59433eb46828f24274da3cd9bd4b76 (diff)
parentccbe4c67996b4732a167449dfe288c65281b5d2d (diff)
Merge pull request #210 from nickodell/master
Show error message instead of "added friendnumber -1"
-rw-r--r--testing/nTox.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/testing/nTox.c b/testing/nTox.c
index 29726a3a..ff8f8caf 100644
--- a/testing/nTox.c
+++ b/testing/nTox.c
@@ -172,13 +172,17 @@ void line_eval(char lines[HISTORY][STRING_LENGTH], char *line)
172 else if (inpt_command == 'a') { 172 else if (inpt_command == 'a') {
173 uint8_t numf = atoi(line + 3); 173 uint8_t numf = atoi(line + 3);
174 char numchar[100]; 174 char numchar[100];
175 sprintf(numchar, "[i] friend request %u accepted", numf);
176 new_lines(numchar);
177 int num = m_addfriend_norequest(pending_requests[numf]); 175 int num = m_addfriend_norequest(pending_requests[numf]);
178 sprintf(numchar, "[i] added friendnumber %d", num); 176 if (num != -1) {
179 new_lines(numchar); 177 sprintf(numchar, "[i] friend request %u accepted", numf);
178 new_lines(numchar);
179 sprintf(numchar, "[i] added friendnumber %d", num);
180 new_lines(numchar);
181 } else {
182 sprintf(numchar, "[i] failed to add friend");
183 new_lines(numchar);
184 }
180 do_refresh(); 185 do_refresh();
181
182 } 186 }
183 else if (inpt_command == 'h') { //help 187 else if (inpt_command == 'h') { //help
184 new_lines("[i] commands: /f ID (to add friend), /m friendnumber message (to send message), /s status (to change status)"); 188 new_lines("[i] commands: /f ID (to add friend), /m friendnumber message (to send message), /s status (to change status)");