changeset 30614:3a627563ca71

merge of '74a81229c626a318447546176d5b27a0197a44a4' and 'baeaaf7de69d9f99b7545dda73f219292c4dd106'
author Daniel Atallah <daniel.atallah@gmail.com>
date Mon, 14 Jun 2010 22:09:50 +0000
parents d93865ec84d9 (diff) a414593d0a78 (current diff)
children 72d9caae4406
files
diffstat 3 files changed, 69 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Jun 14 22:09:12 2010 +0000
+++ b/ChangeLog	Mon Jun 14 22:09:50 2010 +0000
@@ -15,6 +15,17 @@
 	* Allow connecting to servers that only advertise GSSAPI and expect
 	  a fallback to legacy IQ authentication (broken in 2.7.0).
 
+	Yahoo/Yahoo JAPAN:
+	* Renamed "Use account proxy for SSL connections" to "Use account proxy
+	  for HTTP and HTTPS requests" and tied the option to HTTP requests too.
+	* Properly detect HTTP proxy server use when the HTTP proxy is the global
+	  proxy server, an account-level non-HTTP proxy server is configured, and
+	  the "Use account proxy for HTTP and HTTPS requests" account option is
+	  turned off.  This fixes connecting for some HTTP proxy servers.
+	* Fall back to connecting to scsa.msg.yahoo.com (not configurable) if the
+	  HTTP-based connect server lookup fails.  This does not work for Yahoo
+	  JAPAN accounts.
+
 version 2.7.1 (05/29/2010):
 	General:
 	* Build fixes on OpenSolaris.  (Brian Lu)
--- a/libpurple/protocols/yahoo/libymsg.c	Mon Jun 14 22:09:12 2010 +0000
+++ b/libpurple/protocols/yahoo/libymsg.c	Mon Jun 14 22:09:50 2010 +0000
@@ -3594,7 +3594,8 @@
 	PurpleConnection *gc = yd->gc;
 	PurpleAccount *a = purple_connection_get_account(gc);
 	gchar **strings = NULL, *cs_server = NULL;
-	int port = 0, stringslen = 0;
+	int port = purple_account_get_int(a, "port", YAHOO_PAGER_PORT);
+	int stringslen = 0;
 
 	yd->url_datas = g_slist_remove(yd->url_datas, url_data);
 
@@ -3630,8 +3631,6 @@
 		}
 
 		if(cs_server) { /* got an address; get on with connecting */
-			port = purple_account_get_int(a, "port", YAHOO_PAGER_PORT);
-
 			if(purple_proxy_connect(gc, a, cs_server, port, yahoo_got_connected, gc) == NULL)
 				purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 								_("Unable to connect"));
@@ -3699,7 +3698,7 @@
 			proxy_ssl ? purple_connection_get_account(gc) : NULL,
 			yd->jp ? YAHOOJP_PAGER_HOST_REQ_URL : YAHOO_PAGER_HOST_REQ_URL,
 			use_whole_url ? TRUE : FALSE,
-			YAHOO_CLIENT_USERAGENT, TRUE, NULL, FALSE, -1,
+			YAHOO_CLIENT_USERAGENT, FALSE, NULL, FALSE, -1,
 			yahoo_got_pager_server, yd);
 	if (url_data)
 		yd->url_datas = g_slist_prepend(yd->url_datas, url_data);
--- a/libpurple/tests/test_util.c	Mon Jun 14 22:09:12 2010 +0000
+++ b/libpurple/tests/test_util.c	Mon Jun 14 22:09:50 2010 +0000
@@ -66,8 +66,57 @@
 }
 END_TEST
 
+/*
+ * Lists of valid and invalid email addresses comes from
+ * http://fightingforalostcause.net/misc/2006/compare-email-regex.php
+ */
+const char *valid_emails[] = {
+	"l3tt3rsAndNumb3rs@domain.com",
+	"has-dash@domain.com",
+	"hasApostrophe.o'leary@domain.org",
+	"uncommonTLD@domain.museum",
+	"uncommonTLD@domain.travel",
+	"uncommonTLD@domain.mobi",
+	"countryCodeTLD@domain.uk",
+	"countryCodeTLD@domain.rw",
+	"lettersInDomain@911.com",
+	"underscore_inLocal@domain.net",
+	"IPInsteadOfDomain@127.0.0.1",
+	/* "IPAndPort@127.0.0.1:25", */
+	"subdomain@sub.domain.com",
+	"local@dash-inDomain.com",
+	"dot.inLocal@foo.com",
+	"a@singleLetterLocal.org",
+	"singleLetterDomain@x.org",
+	"&*=?^+{}'~@validCharsInLocal.net",
+	"foor@bar.newTLD"
+};
+
+const char *invalid_emails[] = {
+	"missingDomain@.com",
+	"@missingLocal.org",
+	"missingatSign.net",
+	"missingDot@com",
+	"two@@signs.com",
+	"colonButNoPort@127.0.0.1:",
+	""
+	/* "someone-else@127.0.0.1.26", */
+	/* ".localStartsWithDot@domain.com", */
+	/* "localEndsWithDot.@domain.com", */
+	/* "two..consecutiveDots@domain.com", */
+	/* "domainStartsWithDash@-domain.com", */
+	"domainEndsWithDash@domain-.com",
+	/* "numbersInTLD@domain.c0m", */
+	/* "missingTLD@domain.", */
+	"! \"#$%(),/;<>[]`|@invalidCharsInLocal.org",
+	"invalidCharsInDomain@! \"#$%(),/;<>_[]`|.org",
+	/* "local@SecondLevelDomainNamesAreInvalidIfTheyAreLongerThan64Charactersss.org" */
+};
+
 START_TEST(test_util_email_is_valid)
 {
+	size_t i;
+
 	fail_unless(purple_email_is_valid("purple-devel@lists.sf.net"));
 	fail_if(purple_email_is_valid("purple-devel@@lists.sf.net"));
 	fail_if(purple_email_is_valid("purple@devel@lists.sf.net"));
@@ -77,6 +126,12 @@
 	fail_if(purple_email_is_valid("@lists.sf.net"));
 	fail_if(purple_email_is_valid(""));
 	fail_if(purple_email_is_valid("totally bogus"));
+
+	for (i = 0; i < G_N_ELEMENTS(valid_emails); i++)
+		fail_unless(purple_email_is_valid(valid_emails[i]), "Email address was: %s", valid_emails[i]);
+
+	for (i = 0; i < G_N_ELEMENTS(invalid_emails); i++)
+		fail_if(purple_email_is_valid(invalid_emails[i]), "Email address was: %s", invalid_emails[i]);
 }
 END_TEST