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

C++ purple_account_get_string函数代码示例

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

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



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

示例1: twitter_get_subdir_from_base

const gchar    *twitter_option_search_api_subdir(PurpleAccount * account)
{
    if (!strcmp(purple_account_get_protocol_id(account), TWITTER_PROTOCOL_ID)) {
        return twitter_get_subdir_from_base(purple_account_get_string(account, TWITTER_PREF_SEARCH_API_BASE, TWITTER_PREF_SEARCH_API_BASE_DEFAULT));
    } else {
        return twitter_get_subdir_from_base(purple_account_get_string(account, TWITTER_PREF_SEARCH_API_BASE, STATUSNET_PREF_API_BASE_DEFAULT));
    }
}
开发者ID:FourthDr,项目名称:prpltwtr,代码行数:8,代码来源:prpltwtr_prefs.c


示例2: fb_data_load

gboolean
fb_data_load(FbData *fata)
{
	const gchar *str;
	FbDataPrivate *priv;
	FbId id;
	gboolean ret = TRUE;
	guint i;
	guint64 uint;
	GValue val = G_VALUE_INIT;
	PurpleAccount *acct;

	g_return_val_if_fail(FB_IS_DATA(fata), FALSE);
	priv = fata->priv;
	acct = purple_connection_get_account(priv->gc);

	for (i = 0; i < G_N_ELEMENTS(fb_props_strs); i++) {
		str = purple_account_get_string(acct, fb_props_strs[i], NULL);

		if (str == NULL) {
			ret = FALSE;
		}

		g_value_init(&val, G_TYPE_STRING);
		g_value_set_string(&val, str);
		g_object_set_property(G_OBJECT(priv->api), fb_props_strs[i],
		                      &val);
		g_value_unset(&val);
	}

	str = purple_account_get_string(acct, "mid", NULL);

	if (str != NULL) {
		uint = g_ascii_strtoull(str, NULL, 10);
		g_value_init(&val, G_TYPE_UINT64);
		g_value_set_uint64(&val, uint);
		g_object_set_property(G_OBJECT(priv->api), "mid", &val);
		g_value_unset(&val);
	} else {
		ret = FALSE;
	}

	str = purple_account_get_string(acct, "uid", NULL);

	if (str != NULL) {
		id = FB_ID_FROM_STR(str);
		g_value_init(&val, FB_TYPE_ID);
		g_value_set_int64(&val, id);
		g_object_set_property(G_OBJECT(priv->api), "uid", &val);
		g_value_unset(&val);
	} else {
		ret = FALSE;
	}

	fb_api_rehash(priv->api);
	return ret;
}
开发者ID:duxet,项目名称:adium-facebook,代码行数:57,代码来源:data.c


示例3: purple_account_get_string

void IdenticaProtocol::onDestroy(User *user) {
	PurpleAccount *account = user->account();
	if (account == NULL)
		return;
	user->updateSetting<std::string>("twitter_oauth_secret", purple_account_get_string(account, "twitter_oauth_secret", ""));
	user->updateSetting<std::string>("twitter_oauth_token", purple_account_get_string(account, "twitter_oauth_token", ""));
	user->updateSetting<std::string>("twitter_sent_msg_ids", purple_account_get_string(account, "twitter_sent_msg_ids", ""));
	user->updateSetting<std::string>("twitter_last_msg_id", purple_account_get_string(account, "twitter_last_msg_id", ""));
}
开发者ID:Svedrin,项目名称:spectrum,代码行数:9,代码来源:identica.cpp


示例4: flist_update_server_status

void flist_update_server_status(FListAccount *fla) {
    JsonObject *json = json_object_new();
    const gchar *status = purple_account_get_string(fla->pa, "_status", "online");
    const gchar *status_message = purple_account_get_string(fla->pa, "_status_message", "");
    json_object_set_string_member(json, "status", status);
    json_object_set_string_member(json, "statusmsg", status_message);
    flist_request(fla->pc, FLIST_SET_STATUS, json);

    json_object_unref(json);
}
开发者ID:Laleila,项目名称:fchat-pidgin,代码行数:10,代码来源:f-list_status.c


示例5: do_login

