diff libpurple/protocols/jabber/bosh.c @ 27381:f541583e31bd

More uniformity among disconnect error messages
author Mark Doliner <mark@kingant.net>
date Mon, 06 Jul 2009 09:07:42 +0000
parents 708f92703a13
children 70dcaa0b6fea
line wrap: on
line diff
--- a/libpurple/protocols/jabber/bosh.c	Mon Jul 06 07:26:12 2009 +0000
+++ b/libpurple/protocols/jabber/bosh.c	Mon Jul 06 09:07:42 2009 +0000
@@ -354,7 +354,7 @@
 
 	if (type != NULL && !strcmp(type, "terminate")) {
 		conn->ready = FALSE;
-		purple_connection_error_reason (conn->js->gc,
+		purple_connection_error_reason(conn->js->gc,
 			PURPLE_CONNECTION_ERROR_OTHER_ERROR,
 			_("The BOSH connection manager terminated your session."));
 		return TRUE;
@@ -783,7 +783,7 @@
 
 	if (source < 0) {
 		gchar *tmp;
-		tmp = g_strdup_printf(_("Could not establish a connection with the server:\n%s"),
+		tmp = g_strdup_printf(_("Unable to establish a connection with the server: %s"),
 		        error);
 		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
 		g_free(tmp);
@@ -822,7 +822,7 @@
 	                                 connection_established_cb, conn) == NULL) {
 		purple_connection_error_reason(gc,
 		    PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
-		    _("Unable to create socket"));
+		    _("Unable to connect"));
 	}
 }
 
@@ -862,9 +862,12 @@
 		 * buffer that stores what is "being sent" until the
 		 * PurpleHTTPConnection reports it is fully sent.
 		 */
+		gchar *tmp = g_strdup_printf(_("Lost connection with server: %s"),
+				g_strerror(errno));
 		purple_connection_error_reason(conn->bosh->js->gc,
 				PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
-				_("Write error"));
+				tmp);
+		g_free(tmp);
 		return;
 	}
 
@@ -905,9 +908,12 @@
 		 * buffer that stores what is "being sent" until the
 		 * PurpleHTTPConnection reports it is fully sent.
 		 */
+		gchar *tmp = g_strdup_printf(_("Lost connection with server: %s"),
+				g_strerror(errno));
 		purple_connection_error_reason(conn->bosh->js->gc,
 				PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
-				_("Write error"));
+				tmp);
+		g_free(tmp);
 		return;
 	} else if (ret < len) {
 		if (ret < 0)