• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ prefs_get_string函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中prefs_get_string函数的典型用法代码示例。如果您正苦于以下问题:C++ prefs_get_string函数的具体用法?C++ prefs_get_string怎么用?C++ prefs_get_string使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了prefs_get_string函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: prof_run

void
prof_run(const int disable_tls, char *log_level, char *account_name)
{
    _init(disable_tls, log_level);
    log_info("Starting main event loop");
    inp_non_block();
    GTimer *timer = g_timer_new();
    gboolean cmd_result = TRUE;
    jabber_conn_status_t conn_status = jabber_get_connection_status();

    char inp[INP_WIN_MAX];
    int size = 0;

    ui_update_screen();

    if (account_name != NULL) {
      char *cmd = "/connect";
      snprintf(inp, sizeof(inp), "%s %s", cmd, account_name);
      process_input(inp);
    } else if (prefs_get_string(PREF_CONNECT_ACCOUNT) != NULL) {
      char *cmd = "/connect";
      snprintf(inp, sizeof(inp), "%s %s", cmd, prefs_get_string(PREF_CONNECT_ACCOUNT));
      process_input(inp);
    }

    while(cmd_result == TRUE) {
        wint_t ch = ERR;
        size = 0;

        while(ch != '\n') {
            conn_status = jabber_get_connection_status();
            if (conn_status == JABBER_CONNECTED) {
                _handle_idle_time();
            }

            gdouble elapsed = g_timer_elapsed(timer, NULL);

            gint remind_period = prefs_get_notify_remind();
            if (remind_period > 0 && elapsed >= remind_period) {
                notify_remind();
                g_timer_start(timer);
            }

            ui_handle_special_keys(&ch, inp, size);
            ui_update_screen();
            jabber_process_events();

            ch = inp_get_char(inp, &size);
            if (ch != ERR) {
                ui_reset_idle_time();
            }
        }

        inp[size++] = '\0';
        cmd_result = process_input(inp);
    }

    g_timer_destroy(timer);
}
开发者ID:pedroarthur,项目名称:profanity,代码行数:59,代码来源:profanity.c


示例2: _check_autoaway

static void
_check_autoaway()
{
    jabber_conn_status_t conn_status = jabber_get_connection_status();
    if (conn_status != JABBER_CONNECTED) {
        return;
    }

    gint prefs_time = prefs_get_autoaway_time() * 60000;
    unsigned long idle_ms = ui_get_idle_time();
    char *pref_autoaway_mode = prefs_get_string(PREF_AUTOAWAY_MODE);

    if (!idle) {
        resource_presence_t current_presence = accounts_get_last_presence(jabber_get_account_name());
        if ((current_presence == RESOURCE_ONLINE) || (current_presence == RESOURCE_CHAT)) {
            if (idle_ms >= prefs_time) {
                idle = TRUE;
                char *pref_autoaway_message = prefs_get_string(PREF_AUTOAWAY_MESSAGE);

                // handle away mode
                if (strcmp(pref_autoaway_mode, "away") == 0) {
                    presence_update(RESOURCE_AWAY, pref_autoaway_message, 0);
                    ui_auto_away();

                // handle idle mode
                } else if (strcmp(pref_autoaway_mode, "idle") == 0) {
                    presence_update(RESOURCE_ONLINE, pref_autoaway_message, idle_ms / 1000);
                }

                prefs_free_string(pref_autoaway_message);
            }
        }

    } else {
        if (idle_ms < prefs_time) {
            idle = FALSE;

            // handle check
            if (prefs_get_boolean(PREF_AUTOAWAY_CHECK)) {
                if (strcmp(pref_autoaway_mode, "away") == 0) {
                    presence_update(RESOURCE_ONLINE, NULL, 0);
                    ui_end_auto_away();
                } else if (strcmp(pref_autoaway_mode, "idle") == 0) {
                    presence_update(RESOURCE_ONLINE, NULL, 0);
                    ui_titlebar_presence(CONTACT_ONLINE);
                }
            }
        }
    }

    prefs_free_string(pref_autoaway_mode);
}
开发者ID:leowzukw,项目名称:profanity,代码行数:52,代码来源:profanity.c