static gboolean do_login(PurpleConnection *gc) {
	char *buf, *tmp = NULL;
	char hostname[256];
	const char *username, *realname;
	struct irc_conn *irc = gc->proto_data;
	const char *pass = purple_connection_get_password(gc);

	if (pass && *pass) {
		buf = irc_format(irc, "vv", "PASS", pass);
		if (irc_send(irc, buf) < 0) {
/*			purple_connection_error(gc, "Error sending password"); */
			g_free(buf);
			return FALSE;
		}
		g_free(buf);
	}


	gethostname(hostname, sizeof(hostname));
	hostname[sizeof(hostname) - 1] = '\0';
	realname = purple_account_get_string(irc->account, "realname", "");
	username = purple_account_get_string(irc->account, "username", "");

	if (username == NULL || *username == '\0') {
		username = g_get_user_name();
	}

	if (username != NULL && strchr(username, ' ') != NULL) {
		tmp = g_strdup(username);
		while ((buf = strchr(tmp, ' ')) != NULL) {
			*buf = '_';
		}
	}

	buf = irc_format(irc, "vvvv:", "USER", tmp ? tmp : username, hostname, irc->server,
			      strlen(realname) ? realname : IRC_DEFAULT_ALIAS);
	g_free(tmp);
	if (irc_send(irc, buf) < 0) {
/*		purple_connection_error(gc, "Error registering with server");*/
		g_free(buf);
		return FALSE;
	}
	g_free(buf);
	buf = irc_format(irc, "vn", "NICK", purple_connection_get_display_name(gc));
	if (irc_send(irc, buf) < 0) {
/*		purple_connection_error(gc, "Error sending nickname");*/
		g_free(buf);
		return FALSE;
	}
	g_free(buf);

	irc->recv_time = time(NULL);

	return TRUE;
}
开发者ID:arminius2,项目名称:apolloim,代码行数:55,代码来源:irc.c


示例6: g_tree_new

static GString *purple_fbapi_construct_request_vargs(PurpleAccount *account, const char *method, va_list args)
{
	GTree *params;
	const char *api_key, *api_secret;
	const char *key, *value;
	char call_id[21];
	char *signature;
	GString *body;

	/* Read all paramters into a sorted tree */
	params = g_tree_new((GCompareFunc)strcmp);
	while ((key = va_arg(args, const char *)) != NULL)
	{
		value = va_arg(args, const char *);
		g_tree_insert(params, (char *)key, (char *)value);

		/* If we have a session_key then we need a call_id */
		if (g_str_equal(key, "session_key")) {
			struct timeval tv;
			if (gettimeofday(&tv, NULL) != 0) {
				time_t now;
				purple_debug_error("fbapi",
						"Error calling gettimeofday(): %s\n",
						g_strerror(errno));
				now = time(NULL);
				strftime(call_id, sizeof(call_id), "%s000000", localtime(&now));
			} else {
				char tmp[22];
				strftime(tmp, sizeof(tmp), "%s", localtime(&tv.tv_sec));
				sprintf(call_id, "%s%06lu", tmp, (long unsigned int)tv.tv_usec);
			}
			g_tree_insert(params, "call_id", call_id);
		}
	}

	api_key = purple_account_get_string(account, "fb_api_key", PURPLE_FBAPI_KEY);
	api_secret = purple_account_get_string(account, "fb_api_secret", API_SECRET);

	/* Add the method and api_key parameters to the list */
	g_tree_insert(params, "method", (char *)method);
	g_tree_insert(params, "api_key", (char *)api_key);

	/* Add the signature parameter to the list */
	signature = generate_signature((char *)api_secret, params);
	g_tree_insert(params, "sig", signature);

	/* Construct the body of the HTTP POST request */
	body = g_string_new(NULL);
	g_tree_foreach(params, append_params_to_body, body);
	g_tree_destroy(params);
	g_free(signature);

	return body;
}
开发者ID:hellais,项目名称:Adium-old,代码行数:54,代码来源:fbapi.c


示例7: waprpl_login

