changeset 22332:7253669b9fcd

merge of '26a24e2e90db8354c4d854df5f8e833e3d1086e3' and '74acb668a62f5239d2e322a212e4d9f1302c035a'
author John Bailey <rekkanoryo@rekkanoryo.org>
date Sun, 24 Feb 2008 18:33:00 +0000
parents ee7f81391b45 (current diff) 2a7012d148dd (diff)
children 9d02eb04f406
files
diffstat 6 files changed, 42 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/COPYRIGHT	Sun Feb 24 18:30:33 2008 +0000
+++ b/COPYRIGHT	Sun Feb 24 18:33:00 2008 +0000
@@ -154,6 +154,7 @@
 Konrad Gräfe
 Miah Gregory
 David Grohmann
+Gideon N. Guillen
 Christian Hammond
 Erick Hamness
 Fred Hampton
--- a/ChangeLog	Sun Feb 24 18:30:33 2008 +0000
+++ b/ChangeLog	Sun Feb 24 18:33:00 2008 +0000
@@ -10,12 +10,15 @@
 	* Partial support for viewing ICQ status notes (Collin from
 	  ComBOTS GmbH).
 	* Support for /notice on IRC.
-	* Support for Yahoo Messenger 7.0+ file transfer method (Thanumalayan S.)
+	* Support for Yahoo! Messenger 7.0+ file transfer method (Thanumalayan S.)
 	* Support for retrieving full names and addresses from the address book
 	  on Yahoo! Japan (Yusuke Odate)
 	* The AIM/ICQ server-side preference for "allow others to see me
 	  as idle" is no longer unconditionally set to "yes" even when
 	  your libpurple preference is "no."
+	* Fixed retrieval of buddy icons and setting of server-side aliases on
+	  Yahoo! and Yahoo! Japan when using an HTTP proxy server (Gideon N.
+	  Guillen)
 
 	Pidgin:
 	* Added the ability to theme conversation name colors (red and blue)
--- a/libpurple/protocols/yahoo/yahoo.c	Sun Feb 24 18:30:33 2008 +0000
+++ b/libpurple/protocols/yahoo/yahoo.c	Sun Feb 24 18:33:00 2008 +0000
@@ -3509,8 +3509,13 @@
 		"Host: login.yahoo.com\r\n"
 		"Content-Length: 0\r\n\r\n",
 		yd->cookie_t, yd->cookie_y);
-
-	url_data = purple_util_fetch_url_request(base_url, FALSE,
+	gboolean use_whole_url = FALSE;
+
+	/* use whole URL if using HTTP Proxy */
+	if ((gc->account->proxy_info) && (gc->account->proxy_info->type == PURPLE_PROXY_HTTP))
+	    use_whole_url = TRUE;
+
+	url_data = purple_util_fetch_url_request(base_url, use_whole_url,
 			"Mozilla/4.0 (compatible; MSIE 5.5)", TRUE, request, FALSE,
 			yahoo_get_inbox_token_cb, gc);
 
--- a/libpurple/protocols/yahoo/yahoo_aliases.c	Sun Feb 24 18:30:33 2008 +0000
+++ b/libpurple/protocols/yahoo/yahoo_aliases.c	Sun Feb 24 18:33:00 2008 +0000
@@ -148,6 +148,12 @@
 	char *request, *webpage, *webaddress;
 	PurpleUtilFetchUrlData *url_data;
 
+	gboolean use_whole_url = FALSE;
+
+	/* use whole URL if using HTTP Proxy */
+	if ((gc->account->proxy_info) && (gc->account->proxy_info->type == PURPLE_PROXY_HTTP))
+	    use_whole_url = TRUE;
+
 	/* Using callback_data so I have access to gc in the callback function */
 	cb = g_new0(struct callback_data, 1);
 	cb->gc = gc;
@@ -155,15 +161,15 @@
 	/*  Build all the info to make the web request */
 	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 HTTP/1.1\r\n"
+	request = g_strdup_printf("GET %s%s/%s HTTP/1.1\r\n"
 				 "User-Agent: Mozilla/4.0 (compatible; MSIE 5.5)\r\n"
 				 "Cookie: T=%s; Y=%s\r\n"
 				 "Host: %s\r\n"
 				 "Cache-Control: no-cache\r\n\r\n",
-				 webpage, yd->cookie_t,yd->cookie_y, webaddress);
+				  use_whole_url ? "http://" : "", use_whole_url ? webaddress : "", webpage, yd->cookie_t,yd->cookie_y, webaddress);
 
 	/* We have a URL and some header information, let's connect and get some aliases  */
-	url_data = purple_util_fetch_url_request(url, FALSE, NULL, TRUE, request, FALSE, yahoo_fetch_aliases_cb, cb);
+	url_data = purple_util_fetch_url_request(url, use_whole_url, NULL, TRUE, request, FALSE, yahoo_fetch_aliases_cb, cb);
 	if (url_data != NULL) {
 		yd->url_datas = g_slist_prepend(yd->url_datas, url_data);
 	}
