Example #1
0
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
    }
}
Example #2
0
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
    }
}