示例3: handle_incoming_message

void
handle_incoming_message(char *from, char *message, gboolean priv)
{
#ifdef HAVE_LIBOTR
    gboolean was_decrypted = FALSE;
    char *newmessage;
    if (!priv) {
        newmessage = otr_decrypt_message(from, message, &was_decrypted);

        // internal OTR message
        if (newmessage == NULL) {
            return;
        }
    } else {
        newmessage = message;
    }

    ui_incoming_msg(from, newmessage, NULL, priv);
    ui_current_page_off();

    if (prefs_get_boolean(PREF_CHLOG) && !priv) {
        Jid *from_jid = jid_create(from);
        const char *jid = jabber_get_fulljid();
        Jid *jidp = jid_create(jid);

        if (!was_decrypted || (strcmp(prefs_get_string(PREF_OTR_LOG), "on") == 0)) {
            chat_log_chat(jidp->barejid, from_jid->barejid, newmessage, PROF_IN_LOG, NULL);
        } else if (strcmp(prefs_get_string(PREF_OTR_LOG), "redact") == 0) {
            chat_log_chat(jidp->barejid, from_jid->barejid, "[redacted]", PROF_IN_LOG, NULL);
        }

        jid_destroy(jidp);
        jid_destroy(from_jid);
    }

    if (!priv)
        otr_free_message(newmessage);
#else
    ui_incoming_msg(from, message, NULL, priv);
    ui_current_page_off();

    if (prefs_get_boolean(PREF_CHLOG) && !priv) {
        Jid *from_jid = jid_create(from);
        const char *jid = jabber_get_fulljid();
        Jid *jidp = jid_create(jid);
        chat_log_chat(jidp->barejid, from_jid->barejid, message, PROF_IN_LOG, NULL);
        jid_destroy(jidp);
        jid_destroy(from_jid);
    }
#endif
}
开发者ID:louiecaulfield,项目名称:profanity,代码行数:51,代码来源:server_events.c


示例4: status_bar_print_message

void
status_bar_print_message(const char * const msg)
{
    werase(status_bar);

    if (message) {
        free(message);
    }
    message = strdup(msg);

    char *time_pref = prefs_get_string(PREF_TIME_STATUSBAR);
    gchar *date_fmt = g_date_time_format(last_time, time_pref);
    assert(date_fmt != NULL);
    size_t len = strlen(date_fmt);
    g_free(date_fmt);
    if (g_strcmp0(time_pref, "") != 0) {
        mvwprintw(status_bar, 0, 5 + len, message);
    } else {
        mvwprintw(status_bar, 0, 1, message);
    }
    prefs_free_string(time_pref);

    int cols = getmaxx(stdscr);
    int bracket_attrs = theme_attrs(THEME_STATUS_BRACKET);

    wattron(status_bar, bracket_attrs);
    mvwprintw(status_bar, 0, cols - 34, _active);
    mvwprintw(status_bar, 0, cols - 34 + ((current - 1) * 3), bracket);
    wattroff(status_bar, bracket_attrs);

    _status_bar_draw();
}
开发者ID:kseistrup,项目名称:profanity,代码行数:32,代码来源:statusbar.c


示例5: _status_bar_draw

