void prof_run(char *log_level, char *account_name) { #ifdef PROF_HAVE_GTK gtk_ready = gtk_init_check(0, NULL); log_debug("Env is GTK-ready: %s", gtk_ready ? "true" : "false"); if (gtk_ready) { gtk_init(0, NULL); gtk_main_iteration_do(false); } #endif _init(log_level); plugins_on_start(); _connect_default(account_name); ui_update(); log_info("Starting main event loop"); activity_state = ACTIVITY_ST_ACTIVE; saved_status = NULL; char *line = NULL; while(cont && !force_quit) { log_stderr_handler(); _check_autoaway(); line = inp_readline(); if (line) { ProfWin *window = wins_get_current(); cont = cmd_process_input(window, line); free(line); line = NULL; } else { cont = TRUE; } #ifdef PROF_HAVE_LIBOTR otr_poll(); #endif plugins_run_timed(); notify_remind(); jabber_process_events(10); iq_autoping_check(); ui_update(); #ifdef PROF_HAVE_GTK if (gtk_ready) { gtk_main_iteration_do(false); } #endif } }
char* inp_get_line(void) { werase(inp_win); wmove(inp_win, 0, 0); _inp_win_update_virtual(); doupdate(); char *line = NULL; while (!line) { line = inp_readline(); ui_update(); } status_bar_clear(); return line; }
char* inp_get_password(void) { werase(inp_win); wmove(inp_win, 0, 0); pad_start = 0; _inp_win_update_virtual(); doupdate(); char *password = NULL; get_password = TRUE; while (!password) { password = inp_readline(); } get_password = FALSE; status_bar_clear(); return password; }
void prof_run(char *log_level, char *account_name) { _init(log_level); plugins_on_start(); _connect_default(account_name); ui_update(); log_info("Starting main event loop"); session_init_activity(); char *line = NULL; while(cont && !force_quit) { log_stderr_handler(); session_check_autoaway(); line = inp_readline(); if (line) { ProfWin *window = wins_get_current(); cont = cmd_process_input(window, line); free(line); line = NULL; } else { cont = TRUE; } #ifdef HAVE_LIBOTR otr_poll(); #endif plugins_run_timed(); notify_remind(); session_process_events(); iq_autoping_check(); ui_update(); #ifdef HAVE_GTK tray_update(); #endif } }