static void waprpl_login(PurpleAccount * acct)
{
	PurpleConnection *gc = purple_account_get_connection(acct);

	purple_debug_info(WHATSAPP_ID, "logging in %s\n", purple_account_get_username(acct));

	purple_connection_update_progress(gc, "Connecting", 0, 4);

	whatsapp_connection *wconn = g_new0(whatsapp_connection, 1);
	wconn->fd = -1;
	wconn->sslfd = -1;
	wconn->account = acct;
	wconn->rh = 0;
	wconn->wh = 0;
	wconn->timer = 0;
	wconn->connected = 0;
	wconn->conv_id = 1;
	wconn->gsc = 0;
	wconn->sslrh = 0;
	wconn->sslwh = 0;

	const char *username = purple_account_get_username(acct);
	const char *password = purple_account_get_password(acct);
	const char *nickname = purple_account_get_string(acct, "nick", "");

	wconn->waAPI = waAPI_create(username, password, nickname);
	purple_connection_set_protocol_data(gc, wconn);

	const char *hostname = purple_account_get_string(acct, "server", "");
	int port = purple_account_get_int(acct, "port", WHATSAPP_DEFAULT_PORT);

	char hn[256];
	if (strlen(hostname) == 0) {
		sprintf(hn, "e%d.whatsapp.net", rand() % 9 + 1);
		hostname = hn;
	}

	if (purple_proxy_connect(gc, acct, hostname, port, waprpl_connect_cb, gc) == NULL) {
		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, "Unable to connect");
	}

	static int sig_con = 0;
	if (!sig_con) {
		sig_con = 1;
		purple_signal_connect(purple_blist_get_handle(), "blist-node-removed", _whatsapp_protocol, PURPLE_CALLBACK(waprpl_blist_node_removed), NULL);
		purple_signal_connect(purple_blist_get_handle(), "blist-node-added", _whatsapp_protocol, PURPLE_CALLBACK(waprpl_blist_node_added), NULL);
	}
}
开发者ID:jab15pm,项目名称:whatsapp-purple,代码行数:48,代码来源:wa_purple.c


示例8: purple_buddy_icons_set_account_icon

PurpleStoredImage *
purple_buddy_icons_set_account_icon(PurpleAccount *account,
                                    guchar *icon_data, size_t icon_len)
{
	PurpleStoredImage *old_img;
	PurpleStoredImage *img = NULL;
	char *old_icon;

	if (icon_data != NULL && icon_len > 0)
	{
		img = purple_buddy_icon_data_new(icon_data, icon_len, NULL);
	}

	old_icon = g_strdup(purple_account_get_string(account, "buddy_icon", NULL));
	if (img && purple_buddy_icons_is_caching())
	{
		const char *filename = purple_imgstore_get_filename(img);
		purple_account_set_string(account, "buddy_icon", filename);
		purple_account_set_int(account, "buddy_icon_timestamp", time(NULL));
		ref_filename(filename);
	}
	else
	{
		purple_account_set_string(account, "buddy_icon", NULL);
		purple_account_set_int(account, "buddy_icon_timestamp", 0);
	}
	unref_filename(old_icon);

	old_img = g_hash_table_lookup(pointer_icon_cache, account);

	if (img)
		g_hash_table_insert(pointer_icon_cache, account, img);
	else
		g_hash_table_remove(pointer_icon_cache, account);

	if (purple_account_is_connected(account))
	{
		PurpleConnection *gc;
		PurplePluginProtocolInfo *prpl_info;

		gc = purple_account_get_connection(account);
		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc));

		if (prpl_info && prpl_info->set_buddy_icon)
			prpl_info->set_buddy_icon(gc, img);
	}

	if (old_img)
		purple_imgstore_unref(old_img);
	else if (old_icon)
	{
		/* The old icon may not have been loaded into memory.  In that
		 * case, we'll need to uncache the filename.  The filenames
		 * are ref-counted, so this is safe. */
		purple_buddy_icon_data_uncache_file(old_icon);
	}
	g_free(old_icon);

	return img;
}
开发者ID:CkNoSFeRaTU,项目名称:pidgin,代码行数:60,代码来源:buddyicon.c


示例9: purple_buddy_icons_find_account_icon

