diff libpurple/protocols/jabber/auth.c @ 28662:4b3756ed1053

merged with im.pidgin.pidgin
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Fri, 25 Sep 2009 14:32:16 +0900
parents fa77b70c8ca6
children fa7f3426ed13
line wrap: on
line diff
--- a/libpurple/protocols/jabber/auth.c	Thu Sep 24 16:02:36 2009 +0900
+++ b/libpurple/protocols/jabber/auth.c	Fri Sep 25 14:32:16 2009 +0900
@@ -692,7 +692,8 @@
 	JabberIq *iq;
 	xmlnode *query, *username;
 
-	/* We can end up here without encryption if the server doesn't support
+	/*
+	 * We can end up here without encryption if the server doesn't support
 	 * <stream:features/> and we're not using old-style SSL.  If the user
 	 * is requiring SSL/TLS, we need to enforce it.
 	 */
@@ -704,6 +705,16 @@
 		return;
 	}
 
+	/*
+	 * IQ Auth doesn't have support for resource binding, so we need to pick a
+	 * default resource so it will work properly.  jabberd14 throws an error and
+	 * iChat server just fails silently.
+	 */
+	if (!js->user->resource || *js->user->resource == '\0') {
+		g_free(js->user->resource);
+		js->user->resource = g_strdup("Home");
+	}
+
 #ifdef HAVE_CYRUS_SASL
 	/* If we have Cyrus SASL, then passwords will have been set
 	 * to OPTIONAL for this protocol. So, we need to do our own