@@ -232,6 +238,11 @@
 	struct callback_data *cb;
 	PurpleBuddy *buddy;
 	PurpleUtilFetchUrlData *url_data;
+	gboolean use_whole_url = FALSE;
+
+	/* use whole URL if using HTTP Proxy */
+	if ((gc->account->proxy_info) && (gc->account->proxy_info->type == PURPLE_PROXY_HTTP))
+	    use_whole_url = TRUE;
 
 	g_return_if_fail(alias != NULL);
 	g_return_if_fail(who != NULL);
@@ -274,18 +285,18 @@
 		g_free(escaped_alias);
 	}
 
-	request = g_strdup_printf("POST /%s HTTP/1.1\r\n"
+	request = g_strdup_printf("POST %s%s/%s HTTP/1.1\r\n"
 				  "User-Agent: Mozilla/4.0 (compatible; MSIE 5.5)\r\n"
 				  "Cookie: T=%s; Y=%s\r\n"
 				  "Host: %s\r\n"
 				  "Content-Length: %" G_GSIZE_FORMAT "\r\n"
 				  "Cache-Control: no-cache\r\n\r\n"
 				  "%s",
-				  webpage, yd->cookie_t,yd->cookie_y, webaddress,
+				  use_whole_url ? "http://" : "", use_whole_url ? webaddress : "", webpage, yd->cookie_t,yd->cookie_y, webaddress,
 			 	  strlen(content), content);
 
 	/* We have a URL and some header information, let's connect and update the alias  */
-	url_data = purple_util_fetch_url_request(url, FALSE, NULL, TRUE, request, FALSE, yahoo_update_alias_cb, cb);
+	url_data = purple_util_fetch_url_request(url, use_whole_url, NULL, TRUE, request, FALSE, yahoo_update_alias_cb, cb);
 	if (url_data != NULL) {
 		yd->url_datas = g_slist_prepend(yd->url_datas, url_data);
 	}
--- a/libpurple/protocols/yahoo/yahoo_picture.c	Sun Feb 24 18:30:33 2008 +0000
+++ b/libpurple/protocols/yahoo/yahoo_picture.c	Sun Feb 24 18:33:00 2008 +0000
@@ -116,6 +116,11 @@
 		struct yahoo_fetch_picture_data *data;
 		PurpleBuddy *b = purple_find_buddy(gc->account, who);
 		const char *locksum = NULL;
+		gboolean use_whole_url = FALSE;
+
+		/* use whole URL if using HTTP Proxy */
+		if ((gc->account->proxy_info) && (gc->account->proxy_info->type == PURPLE_PROXY_HTTP))
+		    use_whole_url = TRUE;
 
 		/* FIXME: Cleanup this strtol() stuff if possible. */
 		if (b && (locksum = purple_buddy_icons_get_checksum_for_user(b)) != NULL && 
@@ -126,7 +131,7 @@
 		data->gc = gc;
 		data->who = g_strdup(who);
 		data->checksum = checksum;
-		url_data = purple_util_fetch_url(url, FALSE,
+		url_data = purple_util_fetch_url(url, use_whole_url,
 				"Mozilla/4.0 (compatible; MSIE 5.0)", FALSE,
 				yahoo_fetch_picture_cb, data);
 		if (url_data != NULL) {
--- a/libpurple/protocols/yahoo/yahoo_profile.c	Sun Feb 24 18:30:33 2008 +0000
+++ b/libpurple/protocols/yahoo/yahoo_profile.c	Sun Feb 24 18:33:00 2008 +0000
@@ -932,11 +932,17 @@
 	/* Try to put the photo in there too, if there's one */
 	if (photo_url_text) {
 		PurpleUtilFetchUrlData *url_data;
+		gboolean use_whole_url = FALSE;
+
+		/* use whole URL if using HTTP Proxy */
+		if ((info_data->gc->account->proxy_info) && (info_data->gc->account->proxy_info->type == PURPLE_PROXY_HTTP))
+		    use_whole_url = TRUE;
+
 		/* User-uploaded photos use a different server that requires the Host
 		 * header, but Yahoo Japan will use the "chunked" content encoding if
 		 * we specify HTTP 1.1. So we have to specify 1.0 & fix purple_util_fetch_url
 		 */
-		url_data = purple_util_fetch_url(photo_url_text, FALSE, NULL,
+		url_data = purple_util_fetch_url(photo_url_text, use_whole_url, NULL,
 				FALSE, yahoo_got_photo, info2_data);
 		if (url_data != NULL)
 			yd->url_datas = g_slist_prepend(yd->url_datas, url_data);