# HG changeset patch # User Mark Doliner # Date 1246858139 0 # Node ID 2873ee6a960d69bd0292d9a73325731e011683f5 # Parent 7fd1b4c7331038da33a956a2cb86c0b6a910d188 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. diff -r 7fd1b4c73310 -r 2873ee6a960d libpurple/protocols/irc/irc.c --- a/libpurple/protocols/irc/irc.c Mon Jul 06 05:27:08 2009 +0000 +++ b/libpurple/protocols/irc/irc.c Mon Jul 06 05:28:59 2009 +0000 @@ -122,9 +122,11 @@ 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 @@ 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 @@ { purple_connection_error_reason (gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Couldn't create socket")); + _("Unable to create socket")); return; } } @@ -446,9 +450,11 @@ 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 @@ /* 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 @@ 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; }