mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Merge pull request #210 from nickodell/master
Show error message instead of "added friendnumber -1"
This commit is contained in:
commit
14bf0699e7
@ -172,13 +172,17 @@ void line_eval(char lines[HISTORY][STRING_LENGTH], char *line)
|
|||||||
else if (inpt_command == 'a') {
|
else if (inpt_command == 'a') {
|
||||||
uint8_t numf = atoi(line + 3);
|
uint8_t numf = atoi(line + 3);
|
||||||
char numchar[100];
|
char numchar[100];
|
||||||
sprintf(numchar, "[i] friend request %u accepted", numf);
|
|
||||||
new_lines(numchar);
|
|
||||||
int num = m_addfriend_norequest(pending_requests[numf]);
|
int num = m_addfriend_norequest(pending_requests[numf]);
|
||||||
sprintf(numchar, "[i] added friendnumber %d", num);
|
if (num != -1) {
|
||||||
new_lines(numchar);
|
sprintf(numchar, "[i] friend request %u accepted", numf);
|
||||||
|
new_lines(numchar);
|
||||||
|
sprintf(numchar, "[i] added friendnumber %d", num);
|
||||||
|
new_lines(numchar);
|
||||||
|
} else {
|
||||||
|
sprintf(numchar, "[i] failed to add friend");
|
||||||
|
new_lines(numchar);
|
||||||
|
}
|
||||||
do_refresh();
|
do_refresh();
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (inpt_command == 'h') { //help
|
else if (inpt_command == 'h') { //help
|
||||||
new_lines("[i] commands: /f ID (to add friend), /m friendnumber message (to send message), /s status (to change status)");
|
new_lines("[i] commands: /f ID (to add friend), /m friendnumber message (to send message), /s status (to change status)");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user