im.pidgin.pidgin: 773c6dde93b5b2109d9c627dca717dd6c5468094

rekkanoryo at pidgin.im rekkanoryo at pidgin.im
Thu Jan 17 01:36:05 EST 2008


-----------------------------------------------------------------
Revision: 773c6dde93b5b2109d9c627dca717dd6c5468094
Ancestor: 947ccb889812585e6d53eac13fc12734d8481e33
Author: rekkanoryo at pidgin.im
Date: 2008-01-17T05:53:12
Branch: im.pidgin.pidgin

Modified files:
        libpurple/protocols/yahoo/util.c
        libpurple/protocols/yahoo/yahoo.h
        libpurple/protocols/yahoo/yahoo_aliases.c

ChangeLog: 

disapproval of revision '947ccb889812585e6d53eac13fc12734d8481e33'
-------------- next part --------------
============================================================
--- libpurple/protocols/yahoo/util.c	857b60dc62d7be89baa0c3703ec9fc0a9112e602
+++ libpurple/protocols/yahoo/util.c	78228f35e1c403abedb0df427c17eaef5d9d21dd
@@ -164,6 +164,20 @@ char *yahoo_string_decode(PurpleConnecti
 		return g_strdup("");
 }
 
+char *yahoo_convert_to_numeric(const char *str)
+{
+	char *retstr, buf[7];
+	const char *p;
+
+	retstr = (char*)malloc(strlen(str) * 6 + 1);
+	memset(retstr, 0x00, sizeof(retstr));
+	for (p = str; *p; p++) {
+		sprintf(buf, "&#%d;", (unsigned char)*p);
+		strcat(retstr, buf);
+	}
+	return retstr;
+}
+
 /*
  * I found these on some website but i don't know that they actually
  * work (or are supposed to work). I didn't implement them yet.
============================================================
--- libpurple/protocols/yahoo/yahoo.h	908634fe89ad4df26985215b10f04aa75b0c40a5
+++ libpurple/protocols/yahoo/yahoo.h	121ad9f8529b2ec369465de980f841ba4897ecc6
@@ -218,6 +218,8 @@ char *yahoo_string_decode(PurpleConnecti
  */
 char *yahoo_string_decode(PurpleConnection *gc, const char *str, gboolean utf8);
 
+char *yahoo_convert_to_numeric(const char *str);
+
 /* previously-static functions, now needed for yahoo_profile.c */
 void yahoo_tooltip_text(PurpleBuddy *b, PurpleNotifyUserInfo *user_info, gboolean full);
 
============================================================
--- libpurple/protocols/yahoo/yahoo_aliases.c	ff3872fa6cf34c8497ae82a5bd20f15c78dd99e7
+++ libpurple/protocols/yahoo/yahoo_aliases.c	da61ec40f8f8be27ba46f81df66d309c2e3abfde
@@ -226,17 +226,18 @@ yahoo_update_alias(PurpleConnection *gc,
 {
 	struct yahoo_data *yd;
 	struct YahooUser *yu;
-	char *content, *url, *request, *webpage, *webaddress, *strtmp, *alias_jp;
+	char *content, *url, *request, *webpage, *webaddress, *strtmp;
 	int inttmp;
 	struct callback_data *cb;
 	PurpleBuddy *buddy;
 	PurpleUtilFetchUrlData *url_data;
+	char *alias_jp, *converted_alias_jp;
 
 	g_return_if_fail(alias != NULL);
 	g_return_if_fail(who != NULL);
 	g_return_if_fail(gc != NULL);
 
-	purple_debug_info("yahoo", "Sending '%s' as new alias for user '%s'.\n", alias, who);
+	purple_debug_info("yahoo", "Sending '%s' as new alias for user '%s'.\n",alias, who);
 
 	buddy = purple_find_buddy(gc->account, who);
 	if (buddy == NULL || buddy->proto_data == NULL) {
@@ -253,15 +254,16 @@ yahoo_update_alias(PurpleConnection *gc,
 	cb->gc = gc;
 
 	/*  Build all the info to make the web request */
-	url = yd->jp ? YAHOOJP_ALIAS_UPDATE_URL : YAHOO_ALIAS_UPDATE_URL;
+	url = yd->jp? YAHOOJP_ALIAS_UPDATE_URL: YAHOO_ALIAS_UPDATE_URL;
 	purple_url_parse(url, &webaddress, &inttmp, &webpage, &strtmp, &strtmp);
 
 	if (yd->jp) {
 		alias_jp = g_convert(alias, strlen(alias), "EUC-JP", "UTF-8", NULL, NULL, NULL);
+		converted_alias_jp = yahoo_convert_to_numeric(alias_jp);
 		content = g_strdup_printf("<ab k=\"%s\" cc=\"1\">\n"
 		                          "<ct e=\"1\"  yi='%s' id='%s' nn='%s' pr='0' />\n</ab>\r\n",
-		                          gc->account->username, who, yu->id,
-								  g_markup_escape_text(alias_jp, strlen(alias_jp)));
+		                          gc->account->username, who, yu->id, converted_alias_jp);
+		free(converted_alias_jp);
 		g_free(alias_jp);
 	}
 	else {


More information about the Commits mailing list