im.pidgin.cpw.resiak.disconnectreason: 3516ccecadcfbdec8f617360f05f5c7f2aa1a7da

resiak at soc.pidgin.im resiak at soc.pidgin.im
Sun Oct 14 19:45:32 EDT 2007


-----------------------------------------------------------------
Revision: 3516ccecadcfbdec8f617360f05f5c7f2aa1a7da
Ancestor: b2e9a8ce6f5a4a868c5feda49eae12cf4ffeacab
Author: resiak at soc.pidgin.im
Date: 2007-10-14T21:08:42
Branch: im.pidgin.cpw.resiak.disconnectreason

Modified files:
        libpurple/connection.c libpurple/connection.h
        libpurple/protocols/bonjour/bonjour.c
        libpurple/protocols/bonjour/jabber.c
        libpurple/protocols/gg/gg.c libpurple/protocols/irc/irc.c
        libpurple/protocols/irc/msgs.c
        libpurple/protocols/irc/parse.c
        libpurple/protocols/jabber/auth.c
        libpurple/protocols/jabber/jabber.c
        libpurple/protocols/jabber/jabber.h
        libpurple/protocols/jabber/parser.c
        libpurple/protocols/msn/contact.c
        libpurple/protocols/msn/msn.c
        libpurple/protocols/msn/session.c
        libpurple/protocols/myspace/myspace.c
        libpurple/protocols/novell/novell.c
        libpurple/protocols/oscar/flap_connection.c
        libpurple/protocols/oscar/oscar.c
        libpurple/protocols/qq/keep_alive.c
        libpurple/protocols/qq/login_logout.c
        libpurple/protocols/qq/qq.c
        libpurple/protocols/qq/qq_proxy.c
        libpurple/protocols/qq/recv_core.c
        libpurple/protocols/qq/sendqueue.c
        libpurple/protocols/sametime/sametime.c
        libpurple/protocols/silc/silc.c
        libpurple/protocols/silc/util.c
        libpurple/protocols/simple/simple.c
        libpurple/protocols/yahoo/yahoo.c
        libpurple/protocols/yahoo/yahoo_packet.c
        libpurple/protocols/yahoo/ycht.c pidgin/gtkconn.c

ChangeLog: 

Rename:
 * PurpleDisconnectReason to PurpleConnectionError;
 * elements of that enum from PURPLE_REASON_* to PURPLE_CONNECTION_ERROR_*;
 * purple_connection_reason_is_fatal to purple_connection_error_is_fatal.