PurpleStoredImage *
purple_buddy_icons_find_account_icon(PurpleAccount *account)
{
	PurpleStoredImage *img;
	const char *account_icon_file;
	const char *dirname;
	char *path;
	guchar *data;
	size_t len;

	g_return_val_if_fail(account != NULL, NULL);

	if ((img = g_hash_table_lookup(pointer_icon_cache, account)))
	{
		return purple_imgstore_ref(img);
	}

	account_icon_file = purple_account_get_string(account, "buddy_icon", NULL);

	if (account_icon_file == NULL)
		return NULL;

	dirname = purple_buddy_icons_get_cache_dir();
	path = g_build_filename(dirname, account_icon_file, NULL);

	if (read_icon_file(path, &data, &len))
	{
		g_free(path);
		img = purple_buddy_icons_set_account_icon(account, data, len);
		return purple_imgstore_ref(img);
	}
	g_free(path);

	return NULL;
}
开发者ID:CkNoSFeRaTU,项目名称:pidgin,代码行数:35,代码来源:buddyicon.c


示例10: silcpurple_idle_set

void silcpurple_idle_set(PurpleConnection *gc, int idle)

{
	SilcPurple sg;
	SilcClient client;
	SilcClientConnection conn;
	SilcAttributeObjService service;
	const char *server;
	int port;

	sg = gc->proto_data;
	if (sg == NULL)
		return;

	client = sg->client;
	if (client == NULL)
		return;

	conn = sg->conn;
	if (conn == NULL)
		return;

	server = purple_account_get_string(sg->account, "server",
					 "silc.silcnet.org");
	port = purple_account_get_int(sg->account, "port", 706),

	memset(&service, 0, sizeof(service));
	silc_client_attribute_del(client, conn,
				  SILC_ATTRIBUTE_SERVICE, NULL);
	service.port = port;
	g_snprintf(service.address, sizeof(service.address), "%s", server);
	service.idle = idle;
	silc_client_attribute_add(client, conn, SILC_ATTRIBUTE_SERVICE,
				  &service, sizeof(service));
}
开发者ID:dylex,项目名称:pidgin,代码行数:35,代码来源:buddy.c


示例11: waprpl_send_chat

static int waprpl_send_chat(PurpleConnection * gc, int id, const char *message, PurpleMessageFlags flags)
{
	whatsapp_connection *wconn = purple_connection_get_protocol_data(gc);
	PurpleAccount *account = purple_connection_get_account(gc);
	PurpleConversation *convo = purple_find_chat(gc, id);
	PurpleChat *ch = blist_find_chat_by_convo(gc, id);
	GHashTable *hasht = purple_chat_get_components(ch);
	char *chat_id = g_hash_table_lookup(hasht, "id");
	char *plain;

	purple_markup_html_to_xhtml(message, NULL, &plain);

	char msgid[128];
	waAPI_getmsgid(wconn->waAPI, msgid);

	purple_signal_emit(purple_connection_get_prpl(gc), "whatsapp-sending-message", gc, msgid, chat_id, message);

	waAPI_sendchat(wconn->waAPI, msgid, chat_id, plain);
	g_free(plain);

	waprpl_check_output(gc);

	const char *me = purple_account_get_string(account, "nick", "");
	purple_conv_chat_write(PURPLE_CONV_CHAT(convo), me, message, PURPLE_MESSAGE_SEND, time(NULL));

	return 1;
}
开发者ID:jab15pm,项目名称:whatsapp-purple,代码行数:27,代码来源:wa_purple.c


示例12: account

AccountWindow::StringListOption::StringListOption(PurpleAccount *account_,
    PurpleAccountOption *option_)
: account(account_), option(option_)
{
  g_assert(account);
  g_assert(option);

  setText(purple_account_option_get_text(option));

  const char *def = purple_account_get_string(account,
      purple_account_option_get_setting(option),
      purple_account_option_get_default_list_value(option));
  for (GList *l = purple_account_option_get_list(option); l; l = l->next)
    if (l->data) {
      PurpleKeyValuePair *kvp = reinterpret_cast<PurpleKeyValuePair*>(
          l->data);
      addOptionPtr(kvp->key, kvp->value);
      if (kvp->value && def
          && !strcmp(def, reinterpret_cast<const char*>(kvp->value)))
        setSelectedByDataPtr(kvp->value);
    }

  signal_selection_changed.connect(sigc::mem_fun(this,
        &StringListOption::onSelectionChanged));
}
开发者ID:jonyamo,项目名称:centerim5,代码行数:25,代码来源:AccountWindow.cpp


示例13: purple_account_get_string

