mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-23 02:23:02 +01:00
test
This commit is contained in:
parent
765a722c90
commit
8ab8f6b834
2
chat.c
2
chat.c
@ -236,6 +236,7 @@ void print_help(ChatContext* self) {
|
|||||||
wprintw(self->history, " /nick <nickname> : Set your nickname\n");
|
wprintw(self->history, " /nick <nickname> : Set your nickname\n");
|
||||||
wprintw(self->history, " /myid : Print your ID\n");
|
wprintw(self->history, " /myid : Print your ID\n");
|
||||||
wprintw(self->history, " /clear : Clear the screen\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, " /quit or /exit : Exit program\n");
|
||||||
wprintw(self->history, " /help : Print this message again\n\n");
|
wprintw(self->history, " /help : Print this message again\n\n");
|
||||||
|
|
||||||
@ -264,5 +265,6 @@ ToxWindow new_chat(int friendnum) {
|
|||||||
x->friendnum = friendnum;
|
x->friendnum = friendnum;
|
||||||
|
|
||||||
ret.x = (void*) x;
|
ret.x = (void*) x;
|
||||||
|
free(x);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
31
main.c
31
main.c
@ -337,28 +337,37 @@ void set_active_window(int ch) {
|
|||||||
|
|
||||||
int main(int argc, char* argv[]) {
|
int main(int argc, char* argv[]) {
|
||||||
int ch;
|
int ch;
|
||||||
|
int i = 0;
|
||||||
|
int f_flag = 0;
|
||||||
|
char *filename = "data";
|
||||||
ToxWindow* a;
|
ToxWindow* a;
|
||||||
|
|
||||||
init_term();
|
|
||||||
init_tox();
|
|
||||||
init_window_status();
|
|
||||||
init_windows();
|
|
||||||
char *filename = "data";
|
|
||||||
load_data(filename);
|
|
||||||
|
|
||||||
int i;
|
|
||||||
for(i = 0; i < argc; i++) {
|
for(i = 0; i < argc; i++) {
|
||||||
if(argv[i][0] == '-' && argv[i][1] == 'f') {
|
if (argv[i] == NULL){
|
||||||
|
break;
|
||||||
|
} else if(argv[i][0] == '-') {
|
||||||
|
if(argv[i][1] == 'f') {
|
||||||
if(argv[i + 1] != NULL)
|
if(argv[i + 1] != NULL)
|
||||||
filename = argv[i + 1];
|
filename = argv[i + 1];
|
||||||
else {
|
else {
|
||||||
|
f_flag = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
init_term();
|
||||||
|
init_tox();
|
||||||
|
load_data(filename);
|
||||||
|
init_windows();
|
||||||
|
|
||||||
|
if(f_flag == -1) {
|
||||||
attron(COLOR_PAIR(3) | A_BOLD);
|
attron(COLOR_PAIR(3) | A_BOLD);
|
||||||
wprintw(prompt->window, "You passed '-f' without giving an argument!\n"
|
wprintw(prompt->window, "You passed '-f' without giving an argument!\n"
|
||||||
"defaulting to 'data' for a keyfile...\n");
|
"defaulting to 'data' for a keyfile...\n");
|
||||||
attroff(COLOR_PAIR(3) | A_BOLD);
|
attroff(COLOR_PAIR(3) | A_BOLD);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
while(true) {
|
while(true) {
|
||||||
// Update tox.
|
// Update tox.
|
||||||
do_tox();
|
do_tox();
|
||||||
|
Loading…
Reference in New Issue
Block a user