Mercurial > pidgin
diff libpurple/protocols/yahoo/yahoo.c @ 20776:f3cfcbbac3d8
propagate from branch 'im.pidgin.pidgin' (head 294731552d0baf5f1f37a45e0c119b2188f34ba8)
to branch 'im.pidgin.cpw.resiak.disconnectreason' (head 548e06334e7772c9583776ecbd80e8d2a68fcd79)
author | Will Thompson <will.thompson@collabora.co.uk> |
---|---|
date | Fri, 05 Oct 2007 15:50:17 +0000 |
parents | b1a42d258a14 b4ac690a2225 |
children | efa448405f3d |
line wrap: on
line diff
--- a/libpurple/protocols/yahoo/yahoo.c Thu Oct 04 03:52:47 2007 +0000 +++ b/libpurple/protocols/yahoo/yahoo.c Fri Oct 05 15:50:17 2007 +0000 @@ -204,7 +204,8 @@ gc->wants_to_die = TRUE; if (!purple_account_get_remember_password(account)) purple_account_set_password(account, NULL); - purple_connection_error(gc, _("You have signed on from another location.")); + purple_connection_error_reason(gc, PURPLE_REASON_NAME_IN_USE, + _("You have signed on from another location.")); return; } @@ -2140,7 +2141,7 @@ fullmsg = g_strdup(msg); gc->wants_to_die = TRUE; - purple_connection_error(gc, fullmsg); + purple_connection_error_reason(gc, PURPLE_REASON_AUTHENTICATION_FAILED, fullmsg); g_free(msg); g_free(fullmsg); } @@ -2464,11 +2465,12 @@ tmp = g_strdup_printf(_("Lost connection with server:\n%s"), strerror(errno)); - purple_connection_error(gc, tmp); + purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR, tmp); g_free(tmp); return; } else if (len == 0) { - purple_connection_error(gc, _("Server closed the connection.")); + purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR, + _("Server closed the connection.")); return; } @@ -2559,7 +2561,7 @@ gchar *tmp; tmp = g_strdup_printf(_("Could not establish a connection with the server:\n%s"), error_message); - purple_connection_error(gc, tmp); + purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR, tmp); g_free(tmp); return; } @@ -2591,7 +2593,7 @@ gchar *tmp; tmp = g_strdup_printf(_("Could not establish a connection with the server:\n%s"), error_message); - purple_connection_error(gc, tmp); + purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR, tmp); g_free(tmp); return; } @@ -2631,11 +2633,12 @@ tmp = g_strdup_printf(_("Lost connection with server:\n%s"), strerror(errno)); - purple_connection_error(gc, tmp); + purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR, tmp); g_free(tmp); return; } else if (len == 0) { - purple_connection_error(gc, _("Server closed the connection.")); + purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR, + _("Server closed the connection.")); return; } @@ -2650,7 +2653,8 @@ 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(gc, _("Received unexpected HTTP response from server.")); + purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR, + _("Received unexpected HTTP response from server.")); return; } @@ -2672,9 +2676,10 @@ yd->rxlen = 0; /* Now we have our cookies to login with. I'll go get the milk. */ if (purple_proxy_connect(gc, account, "wcs2.msg.dcn.yahoo.com", - purple_account_get_int(account, "port", YAHOO_PAGER_PORT), - yahoo_got_web_connected, gc) == NULL) { - purple_connection_error(gc, _("Connection problem")); + purple_account_get_int(account, "port", YAHOO_PAGER_PORT), + yahoo_got_web_connected, gc) == NULL) { + purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR, + _("Connection problem")); return; } } @@ -2702,7 +2707,7 @@ gc->inpa = 0; tmp = g_strdup_printf(_("Lost connection with %s:\n%s"), "login.yahoo.com:80", strerror(errno)); - purple_connection_error(gc, tmp); + purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR, tmp); g_free(tmp); return; } @@ -2727,7 +2732,7 @@ gchar *tmp; tmp = g_strdup_printf(_("Could not establish a connection with %s:\n%s"), "login.yahoo.com:80", error_message); - purple_connection_error(gc, tmp); + purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR, tmp); g_free(tmp); return; } @@ -2811,7 +2816,8 @@ if (error_message != NULL) { - purple_connection_error(gc, error_message); + purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR, + error_message); return; } @@ -2860,7 +2866,8 @@ g_hash_table_destroy(hash); 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(gc, _("Connection problem")); + purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR, + _("Connection problem")); return; } @@ -2963,7 +2970,8 @@ purple_account_get_int(account, "port", YAHOO_PAGER_PORT), yahoo_got_connected, gc) == NULL) { - purple_connection_error(gc, _("Connection problem")); + purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR, + _("Connection problem")); return; } } else { @@ -2973,7 +2981,8 @@ purple_account_get_int(account, "port", YAHOO_PAGER_PORT), yahoo_got_connected, gc) == NULL) { - purple_connection_error(gc, _("Connection problem")); + purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR, + _("Connection problem")); return; } }