changeset 30271:a54e59c1c520

jabber: Only add the ga:client-uses-full-bind-result to gmail/googlemail domains I think this should be okay, but admittedly it might cause issues. Anyway, the previous one definitely caused issues with Punjab, which fails to stringify the namespaced attributes.
author Paul Aurich <paul@darkrain42.org>
date Sat, 01 May 2010 16:37:07 +0000
parents 552616f49f94
children 4428b676c698 2829dd1cc118
files ChangeLog libpurple/protocols/jabber/auth_cyrus.c libpurple/protocols/jabber/auth_plain.c
diffstat 3 files changed, 15 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat May 01 05:53:50 2010 +0000
+++ b/ChangeLog	Sat May 01 16:37:07 2010 +0000
@@ -96,6 +96,11 @@
 	  minutes).  This fixes an issue with Openfire disconnecting a
 	  libpurple-baesd client that has just been quiet for about 6
 	  minutes.
+	* Only support Google Talk's JID Domain Discovery extension
+	  (allowing a user to log in with "@gmail.com" or "@googlemail.com"
+	  interchangeably) for those two domains.  This change was made
+	  due to interoperability issues with some BOSH Connection Managers
+	  and namespaced attributes.
 
 	Yahoo/Yahoo JAPAN:
 	* Attempt to better handle transparent proxies interfering with
--- a/libpurple/protocols/jabber/auth_cyrus.c	Sat May 01 05:53:50 2010 +0000
+++ b/libpurple/protocols/jabber/auth_cyrus.c	Sat May 01 16:37:07 2010 +0000
@@ -314,8 +314,11 @@
 		xmlnode_set_namespace(auth, NS_XMPP_SASL);
 		xmlnode_set_attrib(auth, "mechanism", js->current_mech);
 
-		xmlnode_set_attrib(auth, "xmlns:ga", "http://www.google.com/talk/protocol/auth");
-		xmlnode_set_attrib(auth, "ga:client-uses-full-bind-result", "true");
+		if (g_str_equal(js->user->domain, "gmail.com") ||
+				g_str_equal(js->user->domain, "googlemail.com")) {
+			xmlnode_set_attrib(auth, "xmlns:ga", "http://www.google.com/talk/protocol/auth");
+			xmlnode_set_attrib(auth, "ga:client-uses-full-bind-result", "true");
+		}
 
 		if (clientout) {
 			if (coutlen == 0) {
--- a/libpurple/protocols/jabber/auth_plain.c	Sat May 01 05:53:50 2010 +0000
+++ b/libpurple/protocols/jabber/auth_plain.c	Sat May 01 16:37:07 2010 +0000
@@ -40,8 +40,11 @@
 	auth = xmlnode_new("auth");
 	xmlnode_set_namespace(auth, NS_XMPP_SASL);
 
-	xmlnode_set_attrib(auth, "xmlns:ga", "http://www.google.com/talk/protocol/auth");
-	xmlnode_set_attrib(auth, "ga:client-uses-full-bind-result", "true");
+	if (g_str_equal(js->user->domain, "gmail.com") ||
+			g_str_equal(js->user->domain, "googlemail.com")) {
+		xmlnode_set_attrib(auth, "xmlns:ga", "http://www.google.com/talk/protocol/auth");
+		xmlnode_set_attrib(auth, "ga:client-uses-full-bind-result", "true");
+	}
 
 	response = g_string_new("");
 	response = g_string_append_len(response, "\0", 1);