static void
_status_bar_draw(void)
{
    if (last_time) {
        g_date_time_unref(last_time);
    }
    last_time = g_date_time_new_now_local();

    int bracket_attrs = theme_attrs(THEME_STATUS_BRACKET);

    char *time_pref = prefs_get_string(PREF_TIME_STATUSBAR);
    if (g_strcmp0(time_pref, "off") != 0) {
        gchar *date_fmt = g_date_time_format(last_time, time_pref);
        assert(date_fmt != NULL);
        size_t len = strlen(date_fmt);
        wattron(status_bar, bracket_attrs);
        mvwaddch(status_bar, 0, 1, '[');
        wattroff(status_bar, bracket_attrs);
        mvwprintw(status_bar, 0, 2, date_fmt);
        wattron(status_bar, bracket_attrs);
        mvwaddch(status_bar, 0, 2 + len, ']');
        wattroff(status_bar, bracket_attrs);
        g_free(date_fmt);
    }
    prefs_free_string(time_pref);

    _update_win_statuses();
    wnoutrefresh(status_bar);
    inp_put_back();
}
开发者ID:halfur,项目名称:profanity,代码行数:30,代码来源:statusbar.c


示例6: status_bar_resize

void
status_bar_resize(void)
{
    int rows, cols;
    getmaxyx(stdscr, rows, cols);

    werase(status_bar);

    int bracket_attrs = theme_attrs(THEME_STATUS_BRACKET);

    mvwin(status_bar, rows-2, 0);
    wresize(status_bar, 1, cols);
    wbkgd(status_bar, theme_attrs(THEME_STATUS_TEXT));
    wattron(status_bar, bracket_attrs);
    mvwprintw(status_bar, 0, cols - 34, _active);
    mvwprintw(status_bar, 0, cols - 34 + ((current - 1) * 3), bracket);
    wattroff(status_bar, bracket_attrs);

    if (message) {
        char *time_pref = prefs_get_string(PREF_TIME_STATUSBAR);
        if (g_strcmp0(time_pref, "minutes") == 0) {
            mvwprintw(status_bar, 0, 10, message);
        } else if (g_strcmp0(time_pref, "seconds") == 0) {
            mvwprintw(status_bar, 0, 13, message);
        } else {
            mvwprintw(status_bar, 0, 1, message);
        }
    }
    if (last_time) {
        g_date_time_unref(last_time);
    }
    last_time = g_date_time_new_now_local();

    _status_bar_draw();
}
开发者ID:PMaynard,项目名称:profanity,代码行数:35,代码来源:statusbar.c


示例7: status_bar_print_message

void
status_bar_print_message(const char * const msg)
{
    werase(status_bar);

    if (message) {
        free(message);
    }
    message = strdup(msg);

    char *time_pref = prefs_get_string(PREF_TIME_STATUSBAR);
    if (g_strcmp0(time_pref, "minutes") == 0) {
        mvwprintw(status_bar, 0, 10, message);
    } else if (g_strcmp0(time_pref, "seconds") == 0) {
        mvwprintw(status_bar, 0, 13, message);
    } else {
        mvwprintw(status_bar, 0, 1, message);
    }

    int cols = getmaxx(stdscr);
    int bracket_attrs = theme_attrs(THEME_STATUS_BRACKET);

    wattron(status_bar, bracket_attrs);
    mvwprintw(status_bar, 0, cols - 34, _active);
    mvwprintw(status_bar, 0, cols - 34 + ((current - 1) * 3), bracket);
    wattroff(status_bar, bracket_attrs);

    _status_bar_draw();
}
开发者ID:PMaynard,项目名称:profanity,代码行数:29,代码来源:statusbar.c


示例8: charset_check_auto

/* Must free the returned string yourself */
gchar *charset_to_utf8 (const gchar *str)
{
    gchar *charset;  /* From prefs */
    const gchar *locale_charset; /* Used if prefs doesn't have a charset */
    gchar *result;

    if (str == NULL) return NULL;  /* sanity */
    charset = charset_check_auto (str);
    if (charset)
    {
	g_free(auto_charset);
	auto_charset = g_strdup(charset);
    }
    else
    {
	charset = prefs_get_string("charset");
	if (!charset || !strlen (charset))
	{    /* use standard locale charset */
	    g_free(charset);
	    g_get_charset (&locale_charset);
	    charset = g_strdup(locale_charset);
	}
    }

    result = charset_to_charset (charset, "UTF-8", str);
    g_free(charset);
    return result;
}
开发者ID:Sprezzatech,项目名称:gtkpod,代码行数:29,代码来源:charset.c


