diff options
author | Astonex <softukitu@gmail.com> | 2013-08-03 14:14:33 +0100 |
---|---|---|
committer | Astonex <softukitu@gmail.com> | 2013-08-03 14:14:33 +0100 |
commit | fcad4d0a5a3b5ed87032e21938b709bb98c2b0a4 (patch) | |
tree | 5c6c765b0472be10a2517fe918c8fcd21c755cc8 /testing | |
parent | 892249eabb66a435953d0289a7111e8e0dcab281 (diff) |
nTox_win32 - Updated friends list display
Diffstat (limited to 'testing')
-rw-r--r-- | testing/nTox_win32.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/testing/nTox_win32.c b/testing/nTox_win32.c index 9c6e0aac..55440828 100644 --- a/testing/nTox_win32.c +++ b/testing/nTox_win32.c | |||
@@ -153,23 +153,32 @@ void add_friend() | |||
153 | 153 | ||
154 | void list_friends() | 154 | void list_friends() |
155 | { | 155 | { |
156 | int activefriends = 0; | ||
157 | int i; | 156 | int i; |
157 | |||
158 | printf("\n[i] Friend List"); | ||
159 | |||
160 | printf("----- PENDING -----\n\n"); | ||
158 | 161 | ||
159 | for (i = 0; i <= maxnumfriends; i++) { | 162 | for (i = 0; i <= maxnumfriends; i++) { |
160 | if (m_friendstatus(i) == 4) | 163 | char name[MAX_NAME_LENGTH]; |
161 | activefriends++; | 164 | getname(i, (uint8_t*)name); |
165 | if (m_friendstatus(i) > 0 && m_friendstatus(i) < 4) | ||
166 | printf("[%d] %s\n", i, (uint8_t*)name); | ||
162 | } | 167 | } |
168 | |||
169 | printf("\n"); | ||
163 | 170 | ||
164 | printf("\n[i] Friend List | Total: %d\n\n", activefriends); | 171 | printf("----- ACTIVE -----\n\n"); |
165 | 172 | ||
166 | for (i = 0; i <= 256; i++) {/* TODO: fix this properly*/ | 173 | for (i = 0; i <= maxnumfriends; i++) { |
167 | char name[MAX_NAME_LENGTH]; | 174 | char name[MAX_NAME_LENGTH]; |
168 | getname(i, (uint8_t*)name); | 175 | getname(i, (uint8_t*)name); |
169 | 176 | ||
170 | if (m_friendstatus(i) == 4) | 177 | if (m_friendstatus(i) == 4) |
171 | printf("[%d] %s\n\n", i, (uint8_t*)name); | 178 | printf("[%d] %s\n", i, (uint8_t*)name); |
172 | } | 179 | } |
180 | |||
181 | printf("\n"); | ||
173 | } | 182 | } |
174 | 183 | ||
175 | void delete_friend() | 184 | void delete_friend() |
@@ -323,9 +332,8 @@ void line_eval(char* line) | |||
323 | } | 332 | } |
324 | /* EXIT */ | 333 | /* EXIT */ |
325 | else if (inpt_command == 'q') { | 334 | else if (inpt_command == 'q') { |
326 | uint8_t status[MAX_USERSTATUS_LENGTH] = "Offline"; | 335 | strcpy(line, "Offline"); |
327 | m_set_userstatus(status, strlen((char*)status)); | 336 | change_status(line); |
328 | Sleep(10); | ||
329 | exit(EXIT_SUCCESS); | 337 | exit(EXIT_SUCCESS); |
330 | } | 338 | } |
331 | } | 339 | } |