diff options
author | Astonex <softukitu@gmail.com> | 2013-07-30 09:56:39 +0100 |
---|---|---|
committer | Astonex <softukitu@gmail.com> | 2013-07-30 09:56:39 +0100 |
commit | 6ea5420a070ea58e910992cfaf890839a5dbc561 (patch) | |
tree | 4f1ee32e9c007295d333ed7829fd98047fdf4378 /testing/nTox_win32.c | |
parent | d5e5412cb3b416efe40ba9ba053a0b0fd2894c1c (diff) |
Implemented m_delfriend()
Diffstat (limited to 'testing/nTox_win32.c')
-rw-r--r-- | testing/nTox_win32.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/testing/nTox_win32.c b/testing/nTox_win32.c index 71a291c6..3a9caaf5 100644 --- a/testing/nTox_win32.c +++ b/testing/nTox_win32.c | |||
@@ -37,7 +37,7 @@ void do_header() | |||
37 | system("cls"); | 37 | system("cls"); |
38 | printf(users_id); | 38 | printf(users_id); |
39 | printf("\n---------------------------------"); | 39 | printf("\n---------------------------------"); |
40 | 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)"); | 40 | 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)"); |
41 | printf("\n---------------------------------"); | 41 | printf("\n---------------------------------"); |
42 | } | 42 | } |
43 | 43 | ||
@@ -149,7 +149,16 @@ void line_eval(char* line) | |||
149 | } | 149 | } |
150 | 150 | ||
151 | else if (line[1] == 'd') { | 151 | else if (line[1] == 'd') { |
152 | doMessenger(); | 152 | size_t len = strlen(line); |
153 | char numstring[len-3]; | ||
154 | int i; | ||
155 | for (i=0; i<len; i++) { | ||
156 | if (line[i+3] != ' ') { | ||
157 | numstring[i] = line[i+3]; | ||
158 | } | ||
159 | } | ||
160 | int num = atoi(numstring); | ||
161 | m_delfriend(num); | ||
153 | } | 162 | } |
154 | /* Send message to friend */ | 163 | /* Send message to friend */ |
155 | else if (line[1] == 'm') { | 164 | else if (line[1] == 'm') { |