示例9: g_return_val_if_fail

/* Must free the returned string yourself */
gchar *charset_track_charset_from_utf8 (Track *s, const gchar *str)
{
    gchar *charset;
    const gchar *locale_charset;
    gchar *result;
    ExtraTrackData *etd;

    g_return_val_if_fail (s, NULL);
    g_return_val_if_fail (s->userdata, NULL);

    if (str == NULL) return NULL;  /* sanity */

    etd = s->userdata;

    if (etd->charset && strlen (etd->charset))
	   charset = g_strdup(etd->charset);
    else
	charset = prefs_get_string("charset");

    if (!charset || !strlen (charset))
    {    /* use standard locale charset */
	g_free(charset);
	g_get_charset (&locale_charset);
	charset = g_strdup(locale_charset);
    }

    result = charset_to_charset ("UTF-8", charset, str);
    g_free(charset);
    return result;
}
开发者ID:Sprezzatech,项目名称:gtkpod,代码行数:31,代码来源:charset.c


示例10: _win_print_wrapped

static void
_win_print_wrapped(WINDOW *win, const char * const message)
{
    int linei = 0;
    int wordi = 0;
    char *word = malloc(strlen(message) + 1);

    char *time_pref = prefs_get_string(PREF_TIME);
    int indent = 0;
    if (g_strcmp0(time_pref, "minutes") == 0) {
        indent = 8;
    } else if (g_strcmp0(time_pref, "seconds") == 0) {
        indent = 11;
    }
    free(time_pref);

    while (message[linei] != '\0') {
        if (message[linei] == ' ') {
            waddch(win, ' ');
            linei++;
        } else if (message[linei] == '\n') {
            waddch(win, '\n');
            _win_indent(win, indent);
            linei++;
        } else {
            wordi = 0;
            while (message[linei] != ' ' && message[linei] != '\n' && message[linei] != '\0') {
                word[wordi++] = message[linei++];
            }
            word[wordi] = '\0';

            int curx = getcurx(win);
            int maxx = getmaxx(win);

            // word larger than line
            if (strlen(word) > (maxx - indent)) {
                int i;
                for (i = 0; i < wordi; i++) {
                    curx = getcurx(win);
                    if (curx < indent) {
                        _win_indent(win, indent);
                    }
                    waddch(win, word[i]);
                }
            } else {
                if (curx + strlen(word) > maxx) {
                    waddch(win, '\n');
                    _win_indent(win, indent);
                }
                if (curx < indent) {
                    _win_indent(win, indent);
                }
                wprintw(win, "%s", word);
            }
        }
    }

    free(word);
}
开发者ID:AlexTalker,项目名称:profanity,代码行数:59,代码来源:window.c


示例11: _init

static void
_init(char *log_level)
{
    setlocale(LC_ALL, "");
    // ignore SIGPIPE
    signal(SIGPIPE, SIG_IGN);
    signal(SIGINT, SIG_IGN);
    signal(SIGTSTP, SIG_IGN);
    signal(SIGWINCH, ui_sigwinch_handler);
    if (pthread_mutex_init(&lock, NULL) != 0) {
        log_error("Mutex init failed");
        exit(1);
    }
    pthread_mutex_lock(&lock);
    files_create_directories();
    log_level_t prof_log_level = log_level_from_string(log_level);
    prefs_load();
    log_init(prof_log_level);
    log_stderr_init(PROF_LEVEL_ERROR);
    if (strcmp(PACKAGE_STATUS, "development") == 0) {
#ifdef HAVE_GIT_VERSION
            log_info("Starting Profanity (%sdev.%s.%s)...", PACKAGE_VERSION, PROF_GIT_BRANCH, PROF_GIT_REVISION);
#else
            log_info("Starting Profanity (%sdev)...", PACKAGE_VERSION);
#endif
    } else {
        log_info("Starting Profanity (%s)...", PACKAGE_VERSION);
    }
    chat_log_init();
    groupchat_log_init();
    accounts_load();
    char *theme = prefs_get_string(PREF_THEME);
    theme_init(theme);
    prefs_free_string(theme);
    ui_init();
    session_init();
    cmd_init();
    log_info("Initialising contact list");
    muc_init();
    tlscerts_init();
    scripts_init();
#ifdef HAVE_LIBOTR
    otr_init();
#endif
#ifdef HAVE_LIBGPGME
    p_gpg_init();
#endif
#ifdef HAVE_OMEMO
    omemo_init();
#endif
    atexit(_shutdown);
    plugins_init();
#ifdef HAVE_GTK
    tray_init();
#endif
    inp_nonblocking(TRUE);
    ui_resize();
}
开发者ID:boothj5,项目名称:profanity,代码行数:58,代码来源:profanity.c


