diff options
Diffstat (limited to 'testing')
-rw-r--r-- | testing/toxic/chat.c | 3 | ||||
-rw-r--r-- | testing/toxic/main.c | 3 | ||||
-rw-r--r-- | testing/toxic/prompt.c | 14 |
3 files changed, 15 insertions, 5 deletions
diff --git a/testing/toxic/chat.c b/testing/toxic/chat.c index 2563fa9c..28c5de6c 100644 --- a/testing/toxic/chat.c +++ b/testing/toxic/chat.c | |||
@@ -57,7 +57,6 @@ static void chat_onMessage(ToxWindow *self, int num, uint8_t *msg, uint16_t len) | |||
57 | 57 | ||
58 | self->blink = true; | 58 | self->blink = true; |
59 | beep(); | 59 | beep(); |
60 | flash(); | ||
61 | } | 60 | } |
62 | 61 | ||
63 | static void chat_onNickChange(ToxWindow *self, int num, uint8_t *nick, uint16_t len) | 62 | static void chat_onNickChange(ToxWindow *self, int num, uint8_t *nick, uint16_t len) |
@@ -121,7 +120,7 @@ static void chat_onKey(ToxWindow *self, int key) | |||
121 | wattroff(ctx->history, COLOR_PAIR(1)); | 120 | wattroff(ctx->history, COLOR_PAIR(1)); |
122 | wprintw(ctx->history, "%s\n", ctx->line); | 121 | wprintw(ctx->history, "%s\n", ctx->line); |
123 | } | 122 | } |
124 | if (m_sendmessage(ctx->friendnum, (uint8_t*) ctx->line, strlen(ctx->line)+1) < 0) { | 123 | if (m_sendmessage(ctx->friendnum, (uint8_t*) ctx->line, strlen(ctx->line)+1) == 0) { |
125 | wattron(ctx->history, COLOR_PAIR(3)); | 124 | wattron(ctx->history, COLOR_PAIR(3)); |
126 | wprintw(ctx->history, " * Failed to send message.\n"); | 125 | wprintw(ctx->history, " * Failed to send message.\n"); |
127 | wattroff(ctx->history, COLOR_PAIR(3)); | 126 | wattroff(ctx->history, COLOR_PAIR(3)); |
diff --git a/testing/toxic/main.c b/testing/toxic/main.c index 59333004..b2310c80 100644 --- a/testing/toxic/main.c +++ b/testing/toxic/main.c | |||
@@ -22,6 +22,7 @@ extern int add_req(uint8_t *public_key); // XXX | |||
22 | 22 | ||
23 | /* Holds status of chat windows */ | 23 | /* Holds status of chat windows */ |
24 | char WINDOW_STATUS[MAX_WINDOW_SLOTS]; | 24 | char WINDOW_STATUS[MAX_WINDOW_SLOTS]; |
25 | #define TOXICVER "0.1.0" //Will be moved to a -D flag later | ||
25 | 26 | ||
26 | static ToxWindow windows[MAX_WINDOW_SLOTS]; | 27 | static ToxWindow windows[MAX_WINDOW_SLOTS]; |
27 | static ToxWindow* prompt; | 28 | static ToxWindow* prompt; |
@@ -258,7 +259,7 @@ static void draw_bar() | |||
258 | move(LINES - 1, 0); | 259 | move(LINES - 1, 0); |
259 | 260 | ||
260 | attron(COLOR_PAIR(4) | A_BOLD); | 261 | attron(COLOR_PAIR(4) | A_BOLD); |
261 | printw(" TOXIC 1.0 |"); | 262 | printw(" TOXIC " TOXICVER " |"); |
262 | attroff(COLOR_PAIR(4) | A_BOLD); | 263 | attroff(COLOR_PAIR(4) | A_BOLD); |
263 | 264 | ||
264 | int i; | 265 | int i; |
diff --git a/testing/toxic/prompt.c b/testing/toxic/prompt.c index 01261cce..661d881f 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(); |
@@ -287,7 +297,7 @@ static void execute(ToxWindow *self, char *u_cmd) | |||
287 | } | 297 | } |
288 | msg[0] = 0; | 298 | msg[0] = 0; |
289 | msg++; | 299 | msg++; |
290 | if (m_sendmessage(atoi(id), (uint8_t*) msg, strlen(msg)+1) < 0) | 300 | if (m_sendmessage(atoi(id), (uint8_t*) msg, strlen(msg)+1) == 0) |
291 | wprintw(self->window, "Error occurred while sending message.\n"); | 301 | wprintw(self->window, "Error occurred while sending message.\n"); |
292 | else | 302 | else |
293 | wprintw(self->window, "Message successfully sent.\n"); | 303 | wprintw(self->window, "Message successfully sent.\n"); |
@@ -368,7 +378,7 @@ static void print_usage(ToxWindow *self) | |||
368 | wprintw(self->window, " myid : Print your ID\n"); | 378 | wprintw(self->window, " myid : Print your ID\n"); |
369 | wprintw(self->window, " quit/exit : Exit program\n"); | 379 | wprintw(self->window, " quit/exit : Exit program\n"); |
370 | wprintw(self->window, " help : Print this message again\n"); | 380 | wprintw(self->window, " help : Print this message again\n"); |
371 | wprintw(self->window, " clear : Clear this window\n"); | 381 | wprintw(self->window, " clear : Clear this window\n"); |
372 | 382 | ||
373 | wattron(self->window, A_BOLD); | 383 | wattron(self->window, A_BOLD); |
374 | wprintw(self->window, "TIP: Use the TAB key to navigate through the tabs.\n\n"); | 384 | wprintw(self->window, "TIP: Use the TAB key to navigate through the tabs.\n\n"); |