static char *gaym_send_convert(struct gaym_conn *gaym, const char *string)
{
    char *utf8;
    GError *err = NULL;
    const gchar *charset;

    charset =
        purple_account_get_string(gaym->account, "encoding",
                                IRC_DEFAULT_CHARSET);
    if (!strcasecmp("UTF-8", charset))
        return g_strdup(string);

    utf8 =
        g_convert(string, strlen(string), charset, "UTF-8", NULL, NULL,
                  &err);
    if (err) {
        purple_debug(PURPLE_DEBUG_ERROR, "gaym", "Send conversion error: %s\n",
                   err->message);
        purple_debug(PURPLE_DEBUG_ERROR, "gaym",
                   "Sending as UTF-8 instead of %s\n", charset);
        utf8 = g_strdup(string);
        g_error_free(err);
    }

    return utf8;
}
开发者ID:BackupTheBerlios,项目名称:qrc-svn,代码行数:26,代码来源:parse.c


示例14: get_string_setting

static VALUE get_string_setting(VALUE self, VALUE name, VALUE default_value)
{
  PurpleAccount *account;
  Data_Get_Struct(self, PurpleAccount, account);
  const char* value = purple_account_get_string(account, RSTRING_PTR(name), RSTRING_PTR(default_value));
  return (NULL == value) ? Qnil : rb_str_new2(value);
}
开发者ID:strelok1111,项目名称:purple_ruby,代码行数:7,代码来源:purple_ruby.c


示例15: purple_account_get_string

static char *irc_send_convert(struct irc_conn *irc, const char *string)
{
	char *utf8;
	GError *err = NULL;
	gchar **encodings;
	const gchar *enclist;

	enclist = purple_account_get_string(irc->account, "encoding", IRC_DEFAULT_CHARSET);
	encodings = g_strsplit(enclist, ",", 2);

	if (encodings[0] == NULL || !g_ascii_strcasecmp("UTF-8", encodings[0])) {
		g_strfreev(encodings);
		return NULL;
	}

	utf8 = g_convert(string, strlen(string), encodings[0], "UTF-8", NULL, NULL, &err);
	if (err) {
		purple_debug(PURPLE_DEBUG_ERROR, "irc", "Send conversion error: %s\n", err->message);
		purple_debug(PURPLE_DEBUG_ERROR, "irc", "Sending as UTF-8 instead of %s\n", encodings[0]);
		utf8 = g_strdup(string);
		g_error_free(err);
	}
	g_strfreev(encodings);

	return utf8;
}
开发者ID:bf4,项目名称:pidgin-mac,代码行数:26,代码来源:parse.c


示例16: server_list_create

static void server_list_create(PurpleAccount *account)
{
	PurpleConnection *gc;
	qq_data *qd;
	const gchar *custom_server;

	gc = purple_account_get_connection(account);
	g_return_if_fail(gc != NULL  && gc->proto_data != NULL);
	qd = gc->proto_data;

	qd->use_tcp = purple_account_get_bool(account, "use_tcp", TRUE);

	custom_server = purple_account_get_string(account, "server", NULL);

	if (custom_server != NULL) {
		purple_debug_info("QQ", "Select server '%s'\n", custom_server);
		if (*custom_server != '\0' && g_ascii_strcasecmp(custom_server, "auto") != 0) {
			qd->servers = g_list_append(qd->servers, g_strdup(custom_server));
			return;
		}
	}

	if (qd->use_tcp) {
		qd->servers =	server_list_build('T');
		return;
	}

	qd->servers =	server_list_build('U');
}
开发者ID:anchowee,项目名称:AdiumQQ,代码行数:29,代码来源:qq.c


示例17: yahoo_xfer_init

