diff options
Diffstat (limited to 'testing/toxic/prompt.c')
-rw-r--r-- | testing/toxic/prompt.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/testing/toxic/prompt.c b/testing/toxic/prompt.c index d79d061f..486273d3 100644 --- a/testing/toxic/prompt.c +++ b/testing/toxic/prompt.c | |||
@@ -62,6 +62,16 @@ static void execute(ToxWindow *self, char *u_cmd) | |||
62 | if (!isspace(cmd[cmd_end])) | 62 | if (!isspace(cmd[cmd_end])) |
63 | break; | 63 | break; |
64 | cmd[cmd_end + 1] = '\0'; | 64 | cmd[cmd_end + 1] = '\0'; |
65 | |||
66 | /* What is this supposed to do? | ||
67 | if (cmd[0] == '/') { | ||
68 | wprintw(self->window,"Warning: Run your command without the /, this may not work\n"); | ||
69 | int i; | ||
70 | for (i = 1; i < strlen(cmd); i++) { //This doesn't work when it doesn't end with a space and another word | ||
71 | cmd[i - 1] = cmd[i]; //Still working on why | ||
72 | } | ||
73 | } | ||
74 | */ | ||
65 | 75 | ||
66 | if (!strcmp(cmd, "quit") || !strcmp(cmd, "exit") || !strcmp(cmd, "q")) { | 76 | if (!strcmp(cmd, "quit") || !strcmp(cmd, "exit") || !strcmp(cmd, "q")) { |
67 | endwin(); | 77 | endwin(); |
@@ -291,7 +301,7 @@ static void execute(ToxWindow *self, char *u_cmd) | |||
291 | } | 301 | } |
292 | msg[0] = 0; | 302 | msg[0] = 0; |
293 | msg++; | 303 | msg++; |
294 | if (m_sendmessage(atoi(id), (uint8_t*) msg, strlen(msg)+1) < 0) | 304 | if (m_sendmessage(atoi(id), (uint8_t*) msg, strlen(msg)+1) == 0) |
295 | wprintw(self->window, "Error occurred while sending message.\n"); | 305 | wprintw(self->window, "Error occurred while sending message.\n"); |
296 | else | 306 | else |
297 | wprintw(self->window, "Message successfully sent.\n"); | 307 | wprintw(self->window, "Message successfully sent.\n"); |
@@ -372,7 +382,7 @@ static void print_usage(ToxWindow *self) | |||
372 | wprintw(self->window, " myid : Print your ID\n"); | 382 | wprintw(self->window, " myid : Print your ID\n"); |
373 | wprintw(self->window, " quit/exit : Exit program\n"); | 383 | wprintw(self->window, " quit/exit : Exit program\n"); |
374 | wprintw(self->window, " help : Print this message again\n"); | 384 | wprintw(self->window, " help : Print this message again\n"); |
375 | wprintw(self->window, " clear : Clear this window\n"); | 385 | wprintw(self->window, " clear : Clear this window\n"); |
376 | 386 | ||
377 | wattron(self->window, A_BOLD); | 387 | wattron(self->window, A_BOLD); |
378 | wprintw(self->window, "TIP: Use the TAB key to navigate through the tabs.\n\n"); | 388 | wprintw(self->window, "TIP: Use the TAB key to navigate through the tabs.\n\n"); |