mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
partially fixed friend add bug (key length test still broken)
This commit is contained in:
parent
a448d39fd7
commit
0ae9ec1815
|
@ -126,8 +126,24 @@ void line_eval(char* line)
|
|||
temp_id[i] = line[i+3];
|
||||
int num = m_addfriend(hex_string_to_bin(temp_id), (uint8_t*)"Install Gentoo", sizeof("Install Gentoo"));
|
||||
char numstring[100];
|
||||
sprintf(numstring, "\n[i] added friend %d\n\n", num);
|
||||
switch (num) {
|
||||
case -1:
|
||||
sprintf(numstring, "[i] Incorrect key length");
|
||||
break;
|
||||
case -2:
|
||||
sprintf(numstring, "[i] That appears to be your own key");
|
||||
break;
|
||||
case -3:
|
||||
sprintf(numstring, "[i] Friend request already sent");
|
||||
break;
|
||||
case -4:
|
||||
sprintf(numstring, "[i] Could not add friend");
|
||||
break;
|
||||
default:
|
||||
sprintf(numstring, "[i] Added friend %d", num);
|
||||
printf(numstring);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
else if (inpt_command == 'r') {
|
||||
|
|
Loading…
Reference in New Issue
Block a user