static void yahoo_xfer_init(PurpleXfer *xfer)
{
	struct yahoo_xfer_data *xfer_data;
	PurpleConnection *gc;
	PurpleAccount *account;
	struct yahoo_data *yd;

	xfer_data = xfer->data;
	gc = xfer_data->gc;
	yd = gc->proto_data;
	account = purple_connection_get_account(gc);

	if (purple_xfer_get_type(xfer) == PURPLE_XFER_SEND) {
		if (yd->jp) {
			if (purple_proxy_connect(NULL, account, purple_account_get_string(account, "xferjp_host",  YAHOOJP_XFER_HOST),
			                       purple_account_get_int(account, "xfer_port", YAHOO_XFER_PORT),
			                       yahoo_sendfile_connected, xfer) == NULL)
			{
				purple_notify_error(gc, NULL, _("File Transfer Failed"),
				                _("Unable to establish file descriptor."));
				purple_xfer_cancel_remote(xfer);
			}
		} else {
			if (purple_proxy_connect(NULL, account, purple_account_get_string(account, "xfer_host",  YAHOO_XFER_HOST),
			                       purple_account_get_int(account, "xfer_port", YAHOO_XFER_PORT),
			                       yahoo_sendfile_connected, xfer) == NULL)
			{
				purple_notify_error(gc, NULL, _("File Transfer Failed"),
				                _("Unable to establish file descriptor."));
				purple_xfer_cancel_remote(xfer);
			}
		}
	} else {
		/* TODO: Using xfer->fd like this is probably a bad thing... */
		if (purple_proxy_connect(NULL, account, xfer_data->host, xfer_data->port,
		                              yahoo_receivefile_connected, xfer) == NULL)
			xfer->fd = -1;
		else
			xfer->fd = 0;
		if (xfer->fd == -1) {
			purple_notify_error(gc, NULL, _("File Transfer Failed"),
			             _("Unable to establish file descriptor."));
			purple_xfer_cancel_remote(xfer);
		}
	}
}
开发者ID:arminius2,项目名称:apolloim,代码行数:46,代码来源:yahoo_filexfer.c


示例18: jabber_auth_start_old

void jabber_auth_start_old(JabberStream *js)
{
	PurpleAccount *account;
	JabberIq *iq;
	PurpleXmlNode *query, *username;

	account = purple_connection_get_account(js->gc);

	/*
	 * We can end up here without encryption if the server doesn't support
	 * <stream:features/> and we're not using old-style SSL.  If the user
	 * is requiring SSL/TLS, we need to enforce it.
	 */
	if (!jabber_stream_is_ssl(js) &&
			g_str_equal("require_tls",
				purple_account_get_string(account, "connection_security", JABBER_DEFAULT_REQUIRE_TLS))) {
		purple_connection_error(js->gc,
			PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR,
			_("You require encryption, but it is not available on this server."));
		return;
	}

	if (js->registration) {
		jabber_register_start(js);
		return;
	}

	/*
	 * IQ Auth doesn't have support for resource binding, so we need to pick a
	 * default resource so it will work properly.  jabberd14 throws an error and
	 * iChat server just fails silently.
	 */
	if (!js->user->resource || *js->user->resource == '\0') {
		g_free(js->user->resource);
		js->user->resource = g_strdup("Home");
	}

#ifdef HAVE_CYRUS_SASL
	/* If we have Cyrus SASL, then passwords will have been set
	 * to OPTIONAL for this protocol. So, we need to do our own
	 * password prompting here
	 */

	if (!purple_connection_get_password(js->gc)) {
		purple_account_request_password(account, G_CALLBACK(auth_old_pass_cb), G_CALLBACK(auth_no_pass_cb), js->gc);
		return;
	}
#endif
	iq = jabber_iq_new_query(js, JABBER_IQ_GET, "jabber:iq:auth");

	query = purple_xmlnode_get_child(iq->node, "query");
	username = purple_xmlnode_new_child(query, "username");
	purple_xmlnode_insert_data(username, js->user->node, -1);

	jabber_iq_set_callback(iq, auth_old_cb, NULL);

	jabber_iq_send(iq);
}
开发者ID:ArmoredPidgin,项目名称:pidgin-hardened,代码行数:58,代码来源:auth.c


示例19: mxit_create_object

/*------------------------------------------------------------------------
 * Create a new mxit session object
 *
 * @return The MXit session object
 */
static struct MXitSession* mxit_create_object( PurpleAccount* account )
{
	PurpleConnection*	con			= purple_account_get_connection( account );
	struct MXitSession*	session		= NULL;

	/* currently the wapsite does not handle a '+' in front of the username (mxitid) so we just strip it */
	{
		const char* username	= purple_account_get_username( account );

		if ( username[0] == '+' ) {
			char* fixed = g_strdup( &username[1] );
			purple_account_set_username( account, fixed );
			g_free( fixed );
		}
	}