示例12: sample_load_cb

void
sample_load_cb(GtkWidget * widget, gpointer data)
{

  GtkWidget *dialog;
  gchar load_current_file [512];
  gint win_width, win_height;
  GSList *filenames, *list;

  filenames = list = NULL;

  win_width = gdk_screen_width () / 2;
  win_height = gdk_screen_height () / 2;

  dialog = gtk_file_chooser_dialog_new (_("Sweep: Open Files"),
				      data,
				      GTK_FILE_CHOOSER_ACTION_OPEN,
				      GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
				      GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
				      NULL);

  gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER);
  gtk_widget_set_size_request (dialog, win_width, win_height);
  gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), TRUE);

  sweep_set_window_icon (GTK_WINDOW(dialog));
  attach_window_close_accel(GTK_WINDOW(dialog));

  prefs_get_string (LAST_LOAD_KEY, load_current_file, sizeof (load_current_file), "");

  if (load_current_file [0]) {
      gtk_file_chooser_set_filename (GTK_FILE_CHOOSER(dialog), load_current_file);
  }

  if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) {

   filenames = gtk_file_chooser_get_filenames (GTK_FILE_CHOOSER(dialog));

   for (list = filenames; list; list = list->next) {

     if (list->data) {
       sample_load ((gchar *)list->data);
       g_free (list->data);
     }
  }

  if (filenames)
    g_slist_free(filenames);

  } else {
    /* do nothing so exit */
     sample_bank_remove(NULL);
  }

  gtk_widget_destroy (dialog);
}
开发者ID:JamesLinus,项目名称:sweep,代码行数:56,代码来源:file_dialogs.c


示例13: cons_theme_setting

void
cons_theme_setting(void)
{
    gchar *theme = prefs_get_string(PREF_THEME);
    if (theme == NULL) {
        cons_show("Theme (/theme)               : default");
    } else {
        cons_show("Theme (/theme)               : %s", theme);
    }
}
开发者ID:cjopcjop,项目名称:profanity,代码行数:10,代码来源:console.c


示例14: handle_contact_online

void
handle_contact_online(char *barejid, Resource *resource,
    GDateTime *last_activity)
{
    gboolean updated = roster_update_presence(barejid, resource, last_activity);

    if (updated) {
        char *show_console = prefs_get_string(PREF_STATUSES_CONSOLE);
        char *show_chat_win = prefs_get_string(PREF_STATUSES_CHAT);
        PContact contact = roster_get_contact(barejid);
        if (p_contact_subscription(contact) != NULL) {
            if (strcmp(p_contact_subscription(contact), "none") != 0) {

                // show in console if "all"
                if (g_strcmp0(show_console, "all") == 0) {
                    cons_show_contact_online(contact, resource, last_activity);

                // show in console of "online" and presence online
                } else if (g_strcmp0(show_console, "online") == 0 &&
                        resource->presence == RESOURCE_ONLINE) {
                    cons_show_contact_online(contact, resource, last_activity);

                }

                // show in chat win if "all"
                if (g_strcmp0(show_chat_win, "all") == 0) {
                    ui_chat_win_contact_online(contact, resource, last_activity);

                // show in char win if "online" and presence online
                } else if (g_strcmp0(show_chat_win, "online") == 0 &&
                        resource->presence == RESOURCE_ONLINE) {
                    ui_chat_win_contact_online(contact, resource, last_activity);
                }
            }
        }
        prefs_free_string(show_console);
        prefs_free_string(show_chat_win);
    }

    ui_roster();
}
开发者ID:fabianfreyer,项目名称:profanity,代码行数:41,代码来源:server_events.c


