changeset 20792:682543aced31

Split the "you don't have SSL support" meaning of PURPLE_REASON_ENCRYPTION_ERROR into a new reason, PURPLE_REASON_NO_SSL_SUPPORT. This will let UIs give proper errors that reference the SSLfaq!
author Will Thompson <will.thompson@collabora.co.uk>
date Sat, 06 Oct 2007 12:05:22 +0000
parents 0f607b50279c
children 88aa557b997f
files libpurple/connection.c libpurple/connection.h libpurple/protocols/irc/irc.c libpurple/protocols/jabber/auth.c libpurple/protocols/jabber/jabber.c libpurple/protocols/msn/msn.c libpurple/protocols/novell/novell.c
diffstat 7 files changed, 14 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/connection.c	Fri Oct 05 18:40:05 2007 +0000
+++ b/libpurple/connection.c	Sat Oct 06 12:05:22 2007 +0000
@@ -573,14 +573,12 @@
 		case PURPLE_REASON_CERT_OTHER_ERROR:
 			return FALSE;
 		case PURPLE_REASON_AUTHENTICATION_FAILED:
+		case PURPLE_REASON_NO_SSL_SUPPORT:
 		case PURPLE_REASON_ENCRYPTION_ERROR:
 		case PURPLE_REASON_NAME_IN_USE:
 		case PURPLE_REASON_INVALID_SETTINGS:
 		case PURPLE_REASON_OTHER_ERROR:
 			return TRUE;
-		default:
-			g_assert_not_reached ();
-			return TRUE;
 	}
 }
 
--- a/libpurple/connection.h	Fri Oct 05 18:40:05 2007 +0000
+++ b/libpurple/connection.h	Sat Oct 06 12:05:22 2007 +0000
@@ -70,8 +70,13 @@
 	 *  server offered.
 	 */
 	PURPLE_REASON_AUTHENTICATION_IMPOSSIBLE,
-	/** There was an error negotiating SSL on this connection, or encryption
-	 *  was unavailable and an account option was set to require it.
+	/** libpurple was built without SSL support, and the connection needs
+	 *  SSL.
+	 */
+	PURPLE_REASON_NO_SSL_SUPPORT,
+	/** There was an error negotiating SSL on this connection, or the
+	 *  server does not support encryption but an account option was set to
+	 *  require it.
 	 */
 	PURPLE_REASON_ENCRYPTION_ERROR,
 	/** Someone is already connected to the server using the name you are
--- a/libpurple/protocols/irc/irc.c	Fri Oct 05 18:40:05 2007 +0000
+++ b/libpurple/protocols/irc/irc.c	Sat Oct 06 12:05:22 2007 +0000
@@ -329,7 +329,7 @@
 					irc_login_cb_ssl, irc_ssl_connect_failure, gc);
 		} else {
 			gc->wants_to_die = TRUE;
-			purple_connection_error_reason (gc, PURPLE_REASON_ENCRYPTION_ERROR,
+			purple_connection_error_reason (gc, PURPLE_REASON_NO_SSL_SUPPORT,
 				_("SSL support unavailable"));
 			return;
 		}
--- a/libpurple/protocols/jabber/auth.c	Fri Oct 05 18:40:05 2007 +0000
+++ b/libpurple/protocols/jabber/auth.c	Sat Oct 06 12:05:22 2007 +0000
@@ -51,7 +51,7 @@
 			return TRUE;
 		} else if(xmlnode_get_child(starttls, "required")) {
 			js->gc->wants_to_die = TRUE;
-			purple_connection_error_reason (js->gc, PURPLE_REASON_ENCRYPTION_ERROR,
+			purple_connection_error_reason (js->gc, PURPLE_REASON_NO_SSL_SUPPORT,
 				_("Server requires TLS/SSL for login.  No TLS/SSL support found."));
 			return TRUE;
 		}
--- a/libpurple/protocols/jabber/jabber.c	Fri Oct 05 18:40:05 2007 +0000
+++ b/libpurple/protocols/jabber/jabber.c	Sat Oct 06 12:05:22 2007 +0000
@@ -628,7 +628,7 @@
 					jabber_ssl_connect_failure, js->gc);
 		} else {
 			js->gc->wants_to_die = TRUE;
-			purple_connection_error_reason (js->gc, PURPLE_REASON_ENCRYPTION_ERROR,
+			purple_connection_error_reason (js->gc, PURPLE_REASON_NO_SSL_SUPPORT,
 				_("SSL support unavailable"));
 		}
 	}
@@ -1117,7 +1117,7 @@
 					jabber_login_callback_ssl, jabber_ssl_connect_failure, gc);
 		} else {
 			gc->wants_to_die = TRUE;
-			purple_connection_error_reason (gc, PURPLE_REASON_ENCRYPTION_ERROR,
+			purple_connection_error_reason (gc, PURPLE_REASON_NO_SSL_SUPPORT,
 				_("SSL support unavailable"));
 		}
 	}
--- a/libpurple/protocols/msn/msn.c	Fri Oct 05 18:40:05 2007 +0000
+++ b/libpurple/protocols/msn/msn.c	Sat Oct 06 12:05:22 2007 +0000
@@ -800,7 +800,7 @@
 	if (!purple_ssl_is_supported())
 	{
 		gc->wants_to_die = TRUE;
-		purple_connection_error_reason (gc, PURPLE_REASON_ENCRYPTION_ERROR,
+		purple_connection_error_reason (gc, PURPLE_REASON_NO_SSL_SUPPORT,
 			_("SSL support is needed for MSN. Please install a supported "
 			  "SSL library."));
 		return;
--- a/libpurple/protocols/novell/novell.c	Fri Oct 05 18:40:05 2007 +0000
+++ b/libpurple/protocols/novell/novell.c	Sat Oct 06 12:05:22 2007 +0000
@@ -2209,7 +2209,7 @@
 		if (user->conn->ssl_conn->data == NULL) {
 			gc->wants_to_die = TRUE;
 			purple_connection_error_reason (gc,
-				PURPLE_REASON_ENCRYPTION_ERROR,
+				PURPLE_REASON_NO_SSL_SUPPORT,
 				_("Error. SSL support is not installed."));
 		}
 	}