	session = g_new0( struct MXitSession, 1 );
	session->con = con;
	session->acc = account;

	/* configure the connection (reference: "libpurple/connection.h") */
	purple_connection_set_protocol_data( con, session );
	purple_connection_set_flags( con,
			  PURPLE_CONNECTION_FLAG_NO_BGCOLOR
			| PURPLE_CONNECTION_FLAG_NO_URLDESC
			| PURPLE_CONNECTION_FLAG_HTML
			| PURPLE_CONNECTION_FLAG_SUPPORT_MOODS
	);

	/* configure the session (reference: "libpurple/account.h") */
	g_strlcpy( session->server, purple_account_get_string( account, MXIT_CONFIG_SERVER_ADDR, DEFAULT_SERVER ), sizeof( session->server ) );
	g_strlcpy( session->http_server, purple_account_get_string( account, MXIT_CONFIG_HTTPSERVER, DEFAULT_HTTP_SERVER ), sizeof( session->http_server ) );
	session->port = purple_account_get_int( account, MXIT_CONFIG_SERVER_PORT, DEFAULT_PORT );
	g_strlcpy( session->distcode, purple_account_get_string( account, MXIT_CONFIG_DISTCODE, "" ), sizeof( session->distcode ) );
	g_strlcpy( session->clientkey, purple_account_get_string( account, MXIT_CONFIG_CLIENTKEY, "" ), sizeof( session->clientkey ) );
	g_strlcpy( session->dialcode, purple_account_get_string( account, MXIT_CONFIG_DIALCODE, "" ), sizeof( session->dialcode ) );
	session->http = purple_account_get_bool( account, MXIT_CONFIG_USE_HTTP, FALSE );
	session->iimages = g_hash_table_new( g_str_hash, g_str_equal );
	session->rx_state = RX_STATE_RLEN;
	session->http_interval = MXIT_HTTP_POLL_MIN;
	session->http_last_poll = mxit_now_milli();
	session->async_http_reqs = purple_http_connection_set_new();

	return session;
}
开发者ID:Distrotech,项目名称:pidgin,代码行数:50,代码来源:login.c


示例20: prp_cmd

static void
prp_cmd (MsnCmdProc *cmdproc,
         MsnCommand *cmd)
{
    MsnSession *session = cmdproc->session;
    const gchar *type, *value;
    struct pn_contact *user;

    type  = cmd->params[0];
    value = cmd->params[1];
    user = msn_session_get_contact (session);

    if (cmd->param_count == 2)
    {
        gchar *tmp;
        tmp = pn_url_decode (value);
        if (strcmp (type, "PHH") == 0)
            pn_contact_set_home_phone (user, tmp);
        else if (strcmp (type, "PHW") == 0)
            pn_contact_set_work_phone (user, tmp);
        else if (strcmp (type, "PHM") == 0)
            pn_contact_set_mobile_phone (user, tmp);
        else if (strcmp (type, "MFN") == 0)
        {
            PurpleAccount *account;
            PurpleConnection *connection;
            const gchar* friendly_name;
            account = msn_session_get_user_data (session);
            connection = purple_account_get_connection (account);

            friendly_name = purple_account_get_string (account, "friendly_name", NULL);

            /*
             * The server doesn't seem to store the friendly name anymore,
             * store it in account opts.
             */
            if (friendly_name)
                msn_session_set_public_alias (session, friendly_name);
            else
                purple_account_set_string (account, "friendly_name", tmp);

            purple_connection_set_display_name (connection, friendly_name);
        }
        g_free (tmp);
    }
    else
    {
        if (strcmp (type, "PHH") == 0)
            pn_contact_set_home_phone (user, NULL);
        else if (strcmp (type, "PHW") == 0)
            pn_contact_set_work_phone (user, NULL);
        else if (strcmp (type, "PHM") == 0)
            pn_contact_set_mobile_phone (user, NULL);
    }
}
开发者ID:allanfreitas,项目名称:msn-pecan,代码行数:55,代码来源:sync.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ purple_account_get_username函数代码示例发布时间:2022-05-30
下一篇:
C++ purple_account_get_protocol_id函数代码示例发布时间: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