Mercurial > pidgin
changeset 27382:09772222714a
merge of '599603c54f97d6978ff312a4ff140857302b0033'
and '85d6ddccd30dc452a4afcd6adc18d9369901b646'
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Mon, 06 Jul 2009 09:08:17 +0000 |
parents | c374d57b3215 (current diff) f541583e31bd (diff) |
children | ecf2dec4ef5e |
files | libpurple/protocols/yahoo/libymsg.c libpurple/protocols/yahoo/yahoo.c libpurple/protocols/yahoo/yahoo.h libpurple/protocols/yahoo/ycht.c |
diffstat | 33 files changed, 362 insertions(+), 322 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/protocols/bonjour/bonjour.c Mon Jul 06 06:04:34 2009 +0000 +++ b/libpurple/protocols/bonjour/bonjour.c Mon Jul 06 09:08:17 2009 +0000 @@ -89,13 +89,12 @@ #ifdef _WIN32 if (!dns_sd_available()) { purple_connection_error_reason(gc, - PURPLE_CONNECTION_ERROR_OTHER_ERROR, - _("The Apple Bonjour For Windows toolkit wasn't found, see the FAQ at: " - "http://d.pidgin.im/BonjourWindows" - " for more information.")); + PURPLE_CONNECTION_ERROR_OTHER_ERROR, + _("Unable to find Apple's \"Bonjour for Windows\" toolkit, see " + "http://d.pidgin.im/BonjourWindows for more information.")); return; } -#endif +#endif /* _WIN32 */ gc->flags |= PURPLE_CONNECTION_HTML; gc->proto_data = bd = g_new0(BonjourData, 1); @@ -108,8 +107,8 @@ if (bonjour_jabber_start(bd->jabber_data) == -1) { /* Send a message about the connection error */ purple_connection_error_reason (gc, - PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Unable to listen for incoming IM connections\n")); + PURPLE_CONNECTION_ERROR_NETWORK_ERROR, + _("Unable to listen for incoming IM connections")); return; }
--- a/libpurple/protocols/bonjour/jabber.c Mon Jul 06 06:04:34 2009 +0000 +++ b/libpurple/protocols/bonjour/jabber.c Mon Jul 06 09:08:17 2009 +0000 @@ -686,11 +686,13 @@ struct sockaddr_in my_addr; /* Open a listening socket for incoming conversations */ - if ((jdata->socket = socket(PF_INET, SOCK_STREAM, 0)) < 0) { - purple_debug_error("bonjour", "Cannot open socket: %s\n", g_strerror(errno)); + jdata->socket = socket(PF_INET, SOCK_STREAM, 0); + if (jdata->socket < 0) { + gchar *buf = g_strdup_printf(_("Unable to create socket: %s"), + g_strerror(errno)); purple_connection_error_reason(jdata->account->gc, - PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Cannot open socket")); + PURPLE_CONNECTION_ERROR_NETWORK_ERROR, buf); + g_free(buf); return -1; } @@ -699,25 +701,31 @@ /* Try to use the specified port - if it isn't available, use a random port */ my_addr.sin_port = htons(jdata->port); - if (bind(jdata->socket, (struct sockaddr*)&my_addr, sizeof(struct sockaddr)) != 0) { - purple_debug_info("bonjour", "Unable to bind to specified port %u (%s).\n", jdata->port, g_strerror(errno)); + if (bind(jdata->socket, (struct sockaddr*)&my_addr, sizeof(struct sockaddr)) != 0) + { + purple_debug_info("bonjour", "Unable to bind to specified " + "port %i: %s\n", jdata->port, g_strerror(errno)); my_addr.sin_port = 0; - if (bind(jdata->socket, (struct sockaddr*)&my_addr, sizeof(struct sockaddr)) != 0) { - purple_debug_error("bonjour", "Unable to bind to system assigned port (%s).\n", g_strerror(errno)); + if (bind(jdata->socket, (struct sockaddr*)&my_addr, sizeof(struct sockaddr)) != 0) + { + gchar *buf = g_strdup_printf(_("Unable to bind socket " + "to port: %s"), g_strerror(errno)); purple_connection_error_reason(jdata->account->gc, - PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Could not bind socket to port")); + PURPLE_CONNECTION_ERROR_NETWORK_ERROR, buf); + g_free(buf); return -1; } jdata->port = purple_network_get_port_from_fd(jdata->socket); } /* Attempt to listen on the bound socket */ - if (listen(jdata->socket, 10) != 0) { - purple_debug_error("bonjour", "Cannot listen on socket: %s\n", g_strerror(errno)); + if (listen(jdata->socket, 10) != 0) + { + gchar *buf = g_strdup_printf(_("Unable to listen on socket: %s"), + g_strerror(errno)); purple_connection_error_reason(jdata->account->gc, - PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Could not listen on socket")); + PURPLE_CONNECTION_ERROR_NETWORK_ERROR, buf); + g_free(buf); return -1; }
--- a/libpurple/protocols/gg/gg.c Mon Jul 06 06:04:34 2009 +0000 +++ b/libpurple/protocols/gg/gg.c Mon Jul 06 09:08:17 2009 +0000 @@ -352,14 +352,14 @@ *email == '\0' || *p1 == '\0' || *p2 == '\0' || *t == '\0') { purple_connection_error_reason (gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, - _("Fill in the registration fields.")); + _("You must fill in all registration fields")); goto exit_err; } if (g_utf8_collate(p1, p2) != 0) { purple_connection_error_reason (gc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, - _("Passwords do not match.")); + _("Passwords do not match")); goto exit_err; } @@ -369,7 +369,7 @@ if (h == NULL || !(s = h->data) || !s->success) { purple_connection_error_reason (gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, - _("Unable to register new account. Error occurred.\n")); + _("Unable to register new account. An unknown error occurred.")); goto exit_err; } @@ -450,18 +450,18 @@ purple_request_field_group_add_field(group, field); field = purple_request_field_string_new("password2", - _("Password (retype)"), "", FALSE); + _("Password (again)"), "", FALSE); purple_request_field_string_set_masked(field, TRUE); purple_request_field_group_add_field(group, field); field = purple_request_field_string_new("token", - _("Enter current token"), "", FALSE); + _("Enter captcha text"), "", FALSE); purple_request_field_string_set_masked(field, FALSE); purple_request_field_group_add_field(group, field); /* original size: 60x24 */ field = purple_request_field_image_new("token_img", - _("Current token"), token->data, token->size); + _("Captcha"), token->data, token->size); purple_request_field_group_add_field(group, field); purple_request_fields(account, @@ -1530,7 +1530,7 @@ "ggp_callback_recv: gg_watch_fd failed -- CRITICAL!\n"); purple_connection_error_reason (gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Unable to read socket")); + _("Unable to read from socket")); return; } gc->last_received = time(NULL); @@ -1688,7 +1688,7 @@ purple_debug_error("gg", "login_handler: gg_watch_fd failed!\n"); purple_connection_error_reason (gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Unable to read socket")); + _("Unable to read from socket")); return; } purple_debug_info("gg", "login_handler: session->fd = %d\n", info->session->fd); @@ -1725,7 +1725,7 @@ gc->inpa = 0; purple_connection_error_reason (gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Connection failed.")); + _("Connection failed")); break; default: purple_debug_error("gg", "strange event: %d\n", ev->type); @@ -1935,16 +1935,18 @@ address = purple_account_get_string(account, "gg_server", ""); if (address && *address) { + /* TODO: Make this non-blocking */ struct in_addr *addr = gg_gethostbyname(address); purple_debug_info("gg", "Using gg server given by user (%s)\n", address); if (addr == NULL) { - purple_debug_error("gg", "gg_gethostbyname returned error (%d): %s\n", - errno, g_strerror(errno)); + gchar *tmp = g_strdup_printf(_("Unable to resolve hostname '%s': %s"), + address, g_strerror(errno)); purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, /* should this be a settings error? */ - _("Unable to resolve server")); + tmp); + g_free(tmp); return; } @@ -1957,7 +1959,7 @@ if (info->session == NULL) { purple_connection_error_reason (gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Connection failed.")); + _("Connection failed")); g_free(glp); return; } @@ -2332,7 +2334,7 @@ "or gg_session is not correct\n"); purple_connection_error_reason (gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Not connected to the server.")); + _("Not connected to the server")); } }
--- a/libpurple/protocols/irc/dcc_send.c Mon Jul 06 06:04:34 2009 +0000 +++ b/libpurple/protocols/irc/dcc_send.c Mon Jul 06 09:08:17 2009 +0000 @@ -302,7 +302,7 @@ if (sock < 0) { purple_notify_error(gc, NULL, _("File Transfer Failed"), - _("Could not open a listening port.")); + _("Unable to open a listening port.")); purple_xfer_cancel_local(xfer); return; } @@ -343,7 +343,7 @@ if (xd->listen_data == NULL) { purple_xfer_unref(xfer); purple_notify_error(gc, NULL, _("File Transfer Failed"), - _("Could not open a listening port.")); + _("Unable to open a listening port.")); purple_xfer_cancel_local(xfer); }
--- a/libpurple/protocols/irc/irc.c Mon Jul 06 06:04:34 2009 +0000 +++ b/libpurple/protocols/irc/irc.c Mon Jul 06 09:08:17 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 connect")); 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; }
--- a/libpurple/protocols/jabber/auth.c Mon Jul 06 06:04:34 2009 +0000 +++ b/libpurple/protocols/jabber/auth.c Mon Jul 06 09:08:17 2009 +0000 @@ -52,14 +52,14 @@ "<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_connection_error_reason(js->gc, PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT, - _("Server requires TLS/SSL for login. No TLS/SSL support found.")); + _("Server requires TLS/SSL, but no TLS/SSL support was found.")); return TRUE; } else if(purple_account_get_bool(js->gc->account, "require_tls", FALSE)) { - purple_connection_error_reason (js->gc, + purple_connection_error_reason(js->gc, PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT, - _("You require encryption, but no TLS/SSL support found.")); + _("You require encryption, but no TLS/SSL support was found.")); return TRUE; } } @@ -122,7 +122,7 @@ static void disallow_plaintext_auth(PurpleAccount *account) { - purple_connection_error_reason (account->gc, + purple_connection_error_reason(account->gc, PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR, _("Server requires plaintext authentication over an unencrypted stream")); } @@ -415,9 +415,9 @@ jabber_send(js, auth); xmlnode_free(auth); } else { - purple_connection_error_reason (js->gc, + purple_connection_error_reason(js->gc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_IMPOSSIBLE, - "SASL authentication failed\n"); + _("SASL authentication failed")); } } @@ -490,9 +490,9 @@ mechs = xmlnode_get_child(packet, "mechanisms"); if(!mechs) { - purple_connection_error_reason (js->gc, + purple_connection_error_reason(js->gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Invalid response from server.")); + _("Invalid response from server")); return; } @@ -561,7 +561,7 @@ } finish_plaintext_authentication(js); } else { - purple_connection_error_reason (js->gc, + purple_connection_error_reason(js->gc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_IMPOSSIBLE, _("Server does not use any supported authentication method")); } @@ -590,7 +590,7 @@ purple_account_set_password(js->gc->account, NULL); } - purple_connection_error_reason (js->gc, reason, msg); + purple_connection_error_reason(js->gc, reason, msg); g_free(msg); } } @@ -606,7 +606,7 @@ if (type == JABBER_IQ_ERROR) { PurpleConnectionError reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR; char *msg = jabber_parse_error(js, packet, &reason); - purple_connection_error_reason (js->gc, reason, msg); + purple_connection_error_reason(js->gc, reason, msg); g_free(msg); } else if (type == JABBER_IQ_RESULT) { query = xmlnode_get_child(packet, "query"); @@ -676,7 +676,7 @@ } finish_plaintext_authentication(js); } else { - purple_connection_error_reason (js->gc, + purple_connection_error_reason(js->gc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_IMPOSSIBLE, _("Server does not use any supported authentication method")); return; @@ -695,7 +695,7 @@ */ if (!jabber_stream_is_ssl(js) && purple_account_get_bool(purple_connection_get_account(js->gc), "require_tls", FALSE)) { - purple_connection_error_reason (js->gc, + purple_connection_error_reason(js->gc, PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR, _("You require encryption, but it is not available on this server.")); return; @@ -856,9 +856,9 @@ GHashTable *parts; if(!enc_in) { - purple_connection_error_reason (js->gc, + purple_connection_error_reason(js->gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Invalid response from server.")); + _("Invalid response from server")); return; } @@ -879,7 +879,7 @@ "<response xmlns='urn:ietf:params:xml:ns:xmpp-sasl' />", -1); } else { - purple_connection_error_reason (js->gc, + purple_connection_error_reason(js->gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Invalid challenge from server")); } @@ -905,7 +905,7 @@ realm = js->user->domain; if (nonce == NULL || realm == NULL) - purple_connection_error_reason (js->gc, + purple_connection_error_reason(js->gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Invalid challenge from server")); else { @@ -980,10 +980,13 @@ g_free(enc_in); 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_CONNECTION_ERROR_NETWORK_ERROR, - _("SASL error")); + gchar *tmp = g_strdup_printf(_("SASL error: %s"), + sasl_errdetail(js->sasl)); + purple_debug_error("jabber", "Error is %d : %s\n", + js->sasl_state, sasl_errdetail(js->sasl)); + purple_connection_error_reason(js->gc, + PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp); + g_free(tmp); return; } else { response = xmlnode_new("response"); @@ -1025,9 +1028,9 @@ #endif if(!ns || strcmp(ns, "urn:ietf:params:xml:ns:xmpp-sasl")) { - purple_connection_error_reason (js->gc, + purple_connection_error_reason(js->gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Invalid response from server.")); + _("Invalid response from server")); return; } @@ -1052,9 +1055,9 @@ if (js->sasl_state != SASL_OK) { /* This should never happen! */ - purple_connection_error_reason (js->gc, + purple_connection_error_reason(js->gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Invalid response from server.")); + _("Invalid response from server")); } } /* If we've negotiated a security layer, we need to enable it */ @@ -1098,11 +1101,11 @@ #endif msg = jabber_parse_error(js, packet, &reason); if(!msg) { - purple_connection_error_reason (js->gc, + purple_connection_error_reason(js->gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Invalid response from server.")); + _("Invalid response from server")); } else { - purple_connection_error_reason (js->gc, reason, msg); + purple_connection_error_reason(js->gc, reason, msg); g_free(msg); } }
--- a/libpurple/protocols/jabber/bosh.c Mon Jul 06 06:04:34 2009 +0000 +++ b/libpurple/protocols/jabber/bosh.c Mon Jul 06 09:08:17 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)
--- a/libpurple/protocols/jabber/jabber.c Mon Jul 06 06:04:34 2009 +0000 +++ b/libpurple/protocols/jabber/jabber.c Mon Jul 06 09:08:17 2009 +0000 @@ -102,7 +102,7 @@ if(js->unregistration) jabber_unregister_account_cb(js); } else { - purple_connection_error_reason (js->gc, + purple_connection_error_reason(js->gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, ("Error initializing session")); } @@ -135,9 +135,9 @@ JabberBuddy *my_jb = NULL; jabber_id_free(js->user); if(!(js->user = jabber_id_new(full_jid))) { - purple_connection_error_reason (js->gc, + purple_connection_error_reason(js->gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Invalid response from server.")); + _("Invalid response from server")); } if((my_jb = jabber_buddy_find(js, full_jid, TRUE))) my_jb->subscription |= JABBER_SUB_BOTH; @@ -149,7 +149,7 @@ } else { PurpleConnectionError reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR; char *msg = jabber_parse_error(js, packet, &reason); - purple_connection_error_reason (js->gc, reason, msg); + purple_connection_error_reason(js->gc, reason, msg); g_free(msg); } @@ -196,7 +196,7 @@ return; } else if(purple_account_get_bool(js->gc->account, "require_tls", FALSE) && !jabber_stream_is_ssl(js)) { - purple_connection_error_reason (js->gc, + purple_connection_error_reason(js->gc, PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR, _("You require encryption, but it is not available on this server.")); return; @@ -238,7 +238,7 @@ PurpleConnectionError reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR; char *msg = jabber_parse_error(js, packet, &reason); - purple_connection_error_reason (js->gc, reason, msg); + purple_connection_error_reason(js->gc, reason, msg); g_free(msg); } @@ -320,9 +320,11 @@ if (ret < 0 && errno == EAGAIN) return; else if (ret <= 0) { - purple_connection_error_reason (js->gc, - PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Write error")); + gchar *tmp = g_strdup_printf(_("Lost connection with server: %s"), + g_strerror(errno)); + purple_connection_error_reason(js->gc, + PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp); + g_free(tmp); return; } @@ -345,9 +347,11 @@ } if (ret < 0 && errno != EAGAIN) { - purple_connection_error_reason (js->gc, - PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Write error")); + gchar *tmp = g_strdup_printf(_("Lost connection with server: %s"), + g_strerror(errno)); + purple_connection_error_reason(js->gc, + PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp); + g_free(tmp); success = FALSE; } else if (ret < len) { if (ret < 0) @@ -473,7 +477,7 @@ { JabberStream *js = gc->proto_data; purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Ping timeout")); + _("Ping timed out")); js->keepalive_timeout = 0; return FALSE; } @@ -516,13 +520,15 @@ if(len < 0 && errno == EAGAIN) return; else { + gchar *tmp; if (len == 0) - purple_debug_info("jabber", "Server closed the connection.\n"); + tmp = g_strdup_printf(_("Server closed the connection")); else - purple_debug_info("jabber", "Disconnected: %s\n", g_strerror(errno)); - purple_connection_error_reason (js->gc, - PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Read Error")); + tmp = g_strdup_printf(_("Lost connection with server: %s"), + g_strerror(errno)); + purple_connection_error_reason(js->gc, + PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp); + g_free(tmp); } } @@ -561,13 +567,15 @@ } else if(len < 0 && errno == EAGAIN) { return; } else { + gchar *tmp; if (len == 0) - purple_debug_info("jabber", "Server closed the connection.\n"); + tmp = g_strdup_printf(_("Server closed the connection")); else - purple_debug_info("jabber", "Disconnected: %s\n", g_strerror(errno)); - purple_connection_error_reason (js->gc, - PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Read Error")); + tmp = g_strdup_printf(_("Lost connection with server: %s"), + g_strerror(errno)); + purple_connection_error_reason(js->gc, + PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp); + g_free(tmp); } } @@ -603,11 +611,10 @@ js->srv_query_data = NULL; if (responses == NULL) { - gchar *tmp; - tmp = g_strdup_printf(_("Could not find alternative XMPP connection methods after failing to connect directly.\n")); - purple_connection_error_reason (js->gc, - PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp); - g_free(tmp); + purple_connection_error_reason(js->gc, + PURPLE_CONNECTION_ERROR_NETWORK_ERROR, + _("Unable to find alternative XMPP connection " + "methods after failing to connect directly.")); return; } @@ -709,9 +716,9 @@ if (purple_proxy_connect(js->gc, js->gc->account, host, port, jabber_login_callback, js->gc) == NULL) { if (fatal_failure) { - purple_connection_error_reason (js->gc, + purple_connection_error_reason(js->gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Unable to create socket")); + _("Unable to connect")); } return FALSE; @@ -796,14 +803,14 @@ js->idle = purple_presence_get_idle_time(presence); if(!js->user) { - purple_connection_error_reason (gc, + 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_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_INVALID_SETTINGS, _("Invalid XMPP ID. Domain must be set.")); return; @@ -835,7 +842,7 @@ if (js->bosh) jabber_bosh_connection_connect(js->bosh); else { - purple_connection_error_reason (js->gc, + purple_connection_error_reason(js->gc, PURPLE_CONNECTION_ERROR_INVALID_SETTINGS, _("Malformed BOSH URL")); } @@ -853,12 +860,12 @@ purple_account_get_int(account, "port", 5223), jabber_login_callback_ssl, jabber_ssl_connect_failure, js->gc); if (!js->gsc) { - purple_connection_error_reason (js->gc, + purple_connection_error_reason(js->gc, PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT, _("Unable to establish SSL connection")); } } else { - purple_connection_error_reason (js->gc, + purple_connection_error_reason(js->gc, PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT, _("SSL support unavailable")); } @@ -1304,7 +1311,7 @@ js->keepalive_timeout = 0; if(!js->user) { - purple_connection_error_reason (gc, + purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_INVALID_SETTINGS, _("Invalid XMPP ID")); return; @@ -1329,7 +1336,7 @@ js->use_bosh = TRUE; js->bosh = jabber_bosh_connection_init(js, connect_server); if (!js->bosh) { - purple_connection_error_reason (js->gc, + purple_connection_error_reason(js->gc, PURPLE_CONNECTION_ERROR_INVALID_SETTINGS, _("Malformed BOSH Connect Server")); return; @@ -1346,12 +1353,12 @@ purple_account_get_int(account, "port", 5222), jabber_login_callback_ssl, jabber_ssl_connect_failure, gc); if (!js->gsc) { - purple_connection_error_reason (js->gc, + purple_connection_error_reason(js->gc, PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT, _("Unable to establish SSL connection")); } } else { - purple_connection_error_reason (gc, + purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT, _("SSL support unavailable")); }
--- a/libpurple/protocols/msn/msn.c Mon Jul 06 06:04:34 2009 +0000 +++ b/libpurple/protocols/msn/msn.c Mon Jul 06 09:08:17 2009 +0000 @@ -1028,7 +1028,7 @@ if (!msn_session_connect(session, host, port, http_method)) purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Failed to connect to server.")); + _("Unable to connect")); } static void
--- a/libpurple/protocols/msn/session.c Mon Jul 06 06:04:34 2009 +0000 +++ b/libpurple/protocols/msn/session.c Mon Jul 06 09:08:17 2009 +0000 @@ -334,15 +334,15 @@ case MSN_ERROR_UNSUPPORTED_PROTOCOL: reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR; msg = g_strdup(_("Our protocol is not supported by the " - "server.")); + "server")); break; case MSN_ERROR_HTTP_MALFORMED: reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR; - msg = g_strdup(_("Error parsing HTTP.")); + msg = g_strdup(_("Error parsing HTTP")); break; case MSN_ERROR_SIGN_OTHER: reason = PURPLE_CONNECTION_ERROR_NAME_IN_USE; - msg = g_strdup(_("You have signed on from another location.")); + 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; @@ -355,7 +355,7 @@ case MSN_ERROR_SERV_DOWN: reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR; msg = g_strdup(_("The MSN servers are going down " - "temporarily.")); + "temporarily")); break; case MSN_ERROR_AUTH: reason = PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED; @@ -371,13 +371,13 @@ break; default: reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR; - msg = g_strdup(_("Unknown error.")); + msg = g_strdup(_("Unknown error")); break; } msn_session_disconnect(session); - purple_connection_error_reason (gc, reason, msg); + purple_connection_error_reason(gc, reason, msg); g_free(msg); }
--- a/libpurple/protocols/msnp9/msn.c Mon Jul 06 06:04:34 2009 +0000 +++ b/libpurple/protocols/msnp9/msn.c Mon Jul 06 09:08:17 2009 +0000 @@ -789,7 +789,7 @@ if (!msn_session_connect(session, host, port, http_method)) purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Failed to connect to server.")); + _("Unable to connect")); } static void
--- a/libpurple/protocols/msnp9/session.c Mon Jul 06 06:04:34 2009 +0000 +++ b/libpurple/protocols/msnp9/session.c Mon Jul 06 09:08:17 2009 +0000 @@ -296,15 +296,15 @@ case MSN_ERROR_UNSUPPORTED_PROTOCOL: reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR; msg = g_strdup(_("Our protocol is not supported by the " - "server.")); + "server")); break; case MSN_ERROR_HTTP_MALFORMED: reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR; - msg = g_strdup(_("Error parsing HTTP.")); + msg = g_strdup(_("Error parsing HTTP")); break; case MSN_ERROR_SIGN_OTHER: reason = PURPLE_CONNECTION_ERROR_NAME_IN_USE; - msg = g_strdup(_("You have signed on from another location.")); + 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; @@ -317,7 +317,7 @@ case MSN_ERROR_SERV_DOWN: reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR; msg = g_strdup(_("The MSN servers are going down " - "temporarily.")); + "temporarily")); break; case MSN_ERROR_AUTH: reason = PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED; @@ -333,13 +333,13 @@ break; default: reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR; - msg = g_strdup(_("Unknown error.")); + msg = g_strdup(_("Unknown error")); break; } msn_session_disconnect(session); - purple_connection_error_reason (gc, reason, msg); + purple_connection_error_reason(gc, reason, msg); g_free(msg); }
--- a/libpurple/protocols/myspace/myspace.c Mon Jul 06 06:04:34 2009 +0000 +++ b/libpurple/protocols/myspace/myspace.c Mon Jul 06 09:08:17 2009 +0000 @@ -1870,7 +1870,7 @@ purple_account_set_password(session->account, NULL); break; } - purple_connection_error_reason (session->gc, reason, full_errmsg); + purple_connection_error_reason(session->gc, reason, full_errmsg); } else { purple_notify_error(session->account, _("MySpaceIM Error"), full_errmsg, NULL); } @@ -2069,30 +2069,23 @@ session->rxbuf + session->rxoff, session->rxsize - session->rxoff - 1, 0); - if (n < 0 && errno == EAGAIN) { - return; - } else if (n < 0) { - purple_debug_error("msim", "msim_input_cb: read error, ret=%d, " - "error=%s, source=%d, fd=%d (%X))\n", - n, g_strerror(errno), source, session->fd, session->fd); - purple_connection_error_reason (gc, - PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Read error")); + if (n < 0) { + gchar *tmp; + + if (errno == EAGAIN) + /* No worries */ + return; + + tmp = g_strdup_printf(_("Lost connection with server: %s"), + g_strerror(errno)); + purple_connection_error_reason(gc, + PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp); + g_free(tmp); return; } else if (n == 0) { - purple_debug_info("msim", "msim_input_cb: server disconnected\n"); - purple_connection_error_reason (gc, - PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Server has disconnected")); - return; - } - - if (n + session->rxoff > session->rxsize) { - purple_debug_info("msim_input_cb", "received %d bytes, pushing rxoff to %d, over buffer size of %d\n", - n, n + session->rxoff, session->rxsize); - purple_connection_error_reason (gc, - PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Read buffer full (2)")); + purple_connection_error_reason(gc, + PURPLE_CONNECTION_ERROR_NETWORK_ERROR, + _("Server closed the connection")); return; } @@ -2135,7 +2128,7 @@ purple_debug_info("msim", "msim_input_cb: couldn't parse rxbuf\n"); purple_connection_error_reason (gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Unparseable message")); + _("Unable to parse message")); break; } else { /* Process message and then free it (processing function should @@ -2176,11 +2169,11 @@ session = (MsimSession *)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, - g_strdup_printf(_("Couldn't connect to host: %s (%d)"), - error_message ? error_message : "no message given", - source)); + PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp); + g_free(tmp); return; } @@ -2237,7 +2230,7 @@ * working port and try that first next time. */ purple_connection_error_reason (gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Couldn't create socket")); + _("Unable to connect")); return; } }
--- a/libpurple/protocols/myspace/user.c Mon Jul 06 06:04:34 2009 +0000 +++ b/libpurple/protocols/myspace/user.c Mon Jul 06 09:08:17 2009 +0000 @@ -637,8 +637,7 @@ uid = msim_msg_get_integer(userinfo, "uid"); lid = msim_msg_get_integer(userinfo, "lid"); body = msim_msg_get_dictionary(userinfo, "body"); - /* XXX: Mark for translation */ - errmsg = ("An error occurred while trying to set the username.\n" + errmsg = _("An error occurred while trying to set the username. " "Please try again, or visit http://editprofile.myspace.com/index.cfm?" "fuseaction=profile.username to set your username."); @@ -797,9 +796,9 @@ if (!body) { purple_debug_info("msim_username_is_available_cb", "No body for %s?!\n", username); purple_connection_error_reason(session->gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, - "An error occurred while trying to set the username.\n" + _("An error occurred while trying to set the username. " "Please try again, or visit http://editprofile.myspace.com/index.cfm?" - "fuseaction=profile.username to set your username."); + "fuseaction=profile.username to set your username.")); return; }
--- a/libpurple/protocols/novell/novell.c Mon Jul 06 06:04:34 2009 +0000 +++ b/libpurple/protocols/novell/novell.c Mon Jul 06 09:08:17 2009 +0000 @@ -121,7 +121,7 @@ } else { PurpleConnectionError reason; - char *err = g_strdup_printf(_("Login failed (%s)."), + char *err = g_strdup_printf(_("Unable to login: %s"), nm_error_to_string (ret_code)); switch (ret_code) { @@ -140,7 +140,7 @@ reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR; } - purple_connection_error_reason (gc, reason, err); + purple_connection_error_reason(gc, reason, err); g_free(err); } } @@ -1126,7 +1126,7 @@ if (_is_disconnect_error(err)) { - purple_connection_error_reason (gc, + purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Error communicating with server. Closing connection.")); return TRUE; @@ -1701,7 +1701,7 @@ if (_is_disconnect_error(rc)) { - purple_connection_error_reason (gc, + purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Error communicating with server. Closing connection.")); } else { @@ -1742,9 +1742,9 @@ conn->connected = TRUE; purple_ssl_input_add(gsc, novell_ssl_recv_cb, gc); } else { - purple_connection_error_reason (gc, + purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Unable to connect to server.")); + _("Unable to connect")); } purple_connection_update_progress(gc, _("Waiting for response..."), @@ -2027,10 +2027,9 @@ { if (!purple_account_get_remember_password(account)) purple_account_set_password(account, NULL); - purple_connection_error_reason (gc, + purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NAME_IN_USE, - _("You have been logged out because you" - " logged in at another workstation.")); + _("You have signed on from another location")); } } @@ -2184,7 +2183,7 @@ */ /* ...but for now just error out with a nice message. */ - purple_connection_error_reason (gc, + purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_INVALID_SETTINGS, _("Unable to connect to server. Please enter the " "address of the server to which you wish to connect.")); @@ -2213,9 +2212,9 @@ user->conn->addr, user->conn->port, novell_ssl_connected_cb, novell_ssl_connect_error, gc); if (user->conn->ssl_conn->data == NULL) { - purple_connection_error_reason (gc, + purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT, - _("Error. SSL support is not installed.")); + _("SSL support unavailable")); } } }
--- a/libpurple/protocols/oscar/clientlogin.c Mon Jul 06 06:04:34 2009 +0000 +++ b/libpurple/protocols/oscar/clientlogin.c Mon Jul 06 09:08:17 2009 +0000 @@ -377,11 +377,11 @@ if (status_code == 330 && status_detail_code == 3011) { purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, - _("Incorrect password.")); + _("Incorrect password")); } else if (status_code == 401 && status_detail_code == 3019) { purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, - _("AOL does not allow your screen name to authenticate via this site.")); + _("AOL does not allow your screen name to authenticate here")); } else purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR,
--- a/libpurple/protocols/oscar/flap_connection.c Mon Jul 06 06:04:34 2009 +0000 +++ b/libpurple/protocols/oscar/flap_connection.c Mon Jul 06 09:08:17 2009 +0000 @@ -469,18 +469,18 @@ if (conn->disconnect_code == 0x0001) { reason = PURPLE_CONNECTION_ERROR_NAME_IN_USE; - tmp = g_strdup(_("You have signed on from another location.")); + tmp = g_strdup(_("You have signed on from another location")); if (!purple_account_get_remember_password(account)) purple_account_set_password(account, NULL); } else if (conn->disconnect_reason == OSCAR_DISCONNECT_REMOTE_CLOSED) - tmp = g_strdup(_("Server closed the connection.")); + tmp = g_strdup(_("Server closed the connection")); else if (conn->disconnect_reason == OSCAR_DISCONNECT_LOST_CONNECTION) - tmp = g_strdup_printf(_("Lost connection with server:\n%s"), + tmp = g_strdup_printf(_("Lost connection with server: %s"), conn->error_message); else if (conn->disconnect_reason == OSCAR_DISCONNECT_INVALID_DATA) - tmp = g_strdup(_("Received invalid data on connection with server.")); + tmp = g_strdup(_("Received invalid data on connection with server")); else if (conn->disconnect_reason == OSCAR_DISCONNECT_COULD_NOT_CONNECT) - tmp = g_strdup_printf(_("Could not establish a connection with the server:\n%s"), + tmp = g_strdup_printf(_("Unable to connect: %s"), conn->error_message); else /* @@ -1053,7 +1053,7 @@ ret = send(conn->fd, conn->buffer_outgoing->outptr, writelen, 0); if (ret <= 0) { - if (ret < 0 && ((errno == EAGAIN) || (errno == EWOULDBLOCK))) + if (ret < 0 && (errno == EAGAIN || errno == EWOULDBLOCK)) /* No worries */ return;
--- a/libpurple/protocols/oscar/odc.c Mon Jul 06 06:04:34 2009 +0000 +++ b/libpurple/protocols/oscar/odc.c Mon Jul 06 09:08:17 2009 +0000 @@ -48,7 +48,7 @@ else if (conn->disconnect_reason == OSCAR_DISCONNECT_INVALID_DATA) tmp = g_strdup(_("Received invalid data on connection with remote user.")); else if (conn->disconnect_reason == OSCAR_DISCONNECT_COULD_NOT_CONNECT) - tmp = g_strdup(_("Could not establish a connection with the remote user.")); + tmp = g_strdup(_("Unable to establish a connection with the remote user.")); else /* * We shouldn't print a message for some disconnect_reasons.
--- a/libpurple/protocols/oscar/oscar.c Mon Jul 06 06:04:34 2009 +0000 +++ b/libpurple/protocols/oscar/oscar.c Mon Jul 06 09:08:17 2009 +0000 @@ -1111,7 +1111,7 @@ { /* This only happens when connecting with the old-style BUCP login */ gchar *msg; - msg = g_strdup_printf(_("Could not connect to authentication server:\n%s"), + msg = g_strdup_printf(_("Unable to connect to authentication server: %s"), error_message); purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, msg); g_free(msg); @@ -1119,7 +1119,7 @@ else if (conn->type == SNAC_FAMILY_LOCATE) { gchar *msg; - msg = g_strdup_printf(_("Could not connect to BOS server:\n%s"), + msg = g_strdup_printf(_("Unable to connect to BOS server: %s"), error_message); purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, msg); g_free(msg); @@ -1521,7 +1521,7 @@ if (!oscar_util_valid_name(purple_account_get_username(account))) { gchar *buf; - buf = g_strdup_printf(_("Unable to login: Could not sign on as %s because the username is invalid. Usernames 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)); + buf = g_strdup_printf(_("Unable to sign on as %s because the username is invalid. Usernames 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_CONNECTION_ERROR_INVALID_SETTINGS, buf); g_free(buf); return; @@ -1605,7 +1605,7 @@ if (newconn->gsc == NULL && newconn->connect_data == NULL) { purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Couldn't connect to host")); + _("Unable to connect")); return; } } @@ -1717,7 +1717,7 @@ if (source < 0) { GHashTable *ui_info = purple_core_get_ui_info(); buf = g_strdup_printf(_("You may be disconnected shortly. " - "Check %s for updates."), + "If so, check %s for updates."), ((ui_info && g_hash_table_lookup(ui_info, "website")) ? (char *)g_hash_table_lookup(ui_info, "website") : PURPLE_WEBSITE)); purple_notify_warning(pos->gc, NULL, _("Unable to get a valid AIM login hash."), @@ -1819,7 +1819,7 @@ g_free(pos); g_snprintf(buf, sizeof(buf), _("You may be disconnected shortly. " - "Check %s for updates."), + "If so, check %s for updates."), ((ui_info && g_hash_table_lookup(ui_info, "website")) ? (char *)g_hash_table_lookup(ui_info, "website") : PURPLE_WEBSITE)); purple_notify_warning(pos->gc, NULL, _("Unable to get a valid login hash."), @@ -1841,7 +1841,7 @@ connection_established_cb, conn); if (conn->connect_data == NULL) { - purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Could Not Connect")); + purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Unable to connect")); return 0; } @@ -1887,11 +1887,11 @@ /* Incorrect password */ if (!purple_account_get_remember_password(account)) purple_account_set_password(account, NULL); - purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_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_CONNECTION_ERROR_AUTHENTICATION_FAILED, _("Your account is currently suspended.")); + purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, _("Your account is currently suspended")); break; case 0x02: case 0x14: @@ -1963,7 +1963,7 @@ g_free(host); if (newconn->connect_data == NULL) { - purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Could Not Connect")); + purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Unable to connect")); return 0; } @@ -1996,7 +1996,7 @@ /* Disconnect */ purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, - _("The SecurID key entered is invalid.")); + _("The SecurID key entered is invalid")); } /** @@ -4976,7 +4976,7 @@ if (!oscar_util_valid_name(bname)) { gchar *buf; - buf = g_strdup_printf(_("Could not add the buddy %s because the username is invalid. Usernames must be a valid email address, or start with a letter and contain only letters, numbers and spaces, or contain only numbers."), bname); + buf = g_strdup_printf(_("Unable to add the buddy %s because the username is invalid. Usernames must be a valid email address, or start with a letter and contain only letters, numbers and spaces, or contain only numbers."), bname); if (!purple_conv_present_error(bname, account, buf)) purple_notify_error(gc, NULL, _("Unable to Add"), buf); g_free(buf); @@ -5461,7 +5461,7 @@ case 0x000c: { /* you are over the limit, the cheat is to the limit, come on fhqwhgads */ gchar *buf; - buf = g_strdup_printf(_("Could not add the buddy %s because you have too many buddies in your buddy list. Please remove one and try again."), (retval->name ? retval->name : _("(no name)"))); + buf = g_strdup_printf(_("Unable to add the buddy %s because you have too many buddies in your buddy list. Please remove one and try again."), (retval->name ? retval->name : _("(no name)"))); if ((retval->name != NULL) && !purple_conv_present_error(retval->name, purple_connection_get_account(gc), buf)) purple_notify_error(gc, NULL, _("Unable to Add"), buf); g_free(buf); @@ -5475,7 +5475,7 @@ default: { /* La la la */ gchar *buf; purple_debug_error("oscar", "ssi: Action 0x%04hx was unsuccessful with error 0x%04hx\n", retval->action, retval->ack); - buf = g_strdup_printf(_("Could not add the buddy %s for an unknown reason."), + buf = g_strdup_printf(_("Unable to add the buddy %s for an unknown reason."), (retval->name ? retval->name : _("(no name)"))); if ((retval->name != NULL) && !purple_conv_present_error(retval->name, purple_connection_get_account(gc), buf)) purple_notify_error(gc, NULL, _("Unable to Add"), buf);
--- a/libpurple/protocols/qq/qq_base.c Mon Jul 06 06:04:34 2009 +0000 +++ b/libpurple/protocols/qq/qq_base.c Mon Jul 06 09:08:17 2009 +0000 @@ -72,7 +72,7 @@ qq_show_packet("Login reply OK, but length < 139", data, len); purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR, - _("Cannot decrypt server reply")); + _("Unable to decrypt server reply")); return QQ_LOGIN_REPLY_ERR; } @@ -160,7 +160,7 @@ if (len < 11) { purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR, - _("Cannot decrypt server reply")); + _("Unable to decrypt server reply")); return QQ_LOGIN_REPLY_ERR; } @@ -412,7 +412,7 @@ if (!purple_account_get_remember_password(gc->account)) { purple_account_set_password(gc->account, NULL); } - error = g_strdup( _("Incorrect password.")); + error = g_strdup( _("Incorrect password")); reason = PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED; break; case 0x06: /* need activation */ @@ -655,7 +655,7 @@ if (data_len < 15) { purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR, - _("Could not decrypt server reply")); + _("Unable to decrypt server reply")); return QQ_LOGIN_REPLY_ERR; } @@ -1097,7 +1097,7 @@ if (!purple_account_get_remember_password(gc->account)) { purple_account_set_password(gc->account, NULL); } - error = g_strdup(_("Incorrect password.")); + error = g_strdup(_("Incorrect password")); reason = PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED; break; case 0x33: /* need activation */ @@ -1106,7 +1106,7 @@ reason = PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED; break; case 0xBF: /* uid is not exist */ - error = g_strdup(_("Invalid username.")); + error = g_strdup(_("Username does not exist")); reason = PURPLE_CONNECTION_ERROR_INVALID_USERNAME; break; default:
--- a/libpurple/protocols/qq/qq_network.c Mon Jul 06 06:04:34 2009 +0000 +++ b/libpurple/protocols/qq/qq_network.c Mon Jul 06 09:08:17 2009 +0000 @@ -208,7 +208,7 @@ if ( set_new_server(qd) != TRUE) { purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Unable to connect.")); + _("Unable to connect")); return FALSE; } qd->connect_retry = QQ_CONNECT_MAX; @@ -233,7 +233,7 @@ if ( !connect_to_server(gc, tmp_server, port) ) { purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Unable to connect.")); + _("Unable to connect")); } g_free(tmp_server); @@ -389,7 +389,7 @@ /* No worries */ return; - error_msg = g_strdup_printf(_("Lost connection with server:\n%s"), g_strerror(errno)); + error_msg = g_strdup_printf(_("Lost connection with server: %s"), g_strerror(errno)); purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, error_msg); @@ -397,7 +397,7 @@ return; } else if (buf_len == 0) { purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Server closed the connection.")); + _("Server closed the connection")); return; } @@ -585,9 +585,11 @@ return; else if (ret < 0) { /* TODO: what to do here - do we really have to disconnect? */ + gchar *tmp = g_strdup_printf(_("Lost connection with server: %s"), + g_strerror(errno)); purple_connection_error_reason(gc, - PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Write Error")); + PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp); + g_free(tmp); return; } @@ -629,11 +631,13 @@ ret = 0; } else if (ret <= 0) { /* TODO: what to do here - do we really have to disconnect? */ + gchar *tmp = g_strdup_printf(_("Lost connection with server: %s"), + g_strerror(errno)); purple_debug_error("TCP_SEND_OUT", "Send to socket %d failed: %d, %s\n", qd->fd, errno, g_strerror(errno)); purple_connection_error_reason(gc, - PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - g_strerror(errno)); + PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp); + g_free(tmp); return ret; } @@ -663,7 +667,7 @@ if (is_lost_conn) { purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Connection lost")); + _("Lost connection with server")); return TRUE; } @@ -864,7 +868,7 @@ if (!hosts || !hosts->data) { purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Couldn't resolve host")); + _("Unable to resolve hostname")); return; } @@ -941,7 +945,7 @@ account = purple_connection_get_account(gc); qd = (qq_data *) gc->proto_data; - if (server == NULL || strlen(server) == 0 || port == 0) { + if (server == NULL || server[0] == '\0' || port == 0) { purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Invalid server or port"));
--- a/libpurple/protocols/qq/qq_process.c Mon Jul 06 06:04:34 2009 +0000 +++ b/libpurple/protocols/qq/qq_process.c Mon Jul 06 09:08:17 2009 +0000 @@ -951,7 +951,7 @@ qq_show_packet("Can not decrypted", rcved, rcved_len); purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR, - _("Could not decrypt login reply")); + _("Unable to decrypt login reply")); return QQ_LOGIN_REPLY_ERR; }
--- a/libpurple/protocols/sametime/sametime.c Mon Jul 06 06:04:34 2009 +0000 +++ b/libpurple/protocols/sametime/sametime.c Mon Jul 06 09:08:17 2009 +0000 @@ -411,11 +411,14 @@ pd->outpa = purple_input_add(pd->socket, PURPLE_INPUT_WRITE, write_cb, pd); } else if(len > 0) { + gchar *tmp = g_strdup_printf(_("Lost connection with server: %s"), + g_strerror(errno)); DEBUG_ERROR("write returned %" G_GSSIZE_FORMAT ", %" G_GSIZE_FORMAT " bytes left unwritten\n", ret, len); purple_connection_error_reason(pd->gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Connection closed (writing)")); + tmp); + g_free(tmp); #if 0 close(pd->socket); @@ -1755,11 +1758,10 @@ } if(! ret) { - const char *msg = _("Connection reset"); DEBUG_INFO("connection reset\n"); purple_connection_error_reason(pd->gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - msg); + _("Server closed the connection")); } else if(ret < 0) { const gchar *err_str = g_strerror(err); @@ -1767,7 +1769,7 @@ DEBUG_INFO("error in read callback: %s\n", err_str); - msg = g_strdup_printf(_("Error reading from socket: %s"), err_str); + msg = g_strdup_printf(_("Lost connection with server: %s"), err_str); purple_connection_error_reason(pd->gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, msg); @@ -1792,10 +1794,12 @@ } else { /* this is a regular connect, error out */ - const char *msg = _("Unable to connect to host"); + gchar *tmp = g_strdup_printf(_("Unable to connect: %s"), + error_message); purple_connection_error_reason(pd->gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - msg); + tmp); + g_free(tmp); } return; @@ -3800,7 +3804,7 @@ if (purple_proxy_connect(gc, account, host, port, connect_cb, pd) == NULL) { purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Unable to connect to host")); + _("Unable to connect")); } }
--- a/libpurple/protocols/silc/ops.c Mon Jul 06 06:04:34 2009 +0000 +++ b/libpurple/protocols/silc/ops.c Mon Jul 06 09:08:17 2009 +0000 @@ -71,7 +71,7 @@ gc = client->application; if (gc != NULL) - purple_connection_error_reason (gc, reason, tmp); + purple_connection_error_reason(gc, reason, tmp); else purple_notify_error(NULL, _("Error"), _("Error occurred"), tmp); }
--- a/libpurple/protocols/silc/silc.c Mon Jul 06 06:04:34 2009 +0000 +++ b/libpurple/protocols/silc/silc.c Mon Jul 06 09:08:17 2009 +0000 @@ -325,7 +325,7 @@ case SILC_CLIENT_CONN_ERROR: purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Error during connecting to SILC Server")); + _("Error connecting to SILC Server")); g_unlink(silcpurple_session_file(purple_account_get_username(sg->account))); break; @@ -348,7 +348,7 @@ case SILC_CLIENT_CONN_ERROR_TIMEOUT: purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Connection Timeout")); + _("Connection timed out")); break; } @@ -447,7 +447,7 @@ silcpurple_login_connected, gc) == NULL) { purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Unable to create connection")); + _("Unable to connect")); gc->proto_data = NULL; silc_free(sg); return; @@ -490,7 +490,7 @@ password, &sg->public_key, &sg->private_key)) { purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, - _("Could not load SILC key pair")); + _("Unable to load SILC key pair")); gc->proto_data = NULL; silc_free(sg); return; @@ -506,7 +506,7 @@ return; sg = gc->proto_data; purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, - _("Could not load SILC key pair")); + _("Unable to load SILC key pair")); gc->proto_data = NULL; silc_free(sg); } @@ -535,7 +535,7 @@ return; } purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, - _("Could not load SILC key pair")); + _("Unable to not load SILC key pair")); gc->proto_data = NULL; silc_free(sg); return; @@ -617,7 +617,7 @@ if (!silc_client_init(client, username, hostname, realname, silcpurple_running, sg)) { purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, - _("Cannot initialize SILC protocol")); + _("Unable to initialize SILC protocol")); gc->proto_data = NULL; silc_free(sg); silc_free(hostname);
--- a/libpurple/protocols/silc/util.c Mon Jul 06 06:04:34 2009 +0000 +++ b/libpurple/protocols/silc/util.c Mon Jul 06 09:08:17 2009 +0000 @@ -213,7 +213,7 @@ ? "" : gc->password, NULL, NULL, FALSE)) { purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, - _("Cannot create SILC key pair\n")); + _("Unable to create SILC key pair")); return FALSE; } @@ -256,7 +256,7 @@ ? "" : gc->password, NULL, NULL, FALSE)) { purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, - _("Cannot create SILC key pair\n")); + _("Unable to create SILC key pair")); return FALSE; }
--- a/libpurple/protocols/silc10/ops.c Mon Jul 06 06:04:34 2009 +0000 +++ b/libpurple/protocols/silc10/ops.c Mon Jul 06 09:08:17 2009 +0000 @@ -1722,7 +1722,7 @@ case SILC_CLIENT_CONN_ERROR_TIMEOUT: purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Connection Timeout")); + _("Connection timed out")); break; }
--- a/libpurple/protocols/silc10/silc.c Mon Jul 06 06:04:34 2009 +0000 +++ b/libpurple/protocols/silc10/silc.c Mon Jul 06 09:08:17 2009 +0000 @@ -183,7 +183,7 @@ purple_account_get_int(account, "port", 706), sg); if (!conn) { purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Cannot initialize SILC Client connection")); + _("Unable to initialize SILC Client connection")); gc->proto_data = NULL; return; } @@ -315,7 +315,7 @@ /* Init SILC client */ if (!silc_client_init(client)) { purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, - _("Cannot initialize SILC protocol")); + _("Unable to initialize SILC protocol")); return; } @@ -336,9 +336,9 @@ (char *)purple_account_get_string(account, "private-key", prd), (gc->password == NULL) ? "" : gc->password, &client->pkcs, &client->public_key, &client->private_key)) { - g_snprintf(pkd, sizeof(pkd), _("Could not load SILC key pair: %s"), g_strerror(errno)); + g_snprintf(pkd, sizeof(pkd), _("Unable to load SILC key pair: %s"), g_strerror(errno)); purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, - _("Could not load SILC key pair")); + pkd); return; }
--- a/libpurple/protocols/simple/simple.c Mon Jul 06 06:04:34 2009 +0000 +++ b/libpurple/protocols/simple/simple.c Mon Jul 06 09:08:17 2009 +0000 @@ -428,11 +428,13 @@ if(written < 0 && errno == EAGAIN) written = 0; - else if(written <= 0) { + else if (written <= 0) { /*TODO: do we really want to disconnect on a failure to write?*/ + gchar *tmp = g_strdup_printf(_("Lost connection with server: %s"), + g_strerror(errno)); purple_connection_error_reason(gc, - PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Could not write")); + PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp); + g_free(tmp); return; } @@ -441,15 +443,17 @@ static void simple_input_cb(gpointer data, gint source, PurpleInputCondition cond); -static void send_later_cb(gpointer data, gint source, const gchar *error) { +static void send_later_cb(gpointer data, gint source, const gchar *error_message) { PurpleConnection *gc = data; struct simple_account_data *sip; struct sip_connection *conn; if(source < 0) { + gchar *tmp = g_strdup_printf(_("Unable to connect: %s"), + error_message); purple_connection_error_reason(gc, - PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Could not connect")); + PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp); + g_free(tmp); return; } @@ -475,7 +479,7 @@ 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_CONNECTION_ERROR_NETWORK_ERROR, _("Couldn't create socket")); + purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Unable to connect")); } sip->connecting = TRUE; } @@ -1120,7 +1124,7 @@ purple_account_set_password(sip->gc->account, NULL); purple_connection_error_reason(sip->gc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, - _("Incorrect password.")); + _("Incorrect password")); return TRUE; } tmp = sipmsg_find_header(msg, "WWW-Authenticate"); @@ -1135,7 +1139,7 @@ if (sip->registrar.retries > SIMPLE_REGISTER_RETRY_MAX) { purple_connection_error_reason(sip->gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, - _("Unknown server response.")); + _("Unknown server response")); return TRUE; } sip->registerstatus = SIMPLE_REGISTER_RETRY; @@ -1729,9 +1733,11 @@ struct sip_connection *conn; if(source < 0) { + gchar *tmp = g_strdup_printf(_("Unable to connect: %s"), + error_message); purple_connection_error_reason(gc, - PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Could not connect")); + PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp); + g_free(tmp); return; } @@ -1767,7 +1773,7 @@ if(listenfd == -1) { purple_connection_error_reason(sip->gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Could not create listen socket")); + _("Unable to create listen socket")); return; } @@ -1792,7 +1798,7 @@ if (!hosts || !hosts->data) { purple_connection_error_reason(sip->gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Couldn't resolve host")); + _("Unable to resolve hostname")); return; } @@ -1813,7 +1819,7 @@ if (sip->listen_data == NULL) { purple_connection_error_reason(sip->gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Could not create listen socket")); + _("Unable to create listen socket")); return; } } @@ -1828,7 +1834,7 @@ if(sip->listenfd == -1) { purple_connection_error_reason(sip->gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Could not create listen socket")); + _("Unable to create listen socket")); return; } @@ -1843,7 +1849,7 @@ sip->realport, login_cb, sip->gc) == NULL) { purple_connection_error_reason(sip->gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Couldn't create socket")); + _("Unable to connect")); } } @@ -1883,7 +1889,7 @@ if (sip->listen_data == NULL) { purple_connection_error_reason(sip->gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Could not create listen socket")); + _("Unable to create listen socket")); return; } } else { /* UDP */ @@ -1893,7 +1899,7 @@ if (sip->query_data == NULL) { purple_connection_error_reason(sip->gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Could not resolve hostname")); + _("Unable to resolve hostname")); } } }
--- a/libpurple/protocols/yahoo/libymsg.c Mon Jul 06 06:04:34 2009 +0000 +++ b/libpurple/protocols/yahoo/libymsg.c Mon Jul 06 09:08:17 2009 +0000 @@ -159,7 +159,7 @@ if (!purple_account_get_remember_password(account)) purple_account_set_password(account, NULL); purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NAME_IN_USE, - _("You have signed on from another location.")); + _("You have signed on from another location")); return; } @@ -1796,12 +1796,12 @@ /* Set password to NULL. Avoids account locking. Brings dialog to enter password if clicked on Re-enable account */ if (!purple_account_get_remember_password(purple_connection_get_account(gc))) purple_account_set_password(purple_connection_get_account(gc), NULL); - error_reason = g_strdup(_("Incorrect Password")); + error_reason = g_strdup(_("Incorrect password")); error = PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED; break; case 1213: /* security lock from too many failed login attempts */ - error_reason = g_strdup(_("Account locked: Too many failed login attempts.\nLogging into the Yahoo! website may fix this.")); + error_reason = g_strdup(_("Account locked: Too many failed login attempts. Logging into the Yahoo! website may fix this.")); error = PURPLE_CONNECTION_ERROR_OTHER_ERROR; break; case 1235: @@ -1812,7 +1812,7 @@ case 1214: case 1236: /* indicates a lock of some description */ - error_reason = g_strdup(_("Account locked: Unknown reason.\nLogging into the Yahoo! website may fix this.")); + error_reason = g_strdup(_("Account locked: Unknown reason. Logging into the Yahoo! website may fix this.")); error = PURPLE_CONNECTION_ERROR_OTHER_ERROR; break; case 100: @@ -2051,11 +2051,11 @@ switch (err) { case 0: - msg = g_strdup(_("Unknown error.")); + msg = g_strdup(_("Unknown error")); reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR; break; case 3: - msg = g_strdup(_("Invalid username.")); + msg = g_strdup(_("Username does not exist")); reason = PURPLE_CONNECTION_ERROR_INVALID_USERNAME; break; case 13: @@ -2077,7 +2077,7 @@ if (!purple_account_get_remember_password(account)) purple_account_set_password(account, NULL); - msg = g_strdup(_("Incorrect password.")); + msg = g_strdup(_("Incorrect password")); reason = PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED; break; case 14: @@ -2167,10 +2167,10 @@ } decoded_group = yahoo_string_decode(gc, group, FALSE); - buf = g_strdup_printf(_("Could not add buddy %s to group %s to the server list on account %s."), + buf = g_strdup_printf(_("Unable to add buddy %s to group %s to the server list on account %s."), who, decoded_group, purple_connection_get_display_name(gc)); if (!purple_conv_present_error(who, purple_connection_get_account(gc), buf)) - purple_notify_error(gc, NULL, _("Could not add buddy to server list"), buf); + purple_notify_error(gc, NULL, _("Unable to add buddy to server list"), buf); g_free(buf); g_free(decoded_group); g_free(who); @@ -2929,14 +2929,14 @@ /* No worries */ return; - tmp = g_strdup_printf(_("Lost connection with server:\n%s"), + tmp = g_strdup_printf(_("Lost connection with server: %s"), g_strerror(errno)); 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_CONNECTION_ERROR_NETWORK_ERROR, - _("Server closed the connection.")); + _("Server closed the connection")); return; } gc->last_received = time(NULL); @@ -3018,8 +3018,7 @@ if (source < 0) { gchar *tmp; - tmp = g_strdup_printf(_("Could not establish a connection with the server:\n%s"), - error_message); + tmp = g_strdup_printf(_("Unable to connect: %s"), error_message); purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp); g_free(tmp); return; @@ -3045,8 +3044,7 @@ if (source < 0) { gchar *tmp; - tmp = g_strdup_printf(_("Could not establish a connection with the server:\n%s"), - error_message); + tmp = g_strdup_printf(_("Unable to connect: %s"), error_message); purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp); g_free(tmp); return; @@ -3085,14 +3083,14 @@ /* No worries */ return; - tmp = g_strdup_printf(_("Lost connection with server:\n%s"), + tmp = g_strdup_printf(_("Lost connection with server: %s"), g_strerror(errno)); 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_CONNECTION_ERROR_NETWORK_ERROR, - _("Server closed the connection.")); + _("Server closed the connection")); return; } @@ -3108,7 +3106,7 @@ 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_CONNECTION_ERROR_NETWORK_ERROR, - _("Received unexpected HTTP response from server.")); + _("Received unexpected HTTP response from server")); purple_debug_misc("yahoo", "Unexpected HTTP response: %s\n", buf); return; } @@ -3138,7 +3136,7 @@ purple_account_get_int(account, "port", YAHOO_PAGER_PORT), yahoo_got_web_connected, gc) == NULL) { purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Connection problem")); + _("Unable to connect")); return; } } @@ -3164,7 +3162,7 @@ if (gc->inpa) purple_input_remove(gc->inpa); gc->inpa = 0; - tmp = g_strdup_printf(_("Lost connection with %s:\n%s"), + tmp = g_strdup_printf(_("Lost connection with %s: %s"), "login.yahoo.com:80", g_strerror(errno)); purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp); g_free(tmp); @@ -3189,7 +3187,7 @@ if (source < 0) { gchar *tmp; - tmp = g_strdup_printf(_("Could not establish a connection with %s:\n%s"), + tmp = g_strdup_printf(_("Unable to establish a connection with %s: %s"), "login.yahoo.com:80", error_message); purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp); g_free(tmp); @@ -3326,7 +3324,7 @@ 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_CONNECTION_ERROR_NETWORK_ERROR, - _("Connection problem")); + _("Unable to connect")); return; } @@ -3437,7 +3435,7 @@ yahoo_got_connected, gc) == NULL) { purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Connection problem")); + _("Unable to connect")); return; } } else { @@ -3448,7 +3446,7 @@ yahoo_got_connected, gc) == NULL) { purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Connection problem")); + _("Unable to connect")); return; } }
--- a/libpurple/protocols/yahoo/ycht.c Mon Jul 06 06:04:34 2009 +0000 +++ b/libpurple/protocols/yahoo/ycht.c Mon Jul 06 09:08:17 2009 +0000 @@ -285,9 +285,11 @@ else if (ret <= 0) { /* TODO: error handling */ /* + gchar *tmp = g_strdup_printf(_("Lost connection with server: %s"), + g_strerror(errno)); purple_connection_error_reason(purple_account_get_connection(irc->account), - PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Server has disconnected")); + PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp); + g_free(tmp); */ return; } @@ -454,7 +456,7 @@ static void ycht_connection_error(YchtConn *ycht, const gchar *error) { - purple_notify_info(ycht->gc, NULL, _("Connection problem with the YCHT server."), error); + purple_notify_info(ycht->gc, NULL, _("Connection problem with the YCHT server"), error); ycht_connection_close(ycht); } @@ -473,13 +475,13 @@ /* No worries */ return; - tmp = g_strdup_printf(_("Lost connection with server\n%s"), + tmp = g_strdup_printf(_("Lost connection with server: %s"), g_strerror(errno)); ycht_connection_error(ycht, tmp); g_free(tmp); return; } else if (len == 0) { - ycht_connection_error(ycht, _("Server closed the connection.")); + ycht_connection_error(ycht, _("Server closed the connection")); return; } @@ -546,7 +548,7 @@ char *buf; if (source < 0) { - ycht_connection_error(ycht, _("Unable to connect.")); + ycht_connection_error(ycht, _("Unable to connect")); return; } @@ -582,7 +584,7 @@ purple_account_get_int(account, "ycht-port", YAHOO_YCHT_PORT), ycht_got_connected, ycht) == NULL) { - ycht_connection_error(ycht, _("Connection problem")); + ycht_connection_error(ycht, _("Unable to connect")); return; } }
--- a/libpurple/proxy.c Mon Jul 06 06:04:34 2009 +0000 +++ b/libpurple/proxy.c Mon Jul 06 09:08:17 2009 +0000 @@ -688,7 +688,7 @@ if (connect_data->fd < 0) { purple_proxy_connect_data_disconnect_formatted(connect_data, - _("Unable to create socket:\n%s"), g_strerror(errno)); + _("Unable to create socket: %s"), g_strerror(errno)); return; } @@ -750,7 +750,7 @@ if (connect_data->fd < 0) { purple_proxy_connect_data_disconnect_formatted(connect_data, - _("Unable to create socket:\n%s"), g_strerror(errno)); + _("Unable to create socket: %s"), g_strerror(errno)); return; } @@ -871,7 +871,7 @@ if (len == 0) { purple_proxy_connect_data_disconnect(connect_data, - _("Server closed the connection.")); + _("Server closed the connection")); return; } @@ -882,7 +882,7 @@ /* Error! */ purple_proxy_connect_data_disconnect_formatted(connect_data, - _("Lost connection with server:\n%s"), g_strerror(errno)); + _("Lost connection with server: %s"), g_strerror(errno)); return; } @@ -945,7 +945,7 @@ if (error) { purple_proxy_connect_data_disconnect_formatted(connect_data, - _("Unable to parse response from HTTP proxy: %s\n"), + _("Unable to parse response from HTTP proxy: %s"), connect_data->read_buffer); return; } @@ -1065,7 +1065,7 @@ if (status == 403) { /* Forbidden */ purple_proxy_connect_data_disconnect_formatted(connect_data, - _("Access denied: HTTP proxy server forbids port %d tunneling."), + _("Access denied: HTTP proxy server forbids port %d tunneling"), connect_data->port); } else { purple_proxy_connect_data_disconnect_formatted(connect_data, @@ -1191,7 +1191,7 @@ if (connect_data->fd < 0) { purple_proxy_connect_data_disconnect_formatted(connect_data, - _("Unable to create socket:\n%s"), g_strerror(errno)); + _("Unable to create socket: %s"), g_strerror(errno)); return; } @@ -1384,7 +1384,7 @@ if (connect_data->fd < 0) { purple_proxy_connect_data_disconnect_formatted(connect_data, - _("Unable to create socket:\n%s"), g_strerror(errno)); + _("Unable to create socket: %s"), g_strerror(errno)); return; } @@ -1453,7 +1453,7 @@ if (len == 0) { purple_proxy_connect_data_disconnect(connect_data, - _("Server closed the connection.")); + _("Server closed the connection")); return; } @@ -1465,7 +1465,7 @@ /* Error! */ purple_proxy_connect_data_disconnect_formatted(connect_data, - _("Lost connection with server:\n%s"), g_strerror(errno)); + _("Lost connection with server: %s"), g_strerror(errno)); return; } @@ -1482,7 +1482,7 @@ } else { purple_debug_error("socks5 proxy", "Bad data.\n"); purple_proxy_connect_data_disconnect(connect_data, - _("Received invalid data on connection with server.")); + _("Received invalid data on connection with server")); } return; } @@ -1512,7 +1512,7 @@ default: purple_debug_error("socks5 proxy", "Invalid ATYP received (0x%X)\n", buf[3]); purple_proxy_connect_data_disconnect(connect_data, - _("Received invalid data on connection with server.")); + _("Received invalid data on connection with server")); return; } @@ -1567,7 +1567,7 @@ if (len == 0) { purple_proxy_connect_data_disconnect(connect_data, - _("Server closed the connection.")); + _("Server closed the connection")); return; } @@ -1579,7 +1579,7 @@ /* Error! */ purple_proxy_connect_data_disconnect_formatted(connect_data, - _("Lost connection with server:\n%s"), g_strerror(errno)); + _("Lost connection with server: %s"), g_strerror(errno)); return; } @@ -1592,7 +1592,7 @@ if ((connect_data->read_buffer[0] != 0x01) || (connect_data->read_buffer[1] != 0x00)) { purple_proxy_connect_data_disconnect(connect_data, - _("Received invalid data on connection with server.")); + _("Received invalid data on connection with server")); return; } @@ -1663,7 +1663,7 @@ if (*cmdbuf != 0x01) { purple_proxy_connect_data_disconnect(connect_data, - _("Received invalid data on connection with server.")); + _("Received invalid data on connection with server")); return -1; } cmdbuf++; @@ -1764,7 +1764,7 @@ "of the socks5 CHAP specification. " "Disconnecting..."); purple_proxy_connect_data_disconnect(connect_data, - _("Received invalid data on connection with server.")); + _("Received invalid data on connection with server")); return -1; } break; @@ -1803,7 +1803,7 @@ if (len == 0) { purple_proxy_connect_data_disconnect(connect_data, - _("Server closed the connection.")); + _("Server closed the connection")); return; } @@ -1814,7 +1814,7 @@ /* Error! */ purple_proxy_connect_data_disconnect_formatted(connect_data, - _("Lost connection with server:\n%s"), g_strerror(errno)); + _("Lost connection with server: %s"), g_strerror(errno)); return; } @@ -1878,7 +1878,7 @@ if (len == 0) { purple_proxy_connect_data_disconnect(connect_data, - _("Server closed the connection.")); + _("Server closed the connection")); return; } @@ -1890,7 +1890,7 @@ /* Error! */ purple_proxy_connect_data_disconnect_formatted(connect_data, - _("Lost connection with server:\n%s"), g_strerror(errno)); + _("Lost connection with server: %s"), g_strerror(errno)); return; } @@ -1903,7 +1903,7 @@ if ((connect_data->read_buffer[0] != 0x05) || (connect_data->read_buffer[1] == 0xff)) { purple_proxy_connect_data_disconnect(connect_data, - _("Received invalid data on connection with server.")); + _("Received invalid data on connection with server")); return; } @@ -2044,7 +2044,7 @@ if (connect_data->fd < 0) { purple_proxy_connect_data_disconnect_formatted(connect_data, - _("Unable to create socket:\n%s"), g_strerror(errno)); + _("Unable to create socket: %s"), g_strerror(errno)); return; } @@ -2156,7 +2156,7 @@ if (hosts == NULL) { - purple_proxy_connect_data_disconnect(connect_data, _("Could not resolve host name")); + purple_proxy_connect_data_disconnect(connect_data, _("Unable to resolve hostname")); return; }
--- a/libpurple/util.c Mon Jul 06 06:04:34 2009 +0000 +++ b/libpurple/util.c Mon Jul 06 09:08:17 2009 +0000 @@ -3796,8 +3796,7 @@ while (*s) { /* Read the size of this chunk */ - if (sscanf(s, "%" G_GSIZE_MODIFIER "x\r\n", &sz) != 1 && - sscanf(s, "%" G_GSIZE_MODIFIER "x;", &sz) != 1) + if (sscanf(s, "%" G_GSIZE_MODIFIER "x", &sz) != 1) { purple_debug_error("util", "Error processing chunked data: " "Expected data length, found: %s\n", s); @@ -4185,8 +4184,9 @@ if (purple_strcasestr(url, "https://") != NULL) { if (!purple_ssl_is_supported()) { purple_util_fetch_url_error(gfud, - _("Unable to connect to %s: Server requires TLS/SSL, but no TLS/SSL support was found."), - gfud->website.address); + _("Unable to connect to %s: %s"), + gfud->website.address, + _("Server requires TLS/SSL, but no TLS/SSL support was found.")); return NULL; }