-------------- next part --------------
============================================================
--- libpurple/connection.c	666ca510385a646f7e8c1c0f8a52215c0e1a2f41
+++ libpurple/connection.c	f3c05448c078c6629aa27b5240c6863c55947b59
@@ -490,33 +490,34 @@ purple_connection_error(PurpleConnection
 {
 	/* prpls that have not been updated to use disconnection reasons will
 	 * be setting wants_to_die before calling this function, so choose
-	 * PURPLE_REASON_OTHER_ERROR (which is fatal) if it's true, and
-	 * PURPLE_REASON_NETWORK_ERROR (which isn't) if not.  See the
-	 * documentation in connection.h.
+	 * PURPLE_CONNECTION_ERROR_OTHER_ERROR (which is fatal) if it's true,
+	 * and PURPLE_CONNECTION_ERROR_NETWORK_ERROR (which isn't) if not.  See
+	 * the documentation in connection.h.
 	 */
-	PurpleDisconnectReason reason = gc->wants_to_die
-	                              ? PURPLE_REASON_OTHER_ERROR
-	                              : PURPLE_REASON_NETWORK_ERROR;
+	PurpleConnectionError reason = gc->wants_to_die
+	                             ? PURPLE_CONNECTION_ERROR_OTHER_ERROR
+	                             : PURPLE_CONNECTION_ERROR_NETWORK_ERROR;
 	purple_connection_error_reason (gc, reason, text);
 }
 
 void
 purple_connection_error_reason (PurpleConnection *gc,
-                                PurpleDisconnectReason reason,
+                                PurpleConnectionError reason,
                                 const char *description)
 {
 	PurpleConnectionUiOps *ops;
 
 	g_return_if_fail(gc   != NULL);
-	/* This sanity check relies on PURPLE_REASON_OTHER_ERROR being the
-	 * last member of the PurpleDisconnectReason enum in connection.h; if
-	 * other reasons are added after it, this check should be updated.
+	/* This sanity check relies on PURPLE_CONNECTION_ERROR_OTHER_ERROR
+	 * being the last member of the PurpleConnectionError enum in
+	 * connection.h; if other reasons are added after it, this check should
+	 * be updated.
 	 */
-	if (reason > PURPLE_REASON_OTHER_ERROR) {
+	if (reason > PURPLE_CONNECTION_ERROR_OTHER_ERROR) {
 		purple_debug_error("connection",
 			"purple_connection_error_reason: reason %u isn't a "
 			"valid reason\n", reason);
-		reason = PURPLE_REASON_OTHER_ERROR;
+		reason = PURPLE_CONNECTION_ERROR_OTHER_ERROR;
 	}
 
 	if (description == NULL) {
@@ -528,7 +529,7 @@ purple_connection_error_reason (PurpleCo
 	if (gc->disconnect_timeout)
 		return;
 
-	gc->wants_to_die = purple_connection_reason_is_fatal (reason);
+	gc->wants_to_die = purple_connection_error_is_fatal (reason);
 
 	ops = purple_connections_get_ui_ops();
 
@@ -548,47 +549,48 @@ purple_connection_ssl_error (PurpleConne
 purple_connection_ssl_error (PurpleConnection *gc,
                              PurpleSslErrorType ssl_error)
 {
-	PurpleDisconnectReason reason;
+	PurpleConnectionError reason;
 
 	switch (ssl_error) {
 		case PURPLE_SSL_HANDSHAKE_FAILED:
 		case PURPLE_SSL_CONNECT_FAILED:
-			reason = PURPLE_REASON_ENCRYPTION_ERROR;
+			reason = PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR;
 			break;
 		case PURPLE_SSL_CERTIFICATE_INVALID:
 			/* TODO: maybe PURPLE_SSL_* should be more specific? */
-			reason = PURPLE_REASON_CERT_OTHER_ERROR;
+			reason = PURPLE_CONNECTION_ERROR_CERT_OTHER_ERROR;
 			break;
 		default:
 			g_assert_not_reached ();
-			reason = PURPLE_REASON_ENCRYPTION_ERROR;
+			reason = PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR;
 	}
 
-	purple_connection_error_reason (gc, reason, purple_ssl_strerror(ssl_error));
+	purple_connection_error_reason (gc, reason,
+		purple_ssl_strerror(ssl_error));
 }
 
 gboolean
-purple_connection_reason_is_fatal (PurpleDisconnectReason reason)
+purple_connection_error_is_fatal (PurpleConnectionError reason)
 {
 	switch (reason)
 	{
-		case PURPLE_REASON_NETWORK_ERROR:
-		case PURPLE_REASON_AUTHENTICATION_IMPOSSIBLE:
-		case PURPLE_REASON_CERT_NOT_PROVIDED:
-		case PURPLE_REASON_CERT_UNTRUSTED:
-		case PURPLE_REASON_CERT_EXPIRED:
-		case PURPLE_REASON_CERT_NOT_ACTIVATED:
-		case PURPLE_REASON_CERT_HOSTNAME_MISMATCH:
-		case PURPLE_REASON_CERT_FINGERPRINT_MISMATCH:
-		case PURPLE_REASON_CERT_SELF_SIGNED:
-		case PURPLE_REASON_CERT_OTHER_ERROR:
+		case PURPLE_CONNECTION_ERROR_NETWORK_ERROR:
+		case PURPLE_CONNECTION_ERROR_AUTHENTICATION_IMPOSSIBLE:
+		case PURPLE_CONNECTION_ERROR_CERT_NOT_PROVIDED:
+		case PURPLE_CONNECTION_ERROR_CERT_UNTRUSTED:
+		case PURPLE_CONNECTION_ERROR_CERT_EXPIRED:
+		case PURPLE_CONNECTION_ERROR_CERT_NOT_ACTIVATED:
+		case PURPLE_CONNECTION_ERROR_CERT_HOSTNAME_MISMATCH:
+		case PURPLE_CONNECTION_ERROR_CERT_FINGERPRINT_MISMATCH:
+		case PURPLE_CONNECTION_ERROR_CERT_SELF_SIGNED:
+		case PURPLE_CONNECTION_ERROR_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:
+		case PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED:
+		case PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT:
+		case PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR:
+		case PURPLE_CONNECTION_ERROR_NAME_IN_USE:
+		case PURPLE_CONNECTION_ERROR_INVALID_SETTINGS:
+		case PURPLE_CONNECTION_ERROR_OTHER_ERROR:
 			return TRUE;
 		default:
 			g_return_val_if_reached(TRUE);
============================================================
--- libpurple/connection.h	23e4e627f4509264fd6de978ffe4a85139b5b49c
+++ libpurple/connection.h	4a7288a62937b87bc8921388002c1028e7f15fbf
@@ -63,58 +63,58 @@ typedef enum
 	 *  there was some protocol error (such as the server sending malformed
 	 *  data).
 	 */
-	PURPLE_REASON_NETWORK_ERROR = 0,
+	PURPLE_CONNECTION_ERROR_NETWORK_ERROR = 0,
 	/** The username or password (or some other credential) was incorrect.
 	 */
-	PURPLE_REASON_AUTHENTICATION_FAILED = 1,
+	PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED = 1,
 	/** libpurple doesn't speak any of the authentication methods the
 	 *  server offered.
 	 */
-	PURPLE_REASON_AUTHENTICATION_IMPOSSIBLE = 2,
+	PURPLE_CONNECTION_ERROR_AUTHENTICATION_IMPOSSIBLE = 2,
 	/** libpurple was built without SSL support, and the connection needs
 	 *  SSL.
 	 */
-	PURPLE_REASON_NO_SSL_SUPPORT = 3,
+	PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT = 3,
 	/** 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 = 4,
+	PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR = 4,
 	/** Someone is already connected to the server using the name you are
 	 *  trying to connect with.
 	 */
-	PURPLE_REASON_NAME_IN_USE = 5,
+	PURPLE_CONNECTION_ERROR_NAME_IN_USE = 5,
 
 	/** The username/server/other preference for the account isn't valid.
 	 *  For instance, on IRC the screen name cannot contain white space.
 	 *  This reason should not be used for incorrect passwords etc: use
-	 *  #PURPLE_REASON_AUTHENTICATION_FAILED for that.
+	 *  #PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED for that.
 	 *
 	 *  @todo This reason really shouldn't be necessary.  Usernames and
 	 *        other account preferences should be validated when the
 	 *        account is created.
 	 */
-	PURPLE_REASON_INVALID_SETTINGS = 6,
+	PURPLE_CONNECTION_ERROR_INVALID_SETTINGS = 6,
 
 	/** The server did not provide a SSL certificate. */
-	PURPLE_REASON_CERT_NOT_PROVIDED = 7,
+	PURPLE_CONNECTION_ERROR_CERT_NOT_PROVIDED = 7,
 	/** The server's SSL certificate could not be trusted. */
-	PURPLE_REASON_CERT_UNTRUSTED = 8,
+	PURPLE_CONNECTION_ERROR_CERT_UNTRUSTED = 8,
 	/** The server's SSL certificate has expired. */
-	PURPLE_REASON_CERT_EXPIRED = 9,
+	PURPLE_CONNECTION_ERROR_CERT_EXPIRED = 9,
 	/** The server's SSL certificate is not yet valid. */
-	PURPLE_REASON_CERT_NOT_ACTIVATED = 10,
+	PURPLE_CONNECTION_ERROR_CERT_NOT_ACTIVATED = 10,
 	/** The server's SSL certificate did not match its hostname. */
-	PURPLE_REASON_CERT_HOSTNAME_MISMATCH = 11,
+	PURPLE_CONNECTION_ERROR_CERT_HOSTNAME_MISMATCH = 11,
 	/** The server's SSL certificate does not have the expected
 	 *  fingerprint.
 	 */
-	PURPLE_REASON_CERT_FINGERPRINT_MISMATCH = 12,
+	PURPLE_CONNECTION_ERROR_CERT_FINGERPRINT_MISMATCH = 12,
 	/** The server's SSL certificate is self-signed.  */
-	PURPLE_REASON_CERT_SELF_SIGNED = 13,
+	PURPLE_CONNECTION_ERROR_CERT_SELF_SIGNED = 13,
 	/** There was some other error validating the server's SSL certificate.
 	 */
-	PURPLE_REASON_CERT_OTHER_ERROR = 14,
+	PURPLE_CONNECTION_ERROR_CERT_OTHER_ERROR = 14,
 
 	/** Some other error occured which fits into none of the other
 	 *  categories.
@@ -123,8 +123,8 @@ typedef enum
 	 * this is the last member of the enum when sanity-checking; if other
 	 * reasons are added after it, the check must be updated.
 	 */
-	PURPLE_REASON_OTHER_ERROR = 15
-} PurpleDisconnectReason;
+	PURPLE_CONNECTION_ERROR_OTHER_ERROR = 15
+} PurpleConnectionError;
 
 #include <time.h>
 
@@ -194,14 +194,14 @@ typedef struct
 	 *  #report_disconnect.  If both are implemented, this will be called
 	 *  first; however, there's no real reason to implement both.
 	 *  @param reason  why the connection ended, if known, or
-	 *                 #PURPLE_REASON_OTHER_ERROR, if not.
+	 *                 #PURPLE_CONNECTION_ERROR_OTHER_ERROR, if not.
 	 *  @param text  a localized message describing the disconnection
 	 *               in more detail to the user.
 	 *  @see #purple_connection_error_reason
 	 *  @since 2.3.0
 	 */
 	void (*report_disconnect_reason)(PurpleConnection *gc,
-	                                 PurpleDisconnectReason reason,
+	                                 PurpleConnectionError reason,
 	                                 const char *text);
 
 	void (*_purple_reserved1)(void);
@@ -233,7 +233,7 @@ struct _PurpleConnection
 	 * reconnected (incorrect password, etc.).  prpls should rely on
 	 * purple_connection_error_reason() to set this for them rather than
 	 * setting it themselves.
-	 * @see purple_connection_reason_is_fatal
+	 * @see purple_connection_error_is_fatal
 	 */
 	gboolean wants_to_die;
 
@@ -391,16 +391,17 @@ void purple_connection_notice(PurpleConn
  * @deprecated in favour of #purple_connection_error_reason.  Calling
  *  @c purple_connection_error(gc, text) is equivalent to calling
  *  @c purple_connection_error_reason(gc, reason, text) where @c reason is
- *  #PURPLE_REASON_OTHER_ERROR if @c gc->wants_to_die is @c TRUE, and
- *  #PURPLE_REASON_NETWORK_ERROR if not.  (This is to keep auto-reconnection
- *  behaviour the same when using old prpls which don't use reasons yet.)
+ *  #PURPLE_CONNECTION_ERROR_OTHER_ERROR if @c gc->wants_to_die is @c TRUE, and
+ *  #PURPLE_CONNECTION_ERROR_NETWORK_ERROR if not.  (This is to keep
+ *  auto-reconnection behaviour the same when using old prpls which don't use
+ *  reasons yet.)
  */
 void purple_connection_error(PurpleConnection *gc, const char *reason);
 
 /**
  * Closes a connection with an error and an optional description of the
  * error.  It also sets @c gc->wants_to_die to the value of
- * #purple_connection_reason_is_fatal(@a reason).
+ * #purple_connection_error_is_fatal(@a reason).
  *
  * @param reason      why the connection is closing.
  * @param description a localized description of the error.
@@ -408,12 +409,12 @@ purple_connection_error_reason (PurpleCo
  */
 void
 purple_connection_error_reason (PurpleConnection *gc,
-                                PurpleDisconnectReason reason,
+                                PurpleConnectionError reason,
                                 const char *description);
 
 /**
  * Closes a connection due to an SSL error; this is basically a shortcut to
- * turning the #PurpleSslErrorType into a #PurpleDisconnectReason and a
+ * turning the #PurpleSslErrorType into a #PurpleConnectionError and a
  * human-readable string and then calling purple_connection_error_reason().
  * @since 2.3.0
  */
@@ -425,14 +426,14 @@ purple_connection_ssl_error (PurpleConne
  * Reports whether a disconnection reason is fatal (in which case the account
  * should probably not be automatically reconnected) or transient (so
  * auto-reconnection is a good idea).
- * For instance, #PURPLE_REASON_NETWORK_ERROR is a temporary
+ * For instance, #PURPLE_CONNECTION_ERROR_NETWORK_ERROR is a temporary
  * error, which might be caused by losing the network connection, so
- * @a purple_connection_reason_is_fatal(PURPLE_REASON_NETWORK_ERROR) is
- * @c FALSE.  On the other hand, #PURPLE_REASON_AUTHENTICATION_FAILED probably
- * indicates a misconfiguration of the account which needs the user to go fix
- * it up, so @a
- * purple_connection_reason_is_fatal(PURPLE_REASON_AUTHENTICATION_FAILED)
- * is @c TRUE.
+ * @c purple_connection_error_is_fatal
+ * (@c PURPLE_CONNECTION_ERROR_NETWORK_ERROR) is @c FALSE.  On the other hand,
+ * #PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED probably indicates a
+ * misconfiguration of the account which needs the user to go fix it up, so
+ * @c purple_connection_error_is_fatal
+ * (@c PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED) is @c TRUE.
  *
  * (This function is meant to replace checking PurpleConnection.wants_to_die.)
  *
@@ -441,7 +442,7 @@ gboolean
  * @since 2.3.0
  */
 gboolean
-purple_connection_reason_is_fatal (PurpleDisconnectReason reason);
+purple_connection_error_is_fatal (PurpleConnectionError reason);
 
 /*@}*/
 
============================================================
--- libpurple/protocols/bonjour/bonjour.c	4ccef3933732ad33f6d7d110c22d9dd3ce9e7700
+++ libpurple/protocols/bonjour/bonjour.c	63c9657f4ccd60627643d4a1392cff234d33fd5c
@@ -102,7 +102,8 @@ bonjour_login(PurpleAccount *account)
 
 #ifdef _WIN32
 	if (!dns_sd_available()) {
-		purple_connection_error_reason(gc, PURPLE_REASON_OTHER_ERROR,
+		purple_connection_error_reason(gc,
+			PURPLE_CONNECTION_ERROR_OTHER_ERROR,
 			_("The Apple Bonjour For Windows toolkit wasn't found, see the FAQ at: "
 			  "http://developer.pidgin.im/wiki/Using%20Pidgin#CanIusePidginforBonjourLink-LocalMessaging"
 			  " for more information."));
@@ -120,7 +121,8 @@ bonjour_login(PurpleAccount *account)
 
 	if (bonjour_jabber_start(bd->jabber_data) == -1) {
 		/* Send a message about the connection error */
-		purple_connection_error_reason (gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason (gc,
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Unable to listen for incoming IM connections\n"));
 		return;
 	}
@@ -146,7 +148,8 @@ bonjour_login(PurpleAccount *account)
 	bd->dns_sd_data->account = account;
 	if (!bonjour_dns_sd_start(bd->dns_sd_data))
 	{
-		purple_connection_error_reason (gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason (gc,
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Unable to establish connection with the local mDNS server.  Is it running?"));
 		return;
 	}
============================================================
--- libpurple/protocols/bonjour/jabber.c	d4b36cf3f7c90c235c82514771458f33523e3d6e
+++ libpurple/protocols/bonjour/jabber.c	4e4f3a591dbfcc3166b90bdb7069428a4014a5b2
@@ -581,7 +581,8 @@ bonjour_jabber_start(BonjourJabber *data
 	{
 		purple_debug_error("bonjour", "Cannot open socket: %s\n", strerror(errno));
 		purple_connection_error_reason (data->account->gc,
-			PURPLE_REASON_NETWORK_ERROR, _("Cannot open socket"));
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
+			_("Cannot open socket"));
 		return -1;
 	}
 
@@ -590,7 +591,8 @@ bonjour_jabber_start(BonjourJabber *data
 	{
 		purple_debug_error("bonjour", "Error setting socket options: %s\n", strerror(errno));
 		purple_connection_error_reason (data->account->gc,
-			PURPLE_REASON_NETWORK_ERROR, _("Error setting socket options"));
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
+			_("Error setting socket options"));
 		return -1;
 	}
 
@@ -615,7 +617,8 @@ bonjour_jabber_start(BonjourJabber *data
 	{
 		purple_debug_error("bonjour", "Cannot bind socket: %s\n", strerror(errno));
 		purple_connection_error_reason (data->account->gc,
-			PURPLE_REASON_NETWORK_ERROR, _("Could not bind socket to port"));
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
+			_("Could not bind socket to port"));
 		return -1;
 	}
 
@@ -624,7 +627,8 @@ bonjour_jabber_start(BonjourJabber *data
 	{
 		purple_debug_error("bonjour", "Cannot listen on socket: %s\n", strerror(errno));
 		purple_connection_error_reason (data->account->gc,
-			PURPLE_REASON_NETWORK_ERROR, _("Could not listen on socket"));
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
+			_("Could not listen on socket"));
 		return -1;
 	}
 
============================================================
--- libpurple/protocols/gg/gg.c	05c4b4e20213d0bff1c259975d1fe24e4e896577
+++ libpurple/protocols/gg/gg.c	0af00761c649c61b8c6c609b15eaf8f95cbbc67d
@@ -381,14 +381,15 @@ static void ggp_callback_register_accoun
 
 	if (email == NULL || p1 == NULL || p2 == NULL || t == NULL ||
 	    *email == '\0' || *p1 == '\0' || *p2 == '\0' || *t == '\0') {
-		purple_connection_error_reason (gc, PURPLE_REASON_OTHER_ERROR,
+		purple_connection_error_reason (gc,
+			PURPLE_CONNECTION_ERROR_OTHER_ERROR,
 			_("Fill in the registration fields."));
 		goto exit_err;
 	}
 
 	if (g_utf8_collate(p1, p2) != 0) {
 		purple_connection_error_reason (gc,
-			PURPLE_REASON_AUTHENTICATION_FAILED,
+			PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED,
 			_("Passwords do not match."));
 		goto exit_err;
 	}
@@ -397,7 +398,8 @@ static void ggp_callback_register_accoun
 			token->id, t);
 	h = gg_register3(email, p1, token->id, t, 0);
 	if (h == NULL || !(s = h->data) || !s->success) {
-		purple_connection_error_reason (gc, PURPLE_REASON_OTHER_ERROR,
+		purple_connection_error_reason (gc,
+			PURPLE_CONNECTION_ERROR_OTHER_ERROR,
 			_("Unable to register new account. Error occurred.\n"));
 		goto exit_err;
 	}
@@ -1310,7 +1312,8 @@ static void ggp_callback_recv(gpointer _
 	if (!(ev = gg_watch_fd(info->session))) {
 		purple_debug_error("gg",
 			"ggp_callback_recv: gg_watch_fd failed -- CRITICAL!\n");
-		purple_connection_error_reason (gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason (gc,
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Unable to read socket"));
 		return;
 	}
@@ -1464,7 +1467,8 @@ static void ggp_async_login_handler(gpoi
 
 	if (!(ev = gg_watch_fd(info->session))) {
 		purple_debug_error("gg", "login_handler: gg_watch_fd failed!\n");
-		purple_connection_error_reason (gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason (gc,
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Unable to read socket"));
 		return;
 	}
@@ -1512,7 +1516,7 @@ static void ggp_async_login_handler(gpoi
 			purple_input_remove(gc->inpa);
 			gc->inpa = 0;
 			purple_connection_error_reason (gc,
-				PURPLE_REASON_NETWORK_ERROR,
+				PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 				_("Connection failed."));
 			break;
 		default:
@@ -1719,7 +1723,8 @@ static void ggp_login(PurpleAccount *acc
 
 	info->session = gg_login(glp);
 	if (info->session == NULL) {
-		purple_connection_error_reason (gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason (gc,
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Connection failed."));
 		g_free(glp);
 		return;
@@ -2003,7 +2008,8 @@ static void ggp_keepalive(PurpleConnecti
 	if (gg_ping(info->session) < 0) {
 		purple_debug_info("gg", "Not connected to the server "
 				"or gg_session is not correct\n");
-		purple_connection_error_reason (gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason (gc,
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Not connected to the server."));
 	}
 }
============================================================
--- libpurple/protocols/irc/irc.c	7aaf095774090bf778e42f0abfd23c188ead0da7
+++ libpurple/protocols/irc/irc.c	9657fa096002575329c5212f47ac456f0c26eb82
@@ -124,7 +124,8 @@ irc_send_cb(gpointer data, gint source, 
 		return;
 	else if (ret <= 0) {
 		PurpleConnection *gc = purple_account_get_connection(irc->account);
-		purple_connection_error_reason (gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason (gc,
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Server has disconnected"));
 		return;
 	}
@@ -163,7 +164,8 @@ int irc_send(struct irc_conn *irc, const
 		irc->gsc ? " (ssl)" : "", tosend); */
 	if (ret <= 0 && errno != EAGAIN) {
 		PurpleConnection *gc = purple_account_get_connection(irc->account);
-		purple_connection_error_reason (gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason (gc,
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Server has disconnected"));
 	} else if (ret < buflen) {
 		if (ret < 0)
@@ -297,7 +299,8 @@ static void irc_login(PurpleAccount *acc
 	gc->flags |= PURPLE_CONNECTION_NO_NEWLINES;
 
 	if (strpbrk(username, " \t\v\r\n") != NULL) {
-		purple_connection_error_reason (gc, PURPLE_REASON_INVALID_SETTINGS,
+		purple_connection_error_reason (gc,
+			PURPLE_CONNECTION_ERROR_INVALID_SETTINGS,
 			_("IRC nicks may not contain whitespace"));
 		return;
 	}
@@ -327,7 +330,8 @@ static void irc_login(PurpleAccount *acc
 					purple_account_get_int(account, "port", IRC_DEFAULT_SSL_PORT),
 					irc_login_cb_ssl, irc_ssl_connect_failure, gc);
 		} else {
-			purple_connection_error_reason (gc, PURPLE_REASON_NO_SSL_SUPPORT,
+			purple_connection_error_reason (gc,
+				PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT,
 				_("SSL support unavailable"));
 			return;
 		}
@@ -339,7 +343,8 @@ static void irc_login(PurpleAccount *acc
 				 purple_account_get_int(account, "port", IRC_DEFAULT_PORT),
 				 irc_login_cb, gc) == NULL)
 		{
-			purple_connection_error_reason (gc, PURPLE_REASON_NETWORK_ERROR,
+			purple_connection_error_reason (gc,
+				PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 				_("Couldn't create socket"));
 			return;
 		}
@@ -420,7 +425,8 @@ static void irc_login_cb(gpointer data, 
 	struct irc_conn *irc = gc->proto_data;
 
 	if (source < 0) {
-		purple_connection_error_reason (gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason (gc,
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Couldn't connect to host"));
 		return;
 	}
@@ -609,11 +615,13 @@ static void irc_input_cb_ssl(gpointer da
 		/* Try again later */
 		return;
 	} else if (len < 0) {
-		purple_connection_error_reason (gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason (gc,
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Read error"));
 		return;
 	} else if (len == 0) {
-		purple_connection_error_reason (gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason (gc,
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Server has disconnected"));
 		return;
 	}
@@ -636,11 +644,13 @@ static void irc_input_cb(gpointer data, 
 	if (len < 0 && errno == EAGAIN) {
 		return;
 	} else if (len < 0) {
-		purple_connection_error_reason (gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason (gc,
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Read error"));
 		return;
 	} else if (len == 0) {
-		purple_connection_error_reason (gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason (gc,
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Server has disconnected"));
 		return;
 	}
============================================================
--- libpurple/protocols/irc/msgs.c	f1d301c2d8a818b168a1cdd35218e862ed51589a
+++ libpurple/protocols/irc/msgs.c	671597db8cd7146f8acd1d0f002a1a01b1e1e7e9
@@ -913,7 +913,8 @@ void irc_msg_badnick(struct irc_conn *ir
 				  _("Your selected nickname was rejected by the server.  It probably contains invalid characters."));
 
 	} else {
-		purple_connection_error_reason (gc, PURPLE_REASON_INVALID_SETTINGS,
+		purple_connection_error_reason (gc,
+				  PURPLE_CONNECTION_ERROR_INVALID_SETTINGS,
 				  _("Your selected account name was rejected by the server.  It probably contains invalid characters."));
 	}
 }
============================================================
--- libpurple/protocols/irc/parse.c	196420145090bb468291e9eb334862d13297b079
+++ libpurple/protocols/irc/parse.c	9689a5d850a6fe49e76a9f79f29846fffd18e7b2
@@ -631,11 +631,13 @@ void irc_parse_msg(struct irc_conn *irc,
 	} else if (!strncmp(input, "ERROR ", 6)) {
 		if (g_utf8_validate(input, -1, NULL)) {
 			char *tmp = g_strdup_printf("%s\n%s", _("Disconnected."), input);
-			purple_connection_error_reason (gc, PURPLE_REASON_NETWORK_ERROR, tmp);
+			purple_connection_error_reason (gc,
+				PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
 			g_free(tmp);
 		} else
 			purple_connection_error_reason (gc,
-				PURPLE_REASON_NETWORK_ERROR, _("Disconnected."));
+				PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
+				_("Disconnected."));
 		return;
 	}
 
============================================================
--- libpurple/protocols/jabber/auth.c	f05f616a7460175e37c93dd4fa2900ff4095001f
+++ libpurple/protocols/jabber/auth.c	12caf62ded6c3314a811a59f8730fc801420cd8c
@@ -50,7 +50,8 @@ jabber_process_starttls(JabberStream *js
 					"<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>", -1);
 			return TRUE;
 		} else if(xmlnode_get_child(starttls, "required")) {
-			purple_connection_error_reason (js->gc, PURPLE_REASON_NO_SSL_SUPPORT,
+			purple_connection_error_reason (js->gc,
+				PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT,
 				_("Server requires TLS/SSL for login.  No TLS/SSL support found."));
 			return TRUE;
 		}
@@ -114,7 +115,8 @@ static void disallow_plaintext_auth(Purp
 
 static void disallow_plaintext_auth(PurpleAccount *account)
 {
-	purple_connection_error_reason (account->gc, PURPLE_REASON_ENCRYPTION_ERROR,
+	purple_connection_error_reason (account->gc,
+		PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR,
 		_("Server requires plaintext authentication over an unencrypted stream"));
 }
 
@@ -334,7 +336,7 @@ static void jabber_auth_start_cyrus(Jabb
 				 */
 				} else {
 					purple_connection_error_reason (js->gc,
-						PURPLE_REASON_AUTHENTICATION_IMPOSSIBLE,
+						PURPLE_CONNECTION_ERROR_AUTHENTICATION_IMPOSSIBLE,
 						_("Server does not use any supported authentication method"));
 					return;
 				}
@@ -391,7 +393,7 @@ static void jabber_auth_start_cyrus(Jabb
 		xmlnode_free(auth);
 	} else {
 		purple_connection_error_reason (js->gc,
-			PURPLE_REASON_AUTHENTICATION_IMPOSSIBLE,
+			PURPLE_CONNECTION_ERROR_AUTHENTICATION_IMPOSSIBLE,
 			"SASL authentication failed\n");
 	}
 }
@@ -465,7 +467,8 @@ jabber_auth_start(JabberStream *js, xmln
 	mechs = xmlnode_get_child(packet, "mechanisms");
 
 	if(!mechs) {
-		purple_connection_error_reason (js->gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason (js->gc,
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Invalid response from server."));
 		return;
 	}
@@ -526,7 +529,8 @@ jabber_auth_start(JabberStream *js, xmln
 		}
 		finish_plaintext_authentication(js);
 	} else {
-		purple_connection_error_reason (js->gc, PURPLE_REASON_AUTHENTICATION_IMPOSSIBLE,
+		purple_connection_error_reason (js->gc,
+				PURPLE_CONNECTION_ERROR_AUTHENTICATION_IMPOSSIBLE,
 				_("Server does not use any supported authentication method"));
 	}
 #endif
@@ -539,7 +543,7 @@ static void auth_old_result_cb(JabberStr
 	if(type && !strcmp(type, "result")) {
 		jabber_stream_set_state(js, JABBER_STREAM_CONNECTED);
 	} else {
-		PurpleDisconnectReason reason = PURPLE_REASON_NETWORK_ERROR;
+		PurpleConnectionError reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR;
 		char *msg = jabber_parse_error(js, packet, &reason);
 		xmlnode *error;
 		const char *err_code;
@@ -548,7 +552,7 @@ static void auth_old_result_cb(JabberStr
 		if((error = xmlnode_get_child(packet, "error")) &&
 					(err_code = xmlnode_get_attrib(error, "code")) &&
 					!strcmp(err_code, "401")) {
-			reason = PURPLE_REASON_AUTHENTICATION_FAILED;
+			reason = PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED;
 			/* Clear the pasword if it isn't being saved */
 			if (!purple_account_get_remember_password(js->gc->account))
 				purple_account_set_password(js->gc->account, NULL);
@@ -567,11 +571,12 @@ static void auth_old_cb(JabberStream *js
 	const char *pw = purple_connection_get_password(js->gc);
 
 	if(!type) {
-		purple_connection_error_reason (js->gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason (js->gc,
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Invalid response from server."));
 		return;
 	} else if(!strcmp(type, "error")) {
-		PurpleDisconnectReason reason = PURPLE_REASON_NETWORK_ERROR;
+		PurpleConnectionError reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR;
 		char *msg = jabber_parse_error(js, packet, &reason);
 		purple_connection_error_reason (js->gc, reason, msg);
 		g_free(msg);
@@ -618,7 +623,7 @@ static void auth_old_cb(JabberStream *js
 			finish_plaintext_authentication(js);
 		} else {
 			purple_connection_error_reason (js->gc,
-				PURPLE_REASON_AUTHENTICATION_IMPOSSIBLE,
+				PURPLE_CONNECTION_ERROR_AUTHENTICATION_IMPOSSIBLE,
 				_("Server does not use any supported authentication method"));
 			return;
 		}
@@ -785,7 +790,8 @@ jabber_auth_handle_challenge(JabberStrea
 		GHashTable *parts;
 
 		if(!enc_in) {
-			purple_connection_error_reason (js->gc, PURPLE_REASON_NETWORK_ERROR,
+			purple_connection_error_reason (js->gc,
+				PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 				_("Invalid response from server."));
 			return;
 		}
@@ -807,7 +813,8 @@ jabber_auth_handle_challenge(JabberStrea
 						"<response xmlns='urn:ietf:params:xml:ns:xmpp-sasl' />",
 						-1);
 			} else {
-				purple_connection_error_reason (js->gc, PURPLE_REASON_NETWORK_ERROR,
+				purple_connection_error_reason (js->gc,
+					PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 					_("Invalid challenge from server"));
 			}
 			g_free(js->expected_rspauth);
@@ -831,7 +838,8 @@ jabber_auth_handle_challenge(JabberStrea
 				realm = js->user->domain;
 
 			if (nonce == NULL || realm == NULL)
-				purple_connection_error_reason (js->gc, PURPLE_REASON_NETWORK_ERROR,
+				purple_connection_error_reason (js->gc,
+					PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 					_("Invalid challenge from server"));
 			else {
 				GString *response = g_string_new("");
@@ -904,7 +912,8 @@ jabber_auth_handle_challenge(JabberStrea
 		g_free(dec_in);
 		if (js->sasl_state != SASL_CONTINUE && js->sasl_state != SASL_OK) {
 			purple_debug_error("jabber", "Error is %d : %s\n",js->sasl_state,sasl_errdetail(js->sasl));
-			purple_connection_error_reason (js->gc, PURPLE_REASON_NETWORK_ERROR,
+			purple_connection_error_reason (js->gc,
+				PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 				_("SASL error"));
 			return;
 		} else {
@@ -930,7 +939,8 @@ void jabber_auth_handle_success(JabberSt
 #endif
 
 	if(!ns || strcmp(ns, "urn:ietf:params:xml:ns:xmpp-sasl")) {
-		purple_connection_error_reason (js->gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason (js->gc,
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Invalid response from server."));
 		return;
 	}
@@ -956,7 +966,8 @@ void jabber_auth_handle_success(JabberSt
 
 		if (js->sasl_state != SASL_OK) {
 			/* This should never happen! */
-			purple_connection_error_reason (js->gc, PURPLE_REASON_NETWORK_ERROR,
+			purple_connection_error_reason (js->gc,
+				PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 				_("Invalid response from server."));
 		}
 	}
@@ -973,11 +984,12 @@ void jabber_auth_handle_failure(JabberSt
 
 void jabber_auth_handle_failure(JabberStream *js, xmlnode *packet)
 {
-	PurpleDisconnectReason reason = PURPLE_REASON_NETWORK_ERROR;
+	PurpleConnectionError reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR;
 	char *msg = jabber_parse_error(js, packet, &reason);
 
 	if(!msg) {
-		purple_connection_error_reason (js->gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason (js->gc,
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Invalid response from server."));
 	} else {
 		purple_connection_error_reason (js->gc, reason, msg);
============================================================
--- libpurple/protocols/jabber/jabber.c	bec038f71e8124ae173f751db264d4f9e3507f7e
+++ libpurple/protocols/jabber/jabber.c	8b996818ff834e1c0c29d5ffe50bbbdff0c7fa9f
@@ -89,7 +89,8 @@ jabber_session_initialized_cb(JabberStre
 		if(js->unregistration)
 			jabber_unregister_account_cb(js);
 	} else {
-		purple_connection_error_reason (js->gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason (js->gc,
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			("Error initializing session"));
 	}
 }
@@ -121,7 +122,8 @@ static void jabber_bind_result_cb(Jabber
 			JabberBuddy *my_jb = NULL;
 			jabber_id_free(js->user);
 			if(!(js->user = jabber_id_new(full_jid))) {
-				purple_connection_error_reason (js->gc, PURPLE_REASON_NETWORK_ERROR,
+				purple_connection_error_reason (js->gc,
+					PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 					_("Invalid response from server."));
 			}
 			if((my_jb = jabber_buddy_find(js, full_jid, TRUE)))
@@ -129,7 +131,7 @@ static void jabber_bind_result_cb(Jabber
 			g_free(full_jid);
 		}
 	} else {
-		PurpleDisconnectReason reason = PURPLE_REASON_NETWORK_ERROR;
+		PurpleConnectionError reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR;
 		char *msg = jabber_parse_error(js, packet, &reason);
 		purple_connection_error_reason (js->gc, reason, msg);
 		g_free(msg);
@@ -144,7 +146,8 @@ static void jabber_stream_features_parse
 		if(jabber_process_starttls(js, packet))
 			return;
 	} else if(purple_account_get_bool(js->gc->account, "require_tls", FALSE) && !js->gsc) {
-		purple_connection_error_reason (js->gc, PURPLE_REASON_ENCRYPTION_ERROR,
+		purple_connection_error_reason (js->gc,
+			 PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR,
 			_("You require encryption, but it is not available on this server."));
 		return;
 	}
@@ -176,7 +179,7 @@ static void jabber_stream_handle_error(J
 
 static void jabber_stream_handle_error(JabberStream *js, xmlnode *packet)
 {
-	PurpleDisconnectReason reason = PURPLE_REASON_NETWORK_ERROR;
+	PurpleConnectionError reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR;
 	char *msg = jabber_parse_error(js, packet, &reason);
 
 	purple_connection_error_reason (js->gc, reason, msg);
@@ -261,7 +264,8 @@ static void jabber_send_cb(gpointer data
 	if (ret < 0 && errno == EAGAIN)
 		return;
 	else if (ret <= 0) {
-		purple_connection_error_reason (js->gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason (js->gc,
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Write error"));
 		return;
 	}
@@ -316,7 +320,7 @@ void jabber_send_raw(JabberStream *js, c
 
 			if (ret < 0 && errno != EAGAIN)
 				purple_connection_error_reason (js->gc,
-					PURPLE_REASON_NETWORK_ERROR,
+					PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 					_("Write error"));
 			else if (ret < olen) {
 				if (ret < 0)
@@ -346,7 +350,7 @@ void jabber_send_raw(JabberStream *js, c
 
 	if (ret < 0 && errno != EAGAIN)
 		purple_connection_error_reason (js->gc,
-			PURPLE_REASON_NETWORK_ERROR,
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Write error"));
 	else if (ret < len) {
 		if (ret < 0)
@@ -416,7 +420,7 @@ jabber_recv_cb_ssl(gpointer data, Purple
 		return;
 	else
 		purple_connection_error_reason (js->gc,
-			PURPLE_REASON_NETWORK_ERROR,
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Read Error"));
 }
 
@@ -455,7 +459,7 @@ jabber_recv_cb(gpointer data, gint sourc
 		return;
 	} else {
 		purple_connection_error_reason (js->gc,
-			PURPLE_REASON_NETWORK_ERROR,
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Read Error"));
 	}
 }
@@ -495,7 +499,8 @@ jabber_login_callback(gpointer data, gin
 		gchar *tmp;
 		tmp = g_strdup_printf(_("Could not establish a connection with the server:\n%s"),
 				error);
-		purple_connection_error_reason (gc, PURPLE_REASON_NETWORK_ERROR, tmp);
+		purple_connection_error_reason (gc,
+				PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
 		g_free(tmp);
 		return;
 	}
@@ -540,7 +545,8 @@ static void jabber_login_connect(JabberS
 
 	if (purple_proxy_connect(js->gc, js->gc->account, host,
 			port, jabber_login_callback, js->gc) == NULL)
-		purple_connection_error_reason (js->gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason (js->gc,
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Unable to create socket"));
 }
 
@@ -587,13 +593,15 @@ jabber_login(PurpleAccount *account)
 	js->old_length = -1;
 
 	if(!js->user) {
-		purple_connection_error_reason (gc, PURPLE_REASON_INVALID_SETTINGS,
+		purple_connection_error_reason (gc,
+			PURPLE_CONNECTION_ERROR_INVALID_SETTINGS,
 			_("Invalid XMPP ID"));
 		return;
 	}
 	
 	if (!js->user->domain || *(js->user->domain) == '\0') {
-		purple_connection_error_reason (gc, PURPLE_REASON_INVALID_SETTINGS,
+		purple_connection_error_reason (gc,
+			PURPLE_CONNECTION_ERROR_INVALID_SETTINGS,
 			_("Invalid XMPP ID. Domain must be set."));
 		return;
 	}
@@ -624,7 +632,8 @@ jabber_login(PurpleAccount *account)
 					purple_account_get_int(account, "port", 5223), jabber_login_callback_ssl,
 					jabber_ssl_connect_failure, js->gc);
 		} else {
-			purple_connection_error_reason (js->gc, PURPLE_REASON_NO_SSL_SUPPORT,
+			purple_connection_error_reason (js->gc,
+				PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT,
 				_("SSL support unavailable"));
 		}
 	}
@@ -1078,7 +1087,8 @@ void jabber_register_account(PurpleAccou
 	js->old_length = -1;
 
 	if(!js->user) {
-		purple_connection_error_reason (gc, PURPLE_REASON_INVALID_SETTINGS,
+		purple_connection_error_reason (gc,
+			PURPLE_CONNECTION_ERROR_INVALID_SETTINGS,
 			_("Invalid XMPP ID"));
 		return;
 	}
@@ -1111,7 +1121,8 @@ void jabber_register_account(PurpleAccou
 					purple_account_get_int(account, "port", 5222),
 					jabber_login_callback_ssl, jabber_ssl_connect_failure, gc);
 		} else {
-			purple_connection_error_reason (gc, PURPLE_REASON_NO_SSL_SUPPORT,
+			purple_connection_error_reason (gc,
+				PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT,
 				_("SSL support unavailable"));
 		}
 	}
@@ -1827,7 +1838,7 @@ char *jabber_parse_error(JabberStream *j
 
 char *jabber_parse_error(JabberStream *js,
                          xmlnode *packet,
-                         PurpleDisconnectReason *reason)
+                         PurpleConnectionError *reason)
 {
 	xmlnode *error;
 	const char *code = NULL, *text = NULL;
@@ -1889,11 +1900,11 @@ char *jabber_parse_error(JabberStream *j
 		}
 	} else if(xmlns && !strcmp(xmlns, "urn:ietf:params:xml:ns:xmpp-sasl")) {
 		/* Most common reason can be the default */
-		SET_REASON(PURPLE_REASON_AUTHENTICATION_FAILED);
+		SET_REASON(PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED);
 		if(xmlnode_get_child(packet, "aborted")) {
 			text = _("Authorization Aborted");
 		} else if(xmlnode_get_child(packet, "incorrect-encoding")) {
-			SET_REASON(PURPLE_REASON_NETWORK_ERROR);
+			SET_REASON(PURPLE_CONNECTION_ERROR_NETWORK_ERROR);
 			text = _("Incorrect encoding in authorization");
 		} else if(xmlnode_get_child(packet, "invalid-authzid")) {
 			text = _("Invalid authzid");
@@ -1907,7 +1918,7 @@ char *jabber_parse_error(JabberStream *j
 				purple_account_set_password(js->gc->account, NULL);
 			text = _("Not Authorized");
 		} else if(xmlnode_get_child(packet, "temporary-auth-failure")) {
-			SET_REASON(PURPLE_REASON_NETWORK_ERROR);
+			SET_REASON(PURPLE_CONNECTION_ERROR_NETWORK_ERROR);
 			text = _("Temporary Authentication Failure");
 		} else {
 			text = _("Authentication Failure");
@@ -1916,13 +1927,13 @@ char *jabber_parse_error(JabberStream *j
 			 (!strcmp(packet->name, "error") && xmlns &&
 				!strcmp(xmlns, "http://etherx.jabber.org/streams"))) {
 		/* Most common reason as default: */
-		SET_REASON(PURPLE_REASON_NETWORK_ERROR);
+		SET_REASON(PURPLE_CONNECTION_ERROR_NETWORK_ERROR);
 		if(xmlnode_get_child(packet, "bad-format")) {
 			text = _("Bad Format");
 		} else if(xmlnode_get_child(packet, "bad-namespace-prefix")) {
 			text = _("Bad Namespace Prefix");
 		} else if(xmlnode_get_child(packet, "conflict")) {
-			SET_REASON(PURPLE_REASON_NAME_IN_USE);
+			SET_REASON(PURPLE_CONNECTION_ERROR_NAME_IN_USE);
 			text = _("Resource Conflict");
 		} else if(xmlnode_get_child(packet, "connection-timeout")) {
 			text = _("Connection Timeout");
============================================================
--- libpurple/protocols/jabber/jabber.h	0c11fce95d3d2b99cffbed75beed40caf746f3a8
+++ libpurple/protocols/jabber/jabber.h	eeb9aecb59fd9307df205360db6744f417356a46
@@ -223,7 +223,7 @@ char *jabber_get_next_id(JabberStream *j
  *  @param reason where to store the disconnection reason, or @c NULL if you
  *                don't care or you don't intend to close the connection.
  */
-char *jabber_parse_error(JabberStream *js, xmlnode *packet, PurpleDisconnectReason *reason);
+char *jabber_parse_error(JabberStream *js, xmlnode *packet, PurpleConnectionError *reason);
 
 void jabber_add_feature(const gchar *shortname, const gchar *namespace, JabberFeatureEnabled cb); /* cb may be NULL */
 void jabber_remove_feature(const gchar *shortname);
============================================================
--- libpurple/protocols/jabber/parser.c	d6ddaff4c1f013ad89916a96ee64b8f94c5eb4b2
+++ libpurple/protocols/jabber/parser.c	6cecb079972daf216504b3dce358ca781c92c3d9
@@ -193,7 +193,8 @@ void jabber_parser_process(JabberStream 
 		js->context = xmlCreatePushParserCtxt(&jabber_parser_libxml, js, buf, len, NULL);
 		xmlParseChunk(js->context, "", 0, 0);
 	} else if (xmlParseChunk(js->context, buf, len, 0) < 0) {
-		purple_connection_error_reason (js->gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason (js->gc,
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("XML Parse error"));
 	}
 }
============================================================
--- libpurple/protocols/msn/contact.c	38ffcd0601fd9aa05529088a066bcc85e787691f
+++ libpurple/protocols/msn/contact.c	4a148f3773f27e0792f6eed685873f75ece6d098
@@ -945,7 +945,7 @@ msn_get_address_cb(MsnSoapConn *soapconn
 		msn_get_address_book(contact, NULL, NULL);
 		*/
 		msn_session_disconnect(session);
-		purple_connection_error_reason(session->account->gc, PURPLE_REASON_NETWORK_ERROR, _("Unable to retrieve MSN Address Book"));
+		purple_connection_error_reason(session->account->gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Unable to retrieve MSN Address Book"));
 		return FALSE;
 	}
 }
============================================================
--- libpurple/protocols/msn/msn.c	e02fd9da8dcc1658d01780c8375bcdeddc38b484
+++ libpurple/protocols/msn/msn.c	61b09665a337c606df626e4d07e27fde09490b3f
@@ -820,7 +820,8 @@ msn_login(PurpleAccount *account)
 
 	if (!purple_ssl_is_supported())
 	{
-		purple_connection_error_reason (gc, PURPLE_REASON_NO_SSL_SUPPORT,
+		purple_connection_error_reason (gc,
+			PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT,
 			_("SSL support is needed for MSN. Please install a supported "
 			  "SSL library."));
 		return;
@@ -849,7 +850,8 @@ msn_login(PurpleAccount *account)
 		purple_account_set_username(account, username);
 
 	if (!msn_session_connect(session, host, port, http_method))
-		purple_connection_error_reason (gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason (gc,
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Failed to connect to server."));
 }
 
============================================================
--- libpurple/protocols/msn/session.c	adcb051db5dc55f9804178489275b9a0ef317a33
+++ libpurple/protocols/msn/session.c	2b192bb0c8725b0a4a9bc7d6af313d9cd692876e
@@ -325,7 +325,7 @@ msn_session_set_error(MsnSession *sessio
 					  const char *info)
 {
 	PurpleConnection *gc;
-	PurpleDisconnectReason reason;
+	PurpleConnectionError reason;
 	char *msg;
 
 	gc = purple_account_get_connection(session->account);
@@ -333,49 +333,49 @@ msn_session_set_error(MsnSession *sessio
 	switch (error)
 	{
 		case MSN_ERROR_SERVCONN:
-			reason = PURPLE_REASON_NETWORK_ERROR;
+			reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR;
 			msg = g_strdup(info);
 			break;
 		case MSN_ERROR_UNSUPPORTED_PROTOCOL:
-			reason = PURPLE_REASON_NETWORK_ERROR;
+			reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR;
 			msg = g_strdup(_("Our protocol is not supported by the "
 							 "server."));
 			break;
 		case MSN_ERROR_HTTP_MALFORMED:
-			reason = PURPLE_REASON_NETWORK_ERROR;
+			reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR;
 			msg = g_strdup(_("Error parsing HTTP."));
 			break;
 		case MSN_ERROR_SIGN_OTHER:
-			reason = PURPLE_REASON_NAME_IN_USE;
+			reason = PURPLE_CONNECTION_ERROR_NAME_IN_USE;
 			msg = g_strdup(_("You have signed on from another location."));
 			if (!purple_account_get_remember_password(session->account))
 				purple_account_set_password(session->account, NULL);
 			break;
 		case MSN_ERROR_SERV_UNAVAILABLE:
-			reason = PURPLE_REASON_NETWORK_ERROR;
+			reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR;
 			msg = g_strdup(_("The MSN servers are temporarily "
 							 "unavailable. Please wait and try "
 							 "again."));
 			break;
 		case MSN_ERROR_SERV_DOWN:
-			reason = PURPLE_REASON_NETWORK_ERROR;
+			reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR;
 			msg = g_strdup(_("The MSN servers are going down "
 							 "temporarily."));
 			break;
 		case MSN_ERROR_AUTH:
-			reason = PURPLE_REASON_AUTHENTICATION_FAILED;
+			reason = PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED;
 			msg = g_strdup_printf(_("Unable to authenticate: %s"),
 								  (info == NULL ) ?
 								  _("Unknown error") : info);
 			break;
 		case MSN_ERROR_BAD_BLIST:
-			reason = PURPLE_REASON_NETWORK_ERROR;
+			reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR;
 			msg = g_strdup(_("Your MSN buddy list is temporarily "
 							 "unavailable. Please wait and try "
 							 "again."));
 			break;
 		default:
-			reason = PURPLE_REASON_NETWORK_ERROR;
+			reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR;
 			msg = g_strdup(_("Unknown error."));
 			break;
 	}
============================================================
--- libpurple/protocols/myspace/myspace.c	8c22b1c39dcfc9edd7a53f14381e9589688e99e4
+++ libpurple/protocols/myspace/myspace.c	b815ced488150eac43ac8f89e3bca3b6bb785ef6
@@ -292,7 +292,7 @@ msim_login(PurpleAccount *acct)
 		purple_notify_error(acct, _("MySpaceIM Error"), str, NULL);
 
 		purple_connection_error_reason (gc,
-			PURPLE_REASON_AUTHENTICATION_FAILED, str);
+			PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, str);
 		g_free(str);
 		return;
 	}
@@ -315,7 +315,8 @@ msim_login(PurpleAccount *acct)
 	if (!purple_proxy_connect(gc, acct, host, port, msim_connect_cb, gc)) {
 		/* TODO: try other ports if in auto mode, then save
 		 * working port and try that first next time. */
-		purple_connection_error_reason (gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason (gc,
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Couldn't create socket"));
 		return;
 	}
@@ -354,7 +355,8 @@ msim_login_challenge(MsimSession *sessio
 
 	if (nc_len != MSIM_AUTH_CHALLENGE_LENGTH) {
 		purple_debug_info("msim", "bad nc length: %x != 0x%x\n", nc_len, MSIM_AUTH_CHALLENGE_LENGTH);
-		purple_connection_error_reason (session->gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason (session->gc,
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Unexpected challenge length from server"));
 		return FALSE;
 	}
@@ -1292,7 +1294,7 @@ msim_check_alive(gpointer data)
 		purple_debug_info("msim", "msim_check_alive: %s > interval of %d, presumed dead\n",
 				errmsg, MSIM_KEEPALIVE_INTERVAL);
 		purple_connection_error_reason (session->gc,
-				PURPLE_REASON_NETWORK_ERROR, errmsg);
+				PURPLE_CONNECTION_ERROR_NETWORK_ERROR, errmsg);
 
 		purple_notify_error(session->gc, NULL, errmsg, NULL);
 
@@ -1558,7 +1560,8 @@ msim_we_are_logged_on(MsimSession *sessi
 		purple_notify_error(session->account, 
 				_("No username set"),
 				_("Please go to http://editprofile.myspace.com/index.cfm?fuseaction=profile.username and choose a username and try to login again."), NULL);
-		purple_connection_error_reason (session->gc, PURPLE_REASON_AUTHENTICATION_FAILED, _("No username set"));
+		purple_connection_error_reason (session->gc,
+			PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, _("No username set"));
 		return FALSE;
 	}
 
@@ -1794,16 +1797,16 @@ msim_error(MsimSession *session, MsimMes
 
 	/* Destroy session if fatal. */
 	if (msim_msg_get(msg, "fatal")) {
-		PurpleDisconnectReason reason = PURPLE_REASON_NETWORK_ERROR;
+		PurpleConnectionError reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR;
 		purple_debug_info("msim", "fatal error, closing\n");
 		switch (err) {
 			case 260: /* Incorrect password */
-				reason = PURPLE_REASON_AUTHENTICATION_FAILED;
+				reason = PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED;
 				if (!purple_account_get_remember_password(session->account))
 					purple_account_set_password(session->account, NULL);
 				break;
 			case 6: /* Logged in elsewhere */
-				reason = PURPLE_REASON_NAME_IN_USE;
+				reason = PURPLE_CONNECTION_ERROR_NAME_IN_USE;
 				if (!purple_account_get_remember_password(session->account))
 					purple_account_set_password(session->account, NULL);
 				break;
@@ -2319,7 +2322,8 @@ msim_input_cb(gpointer gc_uncasted, gint
 	/* libpurple/eventloop.h only defines these two */
 	if (cond != PURPLE_INPUT_READ && cond != PURPLE_INPUT_WRITE) {
 		purple_debug_info("msim_input_cb", "unknown condition=%d\n", cond);
-		purple_connection_error_reason (gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason (gc,
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Invalid input condition"));
 		return;
 	}
@@ -2338,7 +2342,8 @@ msim_input_cb(gpointer gc_uncasted, gint
 		purple_debug_error("msim", 
 				"msim_input_cb: %d-byte read buffer full! rxoff=%d\n",
 				MSIM_READ_BUF_SIZE, session->rxoff);
-		purple_connection_error_reason (gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason (gc,
+				PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 				_("Read buffer full"));
 		return;
 	}
@@ -2358,12 +2363,14 @@ msim_input_cb(gpointer gc_uncasted, gint
 		purple_debug_error("msim", "msim_input_cb: read error, ret=%d, "
 			"error=%s, source=%d, fd=%d (%X))\n", 
 			n, strerror(errno), source, session->fd, session->fd);
-		purple_connection_error_reason (gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason (gc, 
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Read error"));
 		return;
 	} else if (n == 0) {
 		purple_debug_info("msim", "msim_input_cb: server disconnected\n");
-		purple_connection_error_reason (gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason (gc,
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Server has disconnected"));
 		return;
 	}
@@ -2372,7 +2379,8 @@ msim_input_cb(gpointer gc_uncasted, gint
 		purple_debug_info("msim_input_cb", "received %d bytes, pushing rxoff to %d, over buffer size of %d\n",
 				n, n + session->rxoff, MSIM_READ_BUF_SIZE);
 		/* TODO: g_realloc like msn, yahoo, irc, jabber? */
-		purple_connection_error_reason (gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason (gc,
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Read buffer full"));
 	}
 
@@ -2388,7 +2396,8 @@ msim_input_cb(gpointer gc_uncasted, gint
 		purple_debug_info("msim", "msim_input_cb: strlen=%d, but read %d bytes"
 				"--null byte encountered?\n", 
 				strlen(session->rxbuf + session->rxoff), n);
-		/*purple_connection_error_reason (gc, PURPLE_REASON_NETWORK_ERROR,
+		/*purple_connection_error_reason (gc,
+				PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 				"Invalid message - null byte on input"); */
 		return;
 	}
@@ -2412,7 +2421,8 @@ msim_input_cb(gpointer gc_uncasted, gint
 		msg = msim_parse(g_strdup(session->rxbuf));
 		if (!msg) {
 			purple_debug_info("msim", "msim_input_cb: couldn't parse rxbuf\n");
-			purple_connection_error_reason (gc, PURPLE_REASON_NETWORK_ERROR,
+			purple_connection_error_reason (gc,
+				PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 				_("Unparseable message"));
 		} else {
 			/* Process message and then free it (processing function should
@@ -2480,7 +2490,8 @@ msim_connect_cb(gpointer data, gint sour
 	session = (MsimSession *)gc->proto_data;
 
 	if (source < 0) {
-		purple_connection_error_reason (gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason (gc,
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			g_strdup_printf(_("Couldn't connect to host: %s (%d)"), 
 					error_message ? error_message : "no message given", 
 					source));
============================================================
--- libpurple/protocols/novell/novell.c	0395d12de718699337e8da2ea832243d34e72403
+++ libpurple/protocols/novell/novell.c	e8ad61b618e2fb252019601a832cc1069ade8030
@@ -120,7 +120,7 @@ _login_resp_cb(NMUser * user, NMERR_T re
 		_check_for_disconnect(user, rc);
 
 	} else {
-		PurpleDisconnectReason reason;
+		PurpleConnectionError reason;
 		char *err = g_strdup_printf(_("Login failed (%s)."),
 					    nm_error_to_string (ret_code));
 
@@ -133,11 +133,11 @@ _login_resp_cb(NMUser * user, NMERR_T re
 				 */
 				if (!purple_account_get_remember_password(gc->account))
 					purple_account_set_password(gc->account, NULL);
-				reason = PURPLE_REASON_AUTHENTICATION_FAILED;
+				reason = PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED;
 				break;
 			default:
 				/* FIXME: There are other reasons login could fail */
-				reason = PURPLE_REASON_NETWORK_ERROR;
+				reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR;
 		}
 
 		purple_connection_error_reason (gc, reason, err);
@@ -1126,7 +1126,8 @@ _check_for_disconnect(NMUser * user, NME
 
 	if (_is_disconnect_error(err)) {
 
-		purple_connection_error_reason (gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason (gc,
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Error communicating with server. Closing connection."));
 		return TRUE;
 
@@ -1697,7 +1698,7 @@ novell_ssl_recv_cb(gpointer data, Purple
 		if (_is_disconnect_error(rc)) {
 
 			purple_connection_error_reason (gc,
-				PURPLE_REASON_NETWORK_ERROR,
+				PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 				_("Error communicating with server. Closing connection."));
 		} else {
 			purple_debug(PURPLE_DEBUG_INFO, "novell",
@@ -1737,7 +1738,8 @@ novell_ssl_connected_cb(gpointer data, P
 		conn->connected = TRUE;
 		purple_ssl_input_add(gsc, novell_ssl_recv_cb, gc);
 	} else {
-		purple_connection_error_reason (gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason (gc,
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Unable to connect to server."));
 	}
 
@@ -2020,9 +2022,10 @@ _evt_user_disconnect(NMUser * user, NMEv
 	{
 		if (!purple_account_get_remember_password(account))
 			purple_account_set_password(account, NULL);
-		purple_connection_error_reason (gc, PURPLE_REASON_NAME_IN_USE,
-									_("You have been logged out because you"
-									" logged in at another workstation."));
+		purple_connection_error_reason (gc,
+			PURPLE_CONNECTION_ERROR_NAME_IN_USE,
+			_("You have been logged out because you"
+			  " logged in at another workstation."));
 	}
 }
 
@@ -2176,7 +2179,8 @@ novell_login(PurpleAccount * account)
 		 */
 
 		/* ...but for now just error out with a nice message. */
-		purple_connection_error_reason (gc, PURPLE_REASON_INVALID_SETTINGS,
+		purple_connection_error_reason (gc,
+			PURPLE_CONNECTION_ERROR_INVALID_SETTINGS,
 			_("Unable to connect to server. Please enter the "
 			  "address of the server you wish to connect to."));
 		return;
@@ -2205,7 +2209,7 @@ novell_login(PurpleAccount * account)
 													  novell_ssl_connected_cb, novell_ssl_connect_error, gc);
 		if (user->conn->ssl_conn->data == NULL) {
 			purple_connection_error_reason (gc,
-				PURPLE_REASON_NO_SSL_SUPPORT,
+				PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT,
 				_("Error. SSL support is not installed."));
 		}
 	}
============================================================
--- libpurple/protocols/oscar/flap_connection.c	dbb0228c3e62ce7feeb6bbbe2e0eb550f3733614
+++ libpurple/protocols/oscar/flap_connection.c	cf2dbd710e86bab46706779633319636b1fdb1b7
@@ -380,10 +380,10 @@ flap_connection_destroy_cb(gpointer data
 	{
 		/* No more FLAP connections!  Sign off this PurpleConnection! */
 		gchar *tmp;
-		PurpleDisconnectReason reason = PURPLE_REASON_NETWORK_ERROR;
+		PurpleConnectionError reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR;
 
 		if (conn->disconnect_code == 0x0001) {
-			reason = PURPLE_REASON_NAME_IN_USE;
+			reason = PURPLE_CONNECTION_ERROR_NAME_IN_USE;
 			tmp = g_strdup(_("You have signed on from another location."));
 			if (!purple_account_get_remember_password(account))
 				purple_account_set_password(account, NULL);
============================================================
--- libpurple/protocols/oscar/oscar.c	b6226e39f3a32e4b99a5d1b7dcc4c475d49a3de1
+++ libpurple/protocols/oscar/oscar.c	8391ab8ac697d6c1e318c80227c0222bdedea858
@@ -994,7 +994,7 @@ connection_established_cb(gpointer data,
 			gchar *msg;
 			msg = g_strdup_printf(_("Could not connect to authentication server:\n%s"),
 					error_message);
-			purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR, msg);
+			purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, msg);
 			g_free(msg);
 		}
 		else if (conn->type == SNAC_FAMILY_LOCATE)
@@ -1002,7 +1002,7 @@ connection_established_cb(gpointer data,
 			gchar *msg;
 			msg = g_strdup_printf(_("Could not connect to BOS server:\n%s"),
 					error_message);
-			purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR, msg);
+			purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, msg);
 			g_free(msg);
 		}
 		else
@@ -1260,7 +1260,7 @@ oscar_login(PurpleAccount *account)
 	if (!aim_snvalid(purple_account_get_username(account))) {
 		gchar *buf;
 		buf = g_strdup_printf(_("Unable to login: Could not sign on as %s because the screen name is invalid.  Screen names must be a valid email address, or start with a letter and contain only letters, numbers and spaces, or contain only numbers."), purple_account_get_username(account));
-		purple_connection_error_reason(gc, PURPLE_REASON_INVALID_SETTINGS, buf);
+		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_INVALID_SETTINGS, buf);
 		g_free(buf);
 	}
 
@@ -1281,7 +1281,7 @@ oscar_login(PurpleAccount *account)
 			connection_established_cb, newconn);
 	if (newconn->connect_data == NULL)
 	{
-		purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 				_("Couldn't connect to host"));
 		return;
 	}
@@ -1343,37 +1343,37 @@ purple_parse_auth_resp(OscarData *od, Fl
 		switch (info->errorcode) {
 		case 0x01:
 			/* Unregistered screen name */
-			purple_connection_error_reason(gc, PURPLE_REASON_AUTHENTICATION_FAILED, _("Invalid screen name."));
+			purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, _("Invalid screen name."));
 			break;
 		case 0x05:
 			/* Incorrect password */
 			if (!purple_account_get_remember_password(account))
 				purple_account_set_password(account, NULL);
-			purple_connection_error_reason(gc, PURPLE_REASON_AUTHENTICATION_FAILED, _("Incorrect password."));
+			purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, _("Incorrect password."));
 			break;
 		case 0x11:
 			/* Suspended account */
-			purple_connection_error_reason(gc, PURPLE_REASON_AUTHENTICATION_FAILED, _("Your account is currently suspended."));
+			purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, _("Your account is currently suspended."));
 			break;
 		case 0x14:
 			/* service temporarily unavailable */
-			purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR, _("The AOL Instant Messenger service is temporarily unavailable."));
+			purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("The AOL Instant Messenger service is temporarily unavailable."));
 			break;
 		case 0x18:
 			/* screen name connecting too frequently */
-			purple_connection_error_reason(gc, PURPLE_REASON_OTHER_ERROR, _("You have been connecting and disconnecting too frequently. Wait ten minutes and try again. If you continue to try, you will need to wait even longer."));
+			purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, _("You have been connecting and disconnecting too frequently. Wait ten minutes and try again. If you continue to try, you will need to wait even longer."));
 			break;
 		case 0x1c:
 			/* client too old */
 			g_snprintf(buf, sizeof(buf), _("The client version you are using is too old. Please upgrade at %s"), PURPLE_WEBSITE);
-			purple_connection_error_reason(gc, PURPLE_REASON_OTHER_ERROR, buf);
+			purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, buf);
 			break;
 		case 0x1d:
 			/* IP address connecting too frequently */
-			purple_connection_error_reason(gc, PURPLE_REASON_OTHER_ERROR, _("You have been connecting and disconnecting too frequently. Wait ten minutes and try again. If you continue to try, you will need to wait even longer."));
+			purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, _("You have been connecting and disconnecting too frequently. Wait ten minutes and try again. If you continue to try, you will need to wait even longer."));
 			break;
 		default:
-			purple_connection_error_reason(gc, PURPLE_REASON_AUTHENTICATION_FAILED, _("Authentication failed"));
+			purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, _("Authentication failed"));
 			break;
 		}
 		purple_debug_info("oscar", "Login Error Code 0x%04hx\n", info->errorcode);
@@ -1403,7 +1403,7 @@ purple_parse_auth_resp(OscarData *od, Fl
 	g_free(host);
 	if (newconn->connect_data == NULL)
 	{
-		purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR, _("Could Not Connect"));
+		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Could Not Connect"));
 		return 0;
 	}
 
@@ -1428,7 +1428,8 @@ purple_parse_auth_securid_request_no_cb(
 	PurpleConnection *gc = user_data;
 
 	/* Disconnect */
-	purple_connection_error_reason(gc, PURPLE_REASON_AUTHENTICATION_FAILED,
+	purple_connection_error_reason(gc,
+		PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED,
 		_("The SecurID key entered is invalid."));
 }
 
============================================================
--- libpurple/protocols/qq/keep_alive.c	154aff8cde963b9cb3e6bab4162b2beb6bf067a1
+++ libpurple/protocols/qq/keep_alive.c	028329a307b727053d5dbdb45518c183d71dff4b
@@ -84,7 +84,7 @@ void qq_process_keep_alive_reply(guint8 
 		/* segments[0] and segment[1] are all 0x30 ("0") */
 		qd->all_online = strtol(segments[2], NULL, 10);
 		if(0 == qd->all_online)
-			purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR,
+			purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 					_("Keep alive error"));
 		g_free(qd->my_ip);
 		qd->my_ip = g_strdup(segments[3]);
============================================================
--- libpurple/protocols/qq/login_logout.c	870770b590aecf1026ae7401753a94d9513bb0be
+++ libpurple/protocols/qq/login_logout.c	5e5f4bae740b66f579d583e21eaae8bed58f1b0b
@@ -405,7 +405,7 @@ void qq_process_request_login_token_repl
 				">>> %d bytes -> [default] decrypt and dump\n%s",
 				buf_len, hex_dump);
 		try_dump_as_gbk(buf, buf_len);
-		purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR, _("Error requesting login token"));
+		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Error requesting login token"));
 	}
 	g_free(hex_dump);
 }
@@ -482,11 +482,11 @@ void qq_process_login_reply(guint8 *buf,
 		if (!purple_account_get_remember_password(gc->account))
 			purple_account_set_password(gc->account, NULL);
 		purple_connection_error_reason(gc,
-			PURPLE_REASON_AUTHENTICATION_FAILED, _("Incorrect password."));
+			PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, _("Incorrect password."));
 		break;
 	case QQ_LOGIN_REPLY_MISC_ERROR:
 		purple_connection_error_reason(gc,
-			PURPLE_REASON_NETWORK_ERROR, _("Unable to login, check debug log"));
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Unable to login, check debug log"));
 		break;
 	case QQ_LOGIN_REPLY_OK:
 		purple_debug(PURPLE_DEBUG_INFO, "QQ", "Login replys OK, everything is fine\n");
============================================================
--- libpurple/protocols/qq/qq.c	dbf9f032010e4a4644dbc2bdcfede7f1fb4d6230
+++ libpurple/protocols/qq/qq.c	bbe241523ebf533b2002d767020c7090d2c9a41d
@@ -136,7 +136,7 @@ static void _qq_login(PurpleAccount *acc
 	purple_connection_update_progress(gc, _("Connecting"), 0, QQ_CONNECT_STEPS);
 
 	if (qq_connect(account, qq_server, strtol(qq_port, NULL, 10), use_tcp, FALSE) < 0)
-		purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Unable to connect."));
 }
 
============================================================
--- libpurple/protocols/qq/qq_proxy.c	d487c77f9d5c8a3d30d24a4cc61c878fa7d46d28
+++ libpurple/protocols/qq/qq_proxy.c	05696e419913ac285a6fa4af9b522f084474d1b5
@@ -139,7 +139,7 @@ static void _qq_got_login(gpointer data,
 	g_return_if_fail(gc != NULL && gc->proto_data != NULL);
 
 	if (source < 0) {	/* socket returns -1 */
-		purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR, error_message);
+		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, error_message);
 		return;
 	}
 
@@ -494,7 +494,7 @@ gint qq_proxy_write(qq_data *qd, guint8 
 		ret = send(qd->fd, data, len, 0);
 	}
 	if (ret == -1)
-		purple_connection_error_reason(qd->gc, PURPLE_REASON_NETWORK_ERROR, strerror(errno));
+		purple_connection_error_reason(qd->gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, strerror(errno));
 
 	return ret;
 }
============================================================
--- libpurple/protocols/qq/recv_core.c	ecdc74aa8695b16248be8fae2f3ec8c9eb960f8c
+++ libpurple/protocols/qq/recv_core.c	c8890a830dc15d393d5a2d6c7c61fdd9baf6e4fe
@@ -306,7 +306,7 @@ void qq_input_pending(gpointer data, gin
 	gc = (PurpleConnection *) data;
 
 	if(cond != PURPLE_INPUT_READ) {
-		purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Socket error"));
 		return;
 	}
@@ -317,7 +317,7 @@ void qq_input_pending(gpointer data, gin
 	/* here we have UDP proxy suppport */
 	len = qq_proxy_read(qd, buf, MAX_PACKET_SIZE);
 	if (len <= 0) {
-		purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Unable to read from socket"));
 		return;
 	} else {
============================================================
--- libpurple/protocols/qq/sendqueue.c	fe217a782c40460f8163b6d422cefe56ee22f2e4
+++ libpurple/protocols/qq/sendqueue.c	1e1281845e07c668525c01370bf3510afe60757d
@@ -121,7 +121,7 @@ gboolean qq_sendqueue_timeout_callback(g
 				if (qd->logged_in) {
 					purple_debug(PURPLE_DEBUG_ERROR, "QQ", "Connection lost!\n");
 					purple_connection_error_reason(gc,
-						PURPLE_REASON_NETWORK_ERROR, _("Connection lost"));
+						PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Connection lost"));
 					qd->logged_in = FALSE;
 				}
 				p->resend_times = -1;
@@ -130,7 +130,7 @@ gboolean qq_sendqueue_timeout_callback(g
 			case QQ_CMD_REQUEST_LOGIN_TOKEN:
 				if (!qd->logged_in)	/* cancel login progress */
 					purple_connection_error_reason(gc,
-						PURPLE_REASON_NETWORK_ERROR, _("Login failed, no reply"));
+						PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Login failed, no reply"));
 				p->resend_times = -1;
 				break;
 			default:{
============================================================
--- libpurple/protocols/sametime/sametime.c	f72412ca1f412681700eda65845e9ffb76d51199
+++ libpurple/protocols/sametime/sametime.c	5f019a4b9370faf5bbc0e542169f784bd12be306
@@ -414,7 +414,8 @@ static int mw_session_io_write(struct mw
 
   } else if(len > 0) {
     DEBUG_ERROR("write returned %i, %i bytes left unwritten\n", ret, len);
-    purple_connection_error_reason(pd->gc, PURPLE_REASON_NETWORK_ERROR,
+    purple_connection_error_reason(pd->gc,
+                                   PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
                                    _("Connection closed (writing)"));
 
 #if 0
@@ -1553,36 +1554,36 @@ static void mw_session_stateChange(struc
 
     if(GPOINTER_TO_UINT(info) & ERR_FAILURE) {
       char *err = mwError(GPOINTER_TO_UINT(info));
-      PurpleDisconnectReason reason;
+      PurpleConnectionError reason;
       switch (GPOINTER_TO_UINT(info)) {
       case VERSION_MISMATCH:
-        reason = PURPLE_REASON_OTHER_ERROR;
+        reason = PURPLE_CONNECTION_ERROR_OTHER_ERROR;
         break;
 
       case USER_RESTRICTED:
       case INCORRECT_LOGIN:
       case USER_UNREGISTERED:
       case GUEST_IN_USE:
-        reason = PURPLE_REASON_AUTHENTICATION_FAILED;
+        reason = PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED;
         break;
 
       case ENCRYPT_MISMATCH:
       case ERR_ENCRYPT_NO_SUPPORT:
       case ERR_NO_COMMON_ENCRYPT:
-        reason = PURPLE_REASON_ENCRYPTION_ERROR;
+        reason = PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR;
         break;
 
       case VERIFICATION_DOWN:
-        reason = PURPLE_REASON_AUTHENTICATION_IMPOSSIBLE;
+        reason = PURPLE_CONNECTION_ERROR_AUTHENTICATION_IMPOSSIBLE;
         break;
 
       case MULTI_SERVER_LOGIN:
       case MULTI_SERVER_LOGIN2:
-        reason = PURPLE_REASON_NAME_IN_USE;
+        reason = PURPLE_CONNECTION_ERROR_NAME_IN_USE;
         break;
 
       default:
-        reason = PURPLE_REASON_NETWORK_ERROR;
+        reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR;
       }
       purple_connection_error_reason(gc, reason, err);
       g_free(err);
@@ -1732,7 +1733,9 @@ static void read_cb(gpointer data, gint 
   if(! ret) {
     const char *msg = _("Connection reset");
     DEBUG_INFO("connection reset\n");
-    purple_connection_error_reason(pd->gc, PURPLE_REASON_NETWORK_ERROR, msg);
+    purple_connection_error_reason(pd->gc,
+                                   PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
+                                   msg);
 
   } else if(ret < 0) {
     char *msg = strerror(err);
@@ -1740,7 +1743,9 @@ static void read_cb(gpointer data, gint 
     DEBUG_INFO("error in read callback: %s\n", msg);
 
     msg = g_strdup_printf(_("Error reading from socket: %s"), msg);
-    purple_connection_error_reason(pd->gc, PURPLE_REASON_NETWORK_ERROR, msg);
+    purple_connection_error_reason(pd->gc,
+                                   PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
+                                   msg);
     g_free(msg);
   }
 }
@@ -1763,7 +1768,9 @@ static void connect_cb(gpointer data, gi
     } else {
       /* this is a regular connect, error out */
       const char *msg = _("Unable to connect to host");
-      purple_connection_error_reason(pd->gc, PURPLE_REASON_NETWORK_ERROR, msg);
+      purple_connection_error_reason(pd->gc,
+                                     PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
+                                     msg);
     }
 
     return;
@@ -3646,7 +3653,9 @@ static void prompt_host_cancel_cb(Purple
 
 static void prompt_host_cancel_cb(PurpleConnection *gc) {
   const char *msg = _("No Sametime Community Server specified");
-  purple_connection_error_reason(gc, PURPLE_REASON_INVALID_SETTINGS, msg);
+  purple_connection_error_reason(gc,
+                                 PURPLE_CONNECTION_ERROR_INVALID_SETTINGS,
+                                 msg);
 }
 
 
@@ -3758,7 +3767,7 @@ static void mw_prpl_login(PurpleAccount 
   purple_connection_update_progress(gc, _("Connecting"), 1, MW_CONNECT_STEPS);
 
   if (purple_proxy_connect(gc, account, host, port, connect_cb, pd) == NULL) {
-    purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR,
+    purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
                                    _("Unable to connect to host"));
   }
 }
============================================================
--- libpurple/protocols/silc/silc.c	666df1b86ec209ccfa862d0f5959de93dd725b74
+++ libpurple/protocols/silc/silc.c	c7914932bb04dd3445ce3777c5647b0a63f54ec8
@@ -215,7 +215,7 @@ silcpurple_connect_cb(SilcClient client,
 		/* Close the connection */
 		if (!sg->detaching)
 		  purple_connection_error_reason(gc,
-		                                 PURPLE_REASON_NETWORK_ERROR,
+		                                 PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 		                                 _("Disconnected by server"));
 		else
 		  /* TODO: Does this work correctly? Maybe we need to set wants_to_die? */
@@ -223,30 +223,30 @@ silcpurple_connect_cb(SilcClient client,
 		break;
 
 	case SILC_CLIENT_CONN_ERROR:
-		purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 		                             _("Error during connecting to SILC Server"));
 		g_unlink(silcpurple_session_file(purple_account_get_username(sg->account)));
 		break;
 
 	case SILC_CLIENT_CONN_ERROR_KE:
-		purple_connection_error_reason(gc, PURPLE_REASON_ENCRYPTION_ERROR,
+		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR,
 		                             _("Key Exchange failed"));
 		break;
 
 	case SILC_CLIENT_CONN_ERROR_AUTH:
-		purple_connection_error_reason(gc, PURPLE_REASON_AUTHENTICATION_FAILED,
+		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED,
 		                             _("Authentication failed"));
 		break;
 
 	case SILC_CLIENT_CONN_ERROR_RESUME:
-		purple_connection_error_reason(gc, PURPLE_REASON_OTHER_ERROR,
+		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR,
 		                             _("Resuming detached session failed. "
 		                               "Press Reconnect to create new connection."));
 		g_unlink(silcpurple_session_file(purple_account_get_username(sg->account)));
 		break;
 
 	case SILC_CLIENT_CONN_ERROR_TIMEOUT:
-		purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 		                             _("Connection Timeout"));
 		break;
 	}
@@ -268,7 +268,7 @@ silcpurple_stream_created(SilcSocketStre
 	sg = gc->proto_data;
 
 	if (status != SILC_SOCKET_OK) {
-		purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 		                             _("Connection failed"));
 		silc_pkcs_public_key_free(sg->public_key);
 		silc_pkcs_private_key_free(sg->private_key);
@@ -315,7 +315,7 @@ silcpurple_login_connected(gpointer data
 	sg = gc->proto_data;
 
 	if (source < 0) {
-		purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 		                             _("Connection failed"));
 		silc_pkcs_public_key_free(sg->public_key);
 		silc_pkcs_private_key_free(sg->private_key);
@@ -357,7 +357,7 @@ static void silcpurple_running(SilcClien
 				(char *)purple_account_get_string(account, "private-key", prd),
 				(gc->password == NULL) ? "" : gc->password,
 				&sg->public_key, &sg->private_key)) {
-		purple_connection_error_reason(gc, PURPLE_REASON_OTHER_ERROR,
+		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR,
 		                             _("Could not load SILC key pair"));
 		gc->proto_data = NULL;
 		silc_free(sg);
@@ -371,7 +371,7 @@ static void silcpurple_running(SilcClien
 				 purple_account_get_int(account, "port", 706),
 				 silcpurple_login_connected, gc) == NULL)
 	{
-		purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 		                             _("Unable to create connection"));
 		gc->proto_data = NULL;
 		silc_free(sg);
@@ -401,7 +401,7 @@ silcpurple_login(PurpleAccount *account)
 	/* Allocate SILC client */
 	client = silc_client_alloc(&ops, &params, gc, NULL);
 	if (!client) {
-		purple_connection_error_reason(gc, PURPLE_REASON_OTHER_ERROR,
+		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR,
 		                             _("Out of memory"));
 		return;
 	}
@@ -444,14 +444,14 @@ silcpurple_login(PurpleAccount *account)
 	/* Init SILC client */
 	if (!silc_client_init(client, username, hostname, realname,
 			      silcpurple_running, account)) {
-		purple_connection_error_reason(gc, PURPLE_REASON_OTHER_ERROR,
+		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR,
 		                             _("Cannot initialize SILC protocol"));
 		return;
 	}
 
 	/* Check the ~/.silc dir and create it, and new key pair if necessary. */
 	if (!silcpurple_check_silc_dir(gc)) {
-		purple_connection_error_reason(gc, PURPLE_REASON_OTHER_ERROR,
+		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR,
 		                             _("Error loading SILC key pair"));
 		return;
 	}
============================================================
--- libpurple/protocols/silc/util.c	59ef50b5eae7e4de46d5e69bd3d2ae5aca8106e9
+++ libpurple/protocols/silc/util.c	a423db51eabf3156d32e5301349909ea5226ed26
@@ -212,7 +212,7 @@ gboolean silcpurple_check_silc_dir(Purpl
 						  (gc->password == NULL)
 						  ? "" : gc->password,
 						  NULL, NULL, FALSE)) {
-				purple_connection_error_reason(gc, PURPLE_REASON_OTHER_ERROR,
+				purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR,
 				                             _("Cannot create SILC key pair\n"));
 				return FALSE;
 			}
@@ -255,7 +255,7 @@ gboolean silcpurple_check_silc_dir(Purpl
 						  (gc->password == NULL)
 						  ? "" : gc->password,
 						  NULL, NULL, FALSE)) {
-				purple_connection_error_reason(gc, PURPLE_REASON_OTHER_ERROR,
+				purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR,
 				                             _("Cannot create SILC key pair\n"));
 				return FALSE;
 			}
============================================================
--- libpurple/protocols/simple/simple.c	c95fcc1223b9e505625f9c0f4570a6bd2b62b751
+++ libpurple/protocols/simple/simple.c	590a6c365d3d0dbcdb5228061298f06ea78ed761
@@ -413,7 +413,8 @@ static void simple_canwrite_cb(gpointer 
 		written = 0;
 	else if(written <= 0) {
 		/*TODO: do we really want to disconnect on a failure to write?*/
-		purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason(gc,
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Could not write"));
 		return;
 	}
@@ -436,7 +437,8 @@ static void send_later_cb(gpointer data,
 	}
 
 	if(source < 0) {
-		purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason(gc,
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Could not connect"));
 		return;
 	}
@@ -463,7 +465,7 @@ static void sendlater(PurpleConnection *
 	if(!sip->connecting) {
 		purple_debug_info("simple", "connecting to %s port %d\n", sip->realhostname ? sip->realhostname : "{NULL}", sip->realport);
 		if (purple_proxy_connect(gc, sip->account, sip->realhostname, sip->realport, send_later_cb, gc) == NULL) {
-			purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR, _("Couldn't create socket"));
+			purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Couldn't create socket"));
 		}
 		sip->connecting = TRUE;
 	}
@@ -1045,7 +1047,7 @@ gboolean process_register_response(struc
 					if (!purple_account_get_remember_password(sip->gc->account))
 						purple_account_set_password(sip->gc->account, NULL);
 					purple_connection_error_reason(sip->gc,
-						PURPLE_REASON_AUTHENTICATION_FAILED,
+						PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED,
 						_("Incorrect password."));
 					return TRUE;
 				}
@@ -1059,7 +1061,8 @@ gboolean process_register_response(struc
 			if (sip->registerstatus != SIMPLE_REGISTER_RETRY) {
 				purple_debug_info("simple", "Unrecognized return code for REGISTER.\n");
 				if (sip->registrar.retries > SIMPLE_REGISTER_RETRY_MAX) {
-					purple_connection_error_reason(sip->gc, PURPLE_REASON_OTHER_ERROR,
+					purple_connection_error_reason(sip->gc,
+						PURPLE_CONNECTION_ERROR_OTHER_ERROR,
 						_("Unknown server response."));
 					return TRUE;
 				}
@@ -1530,7 +1533,8 @@ static void login_cb(gpointer data, gint
 	}
 
 	if(source < 0) {
-		purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason(gc,
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Could not connect"));
 		return;
 	}
@@ -1565,7 +1569,8 @@ static void simple_udp_host_resolved_lis
 	sip->listen_data = NULL;
 
 	if(listenfd == -1) {
-		purple_connection_error_reason(sip->gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason(sip->gc,
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Could not create listen socket"));
 		return;
 	}
@@ -1590,7 +1595,7 @@ static void simple_udp_host_resolved(GSL
 
 	if (!hosts || !hosts->data) {
 		purple_connection_error_reason(sip->gc,
-			PURPLE_REASON_NETWORK_ERROR,
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Couldn't resolve host"));
 		return;
 	}
@@ -1611,7 +1616,7 @@ static void simple_udp_host_resolved(GSL
 				simple_udp_host_resolved_listen_cb, sip);
 	if (sip->listen_data == NULL) {
 		purple_connection_error_reason(sip->gc,
-			PURPLE_REASON_NETWORK_ERROR,
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Could not create listen socket"));
 		return;
 	}
@@ -1626,7 +1631,7 @@ simple_tcp_connect_listen_cb(int listenf
 	sip->listenfd = listenfd;
 	if(sip->listenfd == -1) {
 		purple_connection_error_reason(sip->gc,
-			PURPLE_REASON_NETWORK_ERROR,
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Could not create listen socket"));
 		return;
 	}
@@ -1641,7 +1646,7 @@ simple_tcp_connect_listen_cb(int listenf
 	if (purple_proxy_connect(sip->gc, sip->account, sip->realhostname,
 			sip->realport, login_cb, sip->gc) == NULL) {
 		purple_connection_error_reason(sip->gc,
-			PURPLE_REASON_NETWORK_ERROR,
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Couldn't create socket"));
 	}
 }
@@ -1680,7 +1685,8 @@ static void srvresolved(PurpleSrvRespons
 		sip->listen_data = purple_network_listen_range(5060, 5160, SOCK_STREAM,
 					simple_tcp_connect_listen_cb, sip);
 		if (sip->listen_data == NULL) {
-			purple_connection_error_reason(sip->gc, PURPLE_REASON_NETWORK_ERROR,
+			purple_connection_error_reason(sip->gc,
+				PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 				_("Could not create listen socket"));
 			return;
 		}
@@ -1689,7 +1695,8 @@ static void srvresolved(PurpleSrvRespons
 
 		sip->query_data = purple_dnsquery_a(hostname, port, simple_udp_host_resolved, sip);
 		if (sip->query_data == NULL) {
-			purple_connection_error_reason(sip->gc, PURPLE_REASON_NETWORK_ERROR,
+			purple_connection_error_reason(sip->gc,
+				PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 				_("Could not resolve hostname"));
 		}
 	}
@@ -1706,7 +1713,8 @@ static void simple_login(PurpleAccount *
 	gc = purple_account_get_connection(account);
 
 	if (strpbrk(username, " \t\v\r\n") != NULL) {
-		purple_connection_error_reason(gc, PURPLE_REASON_INVALID_SETTINGS,
+		purple_connection_error_reason(gc,
+			PURPLE_CONNECTION_ERROR_INVALID_SETTINGS,
 			_("SIP screen names may not contain whitespaces or @ symbols"));
 		return;
 	}
============================================================
--- libpurple/protocols/yahoo/yahoo.c	838c233654920c67deec93bfa9a67d71b0d7d2b9
+++ libpurple/protocols/yahoo/yahoo.c	291d5bc259749f2e8aa597675a81cefd14768890
@@ -203,7 +203,7 @@ static void yahoo_process_status(PurpleC
 	if (pkt->service == YAHOO_SERVICE_LOGOFF && pkt->status == -1) {
 		if (!purple_account_get_remember_password(account))
 			purple_account_set_password(account, NULL);
-		purple_connection_error_reason(gc, PURPLE_REASON_NAME_IN_USE,
+		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NAME_IN_USE,
 			_("You have signed on from another location."));
 		return;
 	}
@@ -2139,7 +2139,7 @@ static void yahoo_process_authresp(Purpl
 	else
 		fullmsg = g_strdup(msg);
 
-	purple_connection_error_reason(gc, PURPLE_REASON_AUTHENTICATION_FAILED, fullmsg);
+	purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, fullmsg);
 	g_free(msg);
 	g_free(fullmsg);
 }
@@ -2463,11 +2463,11 @@ static void yahoo_pending(gpointer data,
 
 		tmp = g_strdup_printf(_("Lost connection with server:\n%s"),
 				strerror(errno));
-		purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR, tmp);
+		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
 		g_free(tmp);
 		return;
 	} else if (len == 0) {
-		purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 				_("Server closed the connection."));
 		return;
 	}
@@ -2559,7 +2559,7 @@ static void yahoo_got_connected(gpointer
 		gchar *tmp;
 		tmp = g_strdup_printf(_("Could not establish a connection with the server:\n%s"),
 				error_message);
-		purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR, tmp);
+		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
 		g_free(tmp);
 		return;
 	}
@@ -2591,7 +2591,7 @@ static void yahoo_got_web_connected(gpoi
 		gchar *tmp;
 		tmp = g_strdup_printf(_("Could not establish a connection with the server:\n%s"),
 				error_message);
-		purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR, tmp);
+		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
 		g_free(tmp);
 		return;
 	}
@@ -2631,11 +2631,11 @@ static void yahoo_web_pending(gpointer d
 
 		tmp = g_strdup_printf(_("Lost connection with server:\n%s"),
 				strerror(errno));
-		purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR, tmp);
+		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
 		g_free(tmp);
 		return;
 	} else if (len == 0) {
-		purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Server closed the connection."));
 		return;
 	}
@@ -2651,7 +2651,7 @@ static void yahoo_web_pending(gpointer d
 
 	if ((strncmp(buf, "HTTP/1.0 302", strlen("HTTP/1.0 302")) &&
 			  strncmp(buf, "HTTP/1.1 302", strlen("HTTP/1.1 302")))) {
-		purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Received unexpected HTTP response from server."));
 		return;
 	}
@@ -2676,7 +2676,7 @@ static void yahoo_web_pending(gpointer d
 	if (purple_proxy_connect(gc, account, "wcs2.msg.dcn.yahoo.com",
 	                         purple_account_get_int(account, "port", YAHOO_PAGER_PORT),
 	                         yahoo_got_web_connected, gc) == NULL) {
-		purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 		                               _("Connection problem"));
 		return;
 	}
@@ -2705,7 +2705,7 @@ static void yahoo_got_cookies_send_cb(gp
 		gc->inpa = 0;
 		tmp = g_strdup_printf(_("Lost connection with %s:\n%s"),
 				"login.yahoo.com:80", strerror(errno));
-		purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR, tmp);
+		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
 		g_free(tmp);
 		return;
 	}
@@ -2730,7 +2730,7 @@ static void yahoo_got_cookies(gpointer d
 		gchar *tmp;
 		tmp = g_strdup_printf(_("Could not establish a connection with %s:\n%s"),
 				"login.yahoo.com:80", error_message);
-		purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR, tmp);
+		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
 		g_free(tmp);
 		return;
 	}
@@ -2814,7 +2814,7 @@ yahoo_login_page_cb(PurpleUtilFetchUrlDa
 
 	if (error_message != NULL)
 	{
-		purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 		                               error_message);
 		return;
 	}
@@ -2864,7 +2864,7 @@ yahoo_login_page_cb(PurpleUtilFetchUrlDa
 	g_hash_table_destroy(hash);
 	yd->auth = g_string_free(url, FALSE);
 	if (purple_proxy_connect(gc, account, "login.yahoo.com", 80, yahoo_got_cookies, gc) == NULL) {
-		purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 		                               _("Connection problem"));
 		return;
 	}
@@ -2968,7 +2968,7 @@ static void yahoo_login(PurpleAccount *a
 		                       purple_account_get_int(account, "port", YAHOO_PAGER_PORT),
 		                       yahoo_got_connected, gc) == NULL)
 		{
-			purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR,
+			purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			                               _("Connection problem"));
 			return;
 		}
@@ -2979,7 +2979,7 @@ static void yahoo_login(PurpleAccount *a
 		                       purple_account_get_int(account, "port", YAHOO_PAGER_PORT),
 		                       yahoo_got_connected, gc) == NULL)
 		{
-			purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR,
+			purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			                               _("Connection problem"));
 			return;
 		}
============================================================
--- libpurple/protocols/yahoo/yahoo_packet.c	6b59837050f7ca30a7ebf3ee15341c8c7078780b
+++ libpurple/protocols/yahoo/yahoo_packet.c	fcfd2cadced5e018e80fadd2910c05e3173baad3
@@ -304,7 +304,7 @@ yahoo_packet_send_can_write(gpointer dat
 		return;
 	else if (ret < 0) {
 		/* TODO: what to do here - do we really have to disconnect? */
-		purple_connection_error_reason(yd->gc, PURPLE_REASON_NETWORK_ERROR,
+		purple_connection_error_reason(yd->gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 		                               _("Write Error"));
 		return;
 	}
============================================================
--- libpurple/protocols/yahoo/ycht.c	c29abc3d1660ccc3767d3ea32a9861756bc6ce67
+++ libpurple/protocols/yahoo/ycht.c	f368516832a1f78ebe9809e5326502ed91324de6
@@ -286,7 +286,7 @@ static void ycht_packet_send_write_cb(gp
 		/* TODO: error handling */
 /*
 		purple_connection_error_reason(purple_account_get_connection(irc->account),
-			      PURPLE_REASON_NETWORK_ERROR,
+			      PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			      _("Server has disconnected"));
 */
 		return;
============================================================
--- pidgin/gtkconn.c	c6b9349b7df710dc9118b7626f95ae2b3add0278
+++ pidgin/gtkconn.c	1849b019933b67460d67529ee412ac025582859c
@@ -139,7 +139,7 @@ pidgin_connection_report_disconnect_reas
 
 static void
 pidgin_connection_report_disconnect_reason (PurpleConnection *gc,
-                                            PurpleDisconnectReason reason,
+                                            PurpleConnectionError reason,
                                             const char *text)
 {
 	PurpleAccount *account = NULL;
@@ -150,7 +150,7 @@ pidgin_connection_report_disconnect_reas
 	info = g_hash_table_lookup(auto_reconns, account);
 
 	pidgin_blist_update_account_error_state(account, text);
-	if (!purple_connection_reason_is_fatal (reason)) {
+	if (!purple_connection_error_is_fatal (reason)) {
 		if (info == NULL) {
 			info = g_new0(PidginAutoRecon, 1);
 			g_hash_table_insert(auto_reconns, account, info);
@@ -183,7 +183,7 @@ pidgin_connection_report_disconnect_reas
 		p = g_strdup_printf(_("%s disconnected"), n);
 		switch (reason)
 		{
-			case PURPLE_REASON_NO_SSL_SUPPORT:
+			case PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT:
 				s = g_strdup_printf(
 					_("%s\n\n"
 					"%s will not attempt to reconnect the account until you "
@@ -191,7 +191,7 @@ pidgin_connection_report_disconnect_reas
 					"compile %s with SSL support."), text, PIDGIN_NAME,
 					"http://developer.pidgin.im/wiki/FAQssl", PIDGIN_NAME);
 				break;
-			case PURPLE_REASON_NAME_IN_USE:
+			case PURPLE_CONNECTION_ERROR_NAME_IN_USE:
 				s = g_strdup_printf(
 					_("%s\n\n"
 					"%s will not attempt to reconnect the account until you "


More information about the Commits mailing list