Mercurial > pidgin.yaz
changeset 27455:2873ee6a960d
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.
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Mon, 06 Jul 2009 05:28:59 +0000 |
parents | 7fd1b4c73310 |
children | fe912af02ff6 |
files | libpurple/protocols/irc/irc.c |
diffstat | 1 files changed, 23 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- 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; }