1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-11-12 23:33:03 +01:00
This commit is contained in:
Jfreegman 2013-08-05 02:32:50 -04:00
parent 765a722c90
commit 8ab8f6b834
2 changed files with 27 additions and 16 deletions

4
chat.c
View File

@ -236,6 +236,7 @@ void print_help(ChatContext* self) {
wprintw(self->history, " /nick <nickname> : Set your nickname\n");
wprintw(self->history, " /myid : Print your ID\n");
wprintw(self->history, " /clear : Clear the screen\n");
wprintw(self->history, " /close : Closes the current chat window\n");
wprintw(self->history, " /quit or /exit : Exit program\n");
wprintw(self->history, " /help : Print this message again\n\n");
@ -264,5 +265,6 @@ ToxWindow new_chat(int friendnum) {
x->friendnum = friendnum;
ret.x = (void*) x;
free(x);
return ret;
}
}

39
main.c
View File

@ -337,28 +337,37 @@ void set_active_window(int ch) {
int main(int argc, char* argv[]) {
int ch;
int i = 0;
int f_flag = 0;
char *filename = "data";
ToxWindow* a;
for(i = 0; i < argc; i++) {
if (argv[i] == NULL){
break;
} else if(argv[i][0] == '-') {
if(argv[i][1] == 'f') {
if(argv[i + 1] != NULL)
filename = argv[i + 1];
else {
f_flag = -1;
}
}
}
}
init_term();
init_tox();
init_window_status();
init_windows();
char *filename = "data";
load_data(filename);
init_windows();
int i;
for(i = 0; i < argc; i++) {
if(argv[i][0] == '-' && argv[i][1] == 'f') {
if(argv[i + 1] != NULL)
filename = argv[i + 1];
else {
attron(COLOR_PAIR(3) | A_BOLD);
wprintw(prompt->window, "You passed '-f' without giving an argument!\n"
if(f_flag == -1) {
attron(COLOR_PAIR(3) | A_BOLD);
wprintw(prompt->window, "You passed '-f' without giving an argument!\n"
"defaulting to 'data' for a keyfile...\n");
attroff(COLOR_PAIR(3) | A_BOLD);
}
}
attroff(COLOR_PAIR(3) | A_BOLD);
}
while(true) {
// Update tox.
do_tox();
@ -382,4 +391,4 @@ int main(int argc, char* argv[]) {
}
}
return 0;
}
}