changeset 29990:1e959e5cb237

jabber: Better error message when no concordant SASL mechs This is much better than "Unknown Error". Closes #11924
author Paul Aurich <paul@darkrain42.org>
date Thu, 20 May 2010 19:11:48 +0000
parents 50086e9b1d49
children b78b5e7ffe82 1e9644d6c74a
files libpurple/protocols/jabber/auth_cyrus.c
diffstat 1 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/auth_cyrus.c	Thu May 20 18:57:09 2010 +0000
+++ b/libpurple/protocols/jabber/auth_cyrus.c	Thu May 20 19:11:48 2010 +0000
@@ -399,6 +399,7 @@
                    xmlnode **reply, char **error)
 {
 	xmlnode *mechnode;
+	JabberSaslState ret;
 
 	js->sasl_mechs = g_string_new("");
 
@@ -418,7 +419,16 @@
 	}
 
 	jabber_sasl_build_callbacks(js);
-	return jabber_auth_start_cyrus(js, reply, error);
+	ret = jabber_auth_start_cyrus(js, reply, error);
+
+	/*
+	 * Triggered if no overlap between server and client
+	 * supported mechanisms.
+	 */
+	if (ret == JABBER_SASL_STATE_FAIL && *error == NULL)
+		*error = g_strdup(_("No authentication mechanisms in common with server"));
+
+	return ret;
 }
 
 static JabberSaslState