mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Merge branch 'master' of https://github.com/irungentoo/ProjectTox-Core
This commit is contained in:
commit
26a01e92ec
|
@ -314,7 +314,7 @@ void execute(ToxWindow *self, ChatContext *ctx, Messenger *m, char *cmd)
|
|||
snprintf(xx, sizeof(xx), "%02X", address[i] & 0xff);
|
||||
strcat(id, xx);
|
||||
}
|
||||
wprintw(ctx->history, "Your ID: %s\n", id);
|
||||
wprintw(ctx->history, "%s\n", id);
|
||||
}
|
||||
|
||||
else if (strcmp(ctx->line, "/close") == 0) {
|
||||
|
|
|
@ -45,7 +45,7 @@ static void init_term()
|
|||
refresh();
|
||||
}
|
||||
|
||||
static Messenger * init_tox()
|
||||
static Messenger *init_tox()
|
||||
{
|
||||
/* Init core */
|
||||
Messenger *m = initMessenger();
|
||||
|
@ -196,19 +196,9 @@ static void load_data(Messenger *m, char *path)
|
|||
int main(int argc, char *argv[])
|
||||
{
|
||||
char *user_config_dir = get_user_config_dir();
|
||||
char *DATA_FILE;
|
||||
int config_err = create_user_config_dir(user_config_dir);
|
||||
if(config_err) {
|
||||
DATA_FILE = "data";
|
||||
} else {
|
||||
DATA_FILE = malloc(strlen(user_config_dir) + strlen(CONFIGDIR) + strlen("data") + 1);
|
||||
strcpy(DATA_FILE, user_config_dir);
|
||||
strcat(DATA_FILE, CONFIGDIR);
|
||||
strcat(DATA_FILE, "data");
|
||||
}
|
||||
free(user_config_dir);
|
||||
char *DATA_FILE = NULL;
|
||||
int config_err = 0;
|
||||
|
||||
/* This is broken */
|
||||
int f_loadfromfile = 1;
|
||||
int f_flag = 0;
|
||||
int i = 0;
|
||||
|
@ -227,9 +217,22 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
}
|
||||
|
||||
if (DATA_FILE == NULL ) {
|
||||
config_err = create_user_config_dir(user_config_dir);
|
||||
if (config_err) {
|
||||
DATA_FILE = strdup("data");
|
||||
} else {
|
||||
DATA_FILE = malloc(strlen(user_config_dir) + strlen(CONFIGDIR) + strlen("data") + 1);
|
||||
strcpy(DATA_FILE, user_config_dir);
|
||||
strcat(DATA_FILE, CONFIGDIR);
|
||||
strcat(DATA_FILE, "data");
|
||||
}
|
||||
}
|
||||
free(user_config_dir);
|
||||
|
||||
init_term();
|
||||
Messenger *m = init_tox();
|
||||
ToxWindow * prompt = init_windows(m);
|
||||
ToxWindow *prompt = init_windows(m);
|
||||
init_window_status();
|
||||
|
||||
if(f_loadfromfile)
|
||||
|
|
|
@ -238,7 +238,7 @@ void cmd_myid(ToxWindow *self, Messenger *m, char **args)
|
|||
snprintf(xx, sizeof(xx), "%02X", address[i] & 0xff);
|
||||
strcat(id, xx);
|
||||
}
|
||||
wprintw(self->window, "Your ID: %s\n", id);
|
||||
wprintw(self->window, "%s\n", id);
|
||||
}
|
||||
|
||||
void cmd_nick(ToxWindow *self, Messenger *m, char **args)
|
||||
|
|
|
@ -159,7 +159,7 @@ void init_window_status()
|
|||
WINDOW_STATUS[j] = -1;
|
||||
}
|
||||
|
||||
ToxWindow * init_windows()
|
||||
ToxWindow *init_windows()
|
||||
{
|
||||
w_num = 0;
|
||||
int n_prompt = 0;
|
||||
|
@ -170,6 +170,7 @@ ToxWindow * init_windows()
|
|||
endwin();
|
||||
exit(1);
|
||||
}
|
||||
active_window = n_prompt;
|
||||
prompt = &windows[n_prompt];
|
||||
return prompt;
|
||||
}
|
||||
|
@ -217,7 +218,7 @@ void prepare_window(WINDOW *w)
|
|||
wresize(w, LINES-2, COLS);
|
||||
}
|
||||
|
||||
void draw_active_window(Messenger * m)
|
||||
void draw_active_window(Messenger *m)
|
||||
{
|
||||
|
||||
ToxWindow *a = &windows[active_window];
|
||||
|
|
Loading…
Reference in New Issue
Block a user