# HG changeset patch # User Will Thompson # Date 1190133588 0 # Node ID 94062344397c8e92846f131322c53bb231a71861 # Parent 88b97e07f35f9e21fd9a351502c567ac5bf1bd65 Modify gadu-gadu to use purple_connection_error_reason. I'm not sure about some of these. diff -r 88b97e07f35f -r 94062344397c libpurple/protocols/gg/gg.c --- a/libpurple/protocols/gg/gg.c Tue Sep 18 16:32:46 2007 +0000 +++ b/libpurple/protocols/gg/gg.c Tue Sep 18 16:39:48 2007 +0000 @@ -381,12 +381,15 @@ if (email == NULL || p1 == NULL || p2 == NULL || t == NULL || *email == '\0' || *p1 == '\0' || *p2 == '\0' || *t == '\0') { - purple_connection_error(gc, _("Fill in the registration fields.")); + purple_connection_error_reason (gc, PURPLE_REASON_OTHER_ERROR, + _("Fill in the registration fields.")); goto exit_err; } if (g_utf8_collate(p1, p2) != 0) { - purple_connection_error(gc, _("Passwords do not match.")); + purple_connection_error_reason (gc, + PURPLE_REASON_AUTHENTICATION_FAILED, + _("Passwords do not match.")); goto exit_err; } @@ -394,7 +397,7 @@ token->id, t); h = gg_register3(email, p1, token->id, t, 0); if (h == NULL || !(s = h->data) || !s->success) { - purple_connection_error(gc, + purple_connection_error_reason (gc, PURPLE_REASON_OTHER_ERROR, _("Unable to register new account. Error occurred.\n")); goto exit_err; } @@ -1307,7 +1310,8 @@ if (!(ev = gg_watch_fd(info->session))) { purple_debug_error("gg", "ggp_callback_recv: gg_watch_fd failed -- CRITICAL!\n"); - purple_connection_error(gc, _("Unable to read socket")); + purple_connection_error_reason (gc, PURPLE_REASON_NETWORK_ERROR, + _("Unable to read socket")); return; } @@ -1460,7 +1464,8 @@ if (!(ev = gg_watch_fd(info->session))) { purple_debug_error("gg", "login_handler: gg_watch_fd failed!\n"); - purple_connection_error(gc, _("Unable to read socket")); + purple_connection_error_reason (gc, PURPLE_REASON_NETWORK_ERROR, + _("Unable to read socket")); return; } purple_debug_info("gg", "login_handler: session->fd = %d\n", info->session->fd); @@ -1506,7 +1511,9 @@ case GG_EVENT_CONN_FAILED: purple_input_remove(gc->inpa); gc->inpa = 0; - purple_connection_error(gc, _("Connection failed.")); + purple_connection_error_reason (gc, + PURPLE_REASON_NETWORK_ERROR, + _("Connection failed.")); break; default: purple_debug_error("gg", "strange event: %d\n", ev->type); @@ -1712,7 +1719,8 @@ info->session = gg_login(glp); if (info->session == NULL) { - purple_connection_error(gc, _("Connection failed.")); + purple_connection_error_reason (gc, PURPLE_REASON_NETWORK_ERROR, + _("Connection failed.")); g_free(glp); return; } @@ -1995,7 +2003,8 @@ if (gg_ping(info->session) < 0) { purple_debug_info("gg", "Not connected to the server " "or gg_session is not correct\n"); - purple_connection_error(gc, _("Not connected to the server.")); + purple_connection_error_reason (gc, PURPLE_REASON_NETWORK_ERROR, + _("Not connected to the server.")); } } /* }}} */