示例15: handle_room_member_offline

void
handle_room_member_offline(const char * const room, const char * const nick,
    const char * const show, const char * const status)
{
    muc_remove_from_roster(room, nick);

    char *muc_status_pref = prefs_get_string(PREF_STATUSES_MUC);
    if (g_strcmp0(muc_status_pref, "none") != 0) {
        ui_room_member_offline(room, nick);
    }
    prefs_free_string(muc_status_pref);
}
开发者ID:dotoole,项目名称:profanity,代码行数:12,代码来源:server_events.c


示例16: otr_get_policy

prof_otrpolicy_t
otr_get_policy(const char *const recipient)
{
    char *account_name = jabber_get_account_name();
    ProfAccount *account = accounts_get_account(account_name);
    // check contact specific setting
    if (g_list_find_custom(account->otr_manual, recipient, (GCompareFunc)g_strcmp0)) {
        account_free(account);
        return PROF_OTRPOLICY_MANUAL;
    }
    if (g_list_find_custom(account->otr_opportunistic, recipient, (GCompareFunc)g_strcmp0)) {
        account_free(account);
        return PROF_OTRPOLICY_OPPORTUNISTIC;
    }
    if (g_list_find_custom(account->otr_always, recipient, (GCompareFunc)g_strcmp0)) {
        account_free(account);
        return PROF_OTRPOLICY_ALWAYS;
    }

    // check default account setting
    if (account->otr_policy) {
        prof_otrpolicy_t result;
        if (g_strcmp0(account->otr_policy, "manual") == 0) {
            result = PROF_OTRPOLICY_MANUAL;
        }
        if (g_strcmp0(account->otr_policy, "opportunistic") == 0) {
            result = PROF_OTRPOLICY_OPPORTUNISTIC;
        }
        if (g_strcmp0(account->otr_policy, "always") == 0) {
            result = PROF_OTRPOLICY_ALWAYS;
        }
        account_free(account);
        return result;
    }
    account_free(account);

    // check global setting
    char *pref_otr_policy = prefs_get_string(PREF_OTR_POLICY);

    // pref defaults to manual
    prof_otrpolicy_t result = PROF_OTRPOLICY_MANUAL;

    if (strcmp(pref_otr_policy, "opportunistic") == 0) {
        result = PROF_OTRPOLICY_OPPORTUNISTIC;
    } else if (strcmp(pref_otr_policy, "always") == 0) {
        result = PROF_OTRPOLICY_ALWAYS;
    }

    prefs_free_string(pref_otr_policy);

    return result;
}
开发者ID:BlueMonday,项目名称:profanity,代码行数:52,代码来源:otr.c


示例17: _init

