pidgin: 7cdcde5a: Similar connection error message changes...

markdoliner at pidgin.im markdoliner at pidgin.im
Mon Jul 6 05:15:53 EDT 2009


-----------------------------------------------------------------
Revision: 7cdcde5a63cc2b7840b493177a5b9c56d6918824
Ancestor: 84fc690990052c6d46d2a83019425e8cfb7b3358
Author: markdoliner at pidgin.im
Date: 2009-07-06T05:28:59
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/7cdcde5a63cc2b7840b493177a5b9c56d6918824

Modified files:
        libpurple/protocols/irc/irc.c

ChangeLog: 

Similar connection error message changes for IRC.  These are hopefully
more understandable for plain humans, and I think some of them also
overlap with existing strings in oscar.

-------------- next part --------------
============================================================
--- libpurple/protocols/irc/irc.c	78d37afcbc05786bdb3a73cb769a439fdb101f4a
+++ libpurple/protocols/irc/irc.c	06ad65b86e4e1416ecde36e62723799c85900319
@@ -122,9 +122,11 @@ irc_send_cb(gpointer data, gint source, 
 		return;
 	else if (ret <= 0) {
 		PurpleConnection *gc = purple_account_get_connection(irc->account);
+		gchar *tmp = g_strdup_printf(_("Lost connection with server: %s"),
+			g_strerror(errno));
 		purple_connection_error_reason (gc,
-			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
-			_("Server has disconnected"));
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
+		g_free(tmp);
 		return;
 	}
 
@@ -162,9 +164,11 @@ 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);
+		gchar *tmp = g_strdup_printf(_("Lost connection with server: %s"),
+			g_strerror(errno));
 		purple_connection_error_reason (gc,
-			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
-			_("Server has disconnected"));
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
+		g_free(tmp);
 	} else if (ret < buflen) {
 		if (ret < 0)
 			ret = 0;
@@ -350,7 +354,7 @@ static void irc_login(PurpleAccount *acc
 		{
 			purple_connection_error_reason (gc,
 				PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
-				_("Couldn't create socket"));
+				_("Unable to create socket"));
 			return;
 		}
 	}
@@ -446,9 +450,11 @@ static void irc_login_cb(gpointer data, 
 	struct irc_conn *irc = gc->proto_data;
 
 	if (source < 0) {
+		gchar *tmp = g_strdup_printf(_("Unable to connect: %s"),
+			error_message);
 		purple_connection_error_reason (gc,
-			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
-			_("Couldn't connect to host"));
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
+		g_free(tmp);
 		return;
 	}
 
@@ -635,14 +641,16 @@ static void irc_input_cb_ssl(gpointer da
 		/* Try again later */
 		return;
 	} else if (len < 0) {
+		gchar *tmp = g_strdup_printf(_("Lost connection with server: %s"),
+				g_strerror(errno));
 		purple_connection_error_reason (gc,
-			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
-			_("Read error"));
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
+		g_free(tmp);
 		return;
 	} else if (len == 0) {
 		purple_connection_error_reason (gc,
 			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
-			_("Server has disconnected"));
+			_("Server closed the connection"));
 		return;
 	}
 
@@ -664,14 +672,16 @@ static void irc_input_cb(gpointer data, 
 	if (len < 0 && errno == EAGAIN) {
 		return;
 	} else if (len < 0) {
+		gchar *tmp = g_strdup_printf(_("Lost connection with server: %s"),
+				g_strerror(errno));
 		purple_connection_error_reason (gc,
-			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
-			_("Read error"));
+			PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
+		g_free(tmp);
 		return;
 	} else if (len == 0) {
 		purple_connection_error_reason (gc,
 			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
-			_("Server has disconnected"));
+			_("Server closed the connection"));
 		return;
 	}
 


More information about the Commits mailing list