Implemented m_delfriend()

This commit is contained in:
Astonex 2013-07-30 09:56:39 +01:00
parent d5e5412cb3
commit 6ea5420a07

View File

@ -37,7 +37,7 @@ void do_header()
system("cls"); system("cls");
printf(users_id); printf(users_id);
printf("\n---------------------------------"); printf("\n---------------------------------");
printf("\n[i] commands: /f ID (to add friend), /m friendnumber message (to send message), /s status (to change status), /n nick (to change nickname), /l (lists friends), /q (to quit), /r (reset screen)"); printf("\n[i] commands: /f ID (to add friend), /m friendnumber message (to send message), /s status (to change status), /n nick (to change nickname), /l (lists friends), /d friendnumber (deletes friend), /q (to quit), /r (reset screen)");
printf("\n---------------------------------"); printf("\n---------------------------------");
} }
@ -149,7 +149,16 @@ void line_eval(char* line)
} }
else if (line[1] == 'd') { else if (line[1] == 'd') {
doMessenger(); size_t len = strlen(line);
char numstring[len-3];
int i;
for (i=0; i<len; i++) {
if (line[i+3] != ' ') {
numstring[i] = line[i+3];
}
}
int num = atoi(numstring);
m_delfriend(num);
} }
/* Send message to friend */ /* Send message to friend */
else if (line[1] == 'm') { else if (line[1] == 'm') {