/pidgin/main: 5dd3e2938d7b: Official Yahoo! Messenger clients us...

unknown at rock.pidgin.im unknown at rock.pidgin.im
Sat Dec 1 14:08:30 EST 2012


Changeset: 5dd3e2938d7b722d99f4b01286c7fce432c8dd5d
Author:	 Catalin Salgau <unknown>
Date:	 2012-12-01 14:05 -0500
Branch:	 release-2.x.y
URL: http://hg.pidgin.im/pidgin/main/rev/5dd3e2938d7b

Description:

Official Yahoo! Messenger clients use a number of User Agent strings when
making its various HTTP and HTTPS connections to do things such as download
alias data and contact pictures.  Apparently the servers are now enforcing
that connecting clients use the correct User Agent string.  This patch makes
libpurple use the correct User Agent string when doing address book queries,
like getting buddy alias data.  Fixes #15381.

diffstat:

 COPYRIGHT                                 |  1 +
 libpurple/protocols/yahoo/libymsg.h       |  1 +
 libpurple/protocols/yahoo/yahoo_aliases.c |  8 ++++----
 3 files changed, 6 insertions(+), 4 deletions(-)

diffs (61 lines):

diff --git a/COPYRIGHT b/COPYRIGHT
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -456,6 +456,7 @@ Sam S.
 Thanumalayan S.
 Jonathan Sailor
 Elliott Sales de Andrade
+Catalin Salgau
 Tomasz Sałaciński <tsalacinski at gmail.com>
 Pradyumna Sampath
 Arvind Samptur
diff --git a/libpurple/protocols/yahoo/libymsg.h b/libpurple/protocols/yahoo/libymsg.h
--- a/libpurple/protocols/yahoo/libymsg.h
+++ b/libpurple/protocols/yahoo/libymsg.h
@@ -96,6 +96,7 @@
 #define YAHOOJP_CLIENT_VERSION "9.0.0.1727"
 
 #define YAHOO_CLIENT_USERAGENT "Mozilla/5.0"
+#define YAHOO_CLIENT_USERAGENT_ALIAS "Mozilla/4.0 (compatible; MSIE 5.5)"
 
 /* Index into attention types list. */
 #define YAHOO_BUZZ 0
diff --git a/libpurple/protocols/yahoo/yahoo_aliases.c b/libpurple/protocols/yahoo/yahoo_aliases.c
--- a/libpurple/protocols/yahoo/yahoo_aliases.c
+++ b/libpurple/protocols/yahoo/yahoo_aliases.c
@@ -198,7 +198,7 @@ yahoo_fetch_aliases(PurpleConnection *gc
 	url = yd->jp ? YAHOOJP_ALIAS_FETCH_URL : YAHOO_ALIAS_FETCH_URL;
 	purple_url_parse(url, &webaddress, NULL, &webpage, NULL, NULL);
 	request = g_strdup_printf("GET %s%s/%s HTTP/1.1\r\n"
-				 "User-Agent: " YAHOO_CLIENT_USERAGENT "\r\n"
+				 "User-Agent: " YAHOO_CLIENT_USERAGENT_ALIAS "\r\n"
 				 "Cookie: T=%s; Y=%s\r\n"
 				 "Host: %s\r\n"
 				 "Cache-Control: no-cache\r\n\r\n",
@@ -366,7 +366,7 @@ yahoo_update_alias(PurpleConnection *gc,
 	}
 
 	request = g_strdup_printf("POST %s%s/%s HTTP/1.1\r\n"
-				  "User-Agent: " YAHOO_CLIENT_USERAGENT "\r\n"
+				  "User-Agent: " YAHOO_CLIENT_USERAGENT_ALIAS "\r\n"
 				  "Cookie: T=%s; Y=%s\r\n"
 				  "Host: %s\r\n"
 				  "Content-Length: %" G_GSIZE_FORMAT "\r\n"
@@ -481,7 +481,7 @@ yahoo_set_userinfo_cb(PurpleConnection *
 	purple_url_parse(yd->jp ? YAHOOJP_USERINFO_URL : YAHOO_USERINFO_URL, &webaddress, NULL, &webpage, NULL, NULL);
 
 	request = g_strdup_printf("POST %s HTTP/1.1\r\n"
-				  "User-Agent: " YAHOO_CLIENT_USERAGENT "\r\n"
+				  "User-Agent: " YAHOO_CLIENT_USERAGENT_ALIAS "\r\n"
 				  "Cookie: T=%s; path=/; domain=.yahoo.com; Y=%s;\r\n"
 				  "Host: %s\r\n"
 				  "Content-Length: %d\r\n"
@@ -518,7 +518,7 @@ yahoo_set_userinfo_cb(PurpleConnection *
 #endif
 
 	url_data = purple_util_fetch_url_request_len_with_account(account, webaddress, FALSE,
-			YAHOO_CLIENT_USERAGENT, TRUE, request, FALSE, -1,
+			YAHOO_CLIENT_USERAGENT_ALIAS, TRUE, request, FALSE, -1,
 			yahoo_fetch_aliases_cb, gc);
 	if (url_data != NULL)
 		yd->url_datas = g_slist_prepend(yd->url_datas, url_data);



More information about the Commits mailing list