static void
_init(char *log_level)
{
    setlocale(LC_ALL, "");
    // ignore SIGPIPE
    signal(SIGPIPE, SIG_IGN);
    signal(SIGINT, SIG_IGN);
    signal(SIGTSTP, SIG_IGN);
    signal(SIGWINCH, ui_sigwinch_handler);
    _create_directories();
    log_level_t prof_log_level = log_level_from_string(log_level);
    prefs_load();
    log_init(prof_log_level);
    log_stderr_init(PROF_LEVEL_ERROR);
    if (strcmp(PROF_PACKAGE_STATUS, "development") == 0) {
#ifdef PROF_HAVE_GIT_VERSION
            log_info("Starting Profanity (%sdev.%s.%s)...", PROF_PACKAGE_VERSION, PROF_GIT_BRANCH, PROF_GIT_REVISION);
#else
            log_info("Starting Profanity (%sdev)...", PROF_PACKAGE_VERSION);
#endif
    } else {
        log_info("Starting Profanity (%s)...", PROF_PACKAGE_VERSION);
    }
    chat_log_init();
    groupchat_log_init();
    accounts_load();
    char *theme = prefs_get_string(PREF_THEME);
    theme_init(theme);
    prefs_free_string(theme);
    ui_init();
    jabber_init();
    cmd_init();
    log_info("Initialising contact list");
    muc_init();
    tlscerts_init();
    scripts_init();
#ifdef PROF_HAVE_LIBOTR
    otr_init();
#endif
#ifdef PROF_HAVE_LIBGPGME
    p_gpg_init();
#endif
    atexit(_shutdown);
    plugins_init();
#ifdef PROF_HAVE_GTK
    if (gtk_ready) {
        log_debug("Building GTK icon");
        create_tray();
    }
#endif
    inp_nonblocking(TRUE);
}
开发者ID:Dav1d23,项目名称:profanity,代码行数:52,代码来源:profanity.c


示例18: sv_ev_room_occupant_offline

void
sv_ev_room_occupant_offline(const char * const room, const char * const nick,
    const char * const show, const char * const status)
{
    muc_roster_remove(room, nick);

    char *muc_status_pref = prefs_get_string(PREF_STATUSES_MUC);
    if (g_strcmp0(muc_status_pref, "none") != 0) {
        ui_room_member_offline(room, nick);
    }
    prefs_free_string(muc_status_pref);
    occupantswin_occupants(room);
}
开发者ID:PMaynard,项目名称:profanity,代码行数:13,代码来源:server_events.c


示例19: handle_contact_offline

void
handle_contact_offline(char *barejid, char *resource, char *status)
{
    gboolean updated = roster_contact_offline(barejid, resource, status);

    if (resource != NULL && updated) {
        char *show_console = prefs_get_string(PREF_STATUSES_CONSOLE);
        char *show_chat_win = prefs_get_string(PREF_STATUSES_CHAT);
        Jid *jid = jid_create_from_bare_and_resource(barejid, resource);
        PContact contact = roster_get_contact(barejid);
        if (p_contact_subscription(contact) != NULL) {
            if (strcmp(p_contact_subscription(contact), "none") != 0) {

                // show in console if "all"
                if (g_strcmp0(show_console, "all") == 0) {
                    cons_show_contact_offline(contact, resource, status);

                // show in console of "online"
                } else if (g_strcmp0(show_console, "online") == 0) {
                    cons_show_contact_offline(contact, resource, status);
                }

                // show in chat win if "all"
                if (g_strcmp0(show_chat_win, "all") == 0) {
                    ui_chat_win_contact_offline(contact, resource, status);

                // show in char win if "online" and presence online
                } else if (g_strcmp0(show_chat_win, "online") == 0) {
                    ui_chat_win_contact_offline(contact, resource, status);
                }
            }
        }
        prefs_free_string(show_console);
        prefs_free_string(show_chat_win);
        jid_destroy(jid);
    }

    ui_roster();
}
开发者ID:fabianfreyer,项目名称:profanity,代码行数:39,代码来源:server_events.c


示例20: _connect_default

static void
_connect_default(const char * const account)
{
    if (account) {
        cmd_execute_connect(account);
    } else {
        char *pref_connect_account = prefs_get_string(PREF_CONNECT_ACCOUNT);
        if (pref_connect_account) {
            cmd_execute_connect(pref_connect_account);
            prefs_free_string(pref_connect_account);
        }
    }
}
开发者ID:leowzukw,项目名称:profanity,代码行数:13,代码来源:profanity.c



注:本文中的prefs_get_string函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ prefs_register_protocol函数代码示例发布时间:2022-05-30
下一篇:
C++ prefs_get_boolean函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap