1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-05 18:06:46 +02:00

chat window deleting and re-adding - it just werks

This commit is contained in:
Jfreegman
2013-08-05 16:04:06 -04:00
parent f824373e6a
commit 6494a4070b
4 changed files with 43 additions and 40 deletions

View File

@ -158,7 +158,9 @@ static void execute(ToxWindow* self, char* cmd) {
break;
}
}
else if (!strcmp(cmd, "clear")) {
wclear(self->window);
}
else if(!strcmp(cmd, "help")) {
print_usage(self);
}
@ -254,9 +256,6 @@ static void execute(ToxWindow* self, char* cmd) {
wprintw(self->window, "Message successfully sent.\n");
}
}
else if (!strncmp(cmd, "clear", strlen("clear"))) {
wclear(self->window);
}
else {
wprintw(self->window, "Invalid command.\n");
}
@ -316,7 +315,7 @@ static void print_usage(ToxWindow* self) {
wprintw(self->window, " nick <nickname> : Set your nickname\n");
wprintw(self->window, " accept <number> : Accept friend request\n");
wprintw(self->window, " myid : Print your ID\n");
wprintw(self->window, " clear : Clear the screen\n");
wprintw(self->window, " clear : Clear this window\n");
wprintw(self->window, " quit/exit : Exit program\n");
wprintw(self->window, " help : Print this message again\n");