Mercurial > pidgin.yaz
diff libpurple/protocols/jabber/jabber.c @ 32330:a5b556ac1de5
Rename purple_connection_error_reason to purple_connection_error
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sun, 21 Aug 2011 08:00:53 +0000 |
parents | ac43f26c7f61 |
children | dc3ea8f6381a |
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jabber.c Sun Aug 21 07:57:28 2011 +0000 +++ b/libpurple/protocols/jabber/jabber.c Sun Aug 21 08:00:53 2011 +0000 @@ -119,7 +119,7 @@ if(js->unregistration) jabber_unregister_account_cb(js); } else { - purple_connection_error_reason(js->gc, + purple_connection_error(js->gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, ("Error initializing session")); } @@ -153,7 +153,7 @@ js->user = jabber_id_new(full_jid); if (js->user == NULL) { - purple_connection_error_reason(js->gc, + purple_connection_error(js->gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Invalid response from server")); g_free(full_jid); @@ -170,7 +170,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(js->gc, reason, msg); g_free(msg); return; @@ -247,14 +247,14 @@ starttls = xmlnode_get_child(packet, "starttls"); if(xmlnode_get_child(starttls, "required")) { - purple_connection_error_reason(js->gc, + purple_connection_error(js->gc, PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT, _("Server requires TLS/SSL, but no TLS/SSL support was found.")); return TRUE; } if (g_str_equal("require_tls", purple_account_get_string(account, "connection_security", JABBER_DEFAULT_REQUIRE_TLS))) { - purple_connection_error_reason(js->gc, + purple_connection_error(js->gc, PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT, _("You require encryption, but no TLS/SSL support was found.")); return TRUE; @@ -275,7 +275,7 @@ return; } } else if (g_str_equal(connection_security, "require_tls") && !jabber_stream_is_ssl(js)) { - purple_connection_error_reason(js->gc, + purple_connection_error(js->gc, PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR, _("You require encryption, but it is not available on this server.")); return; @@ -320,7 +320,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(js->gc, reason, msg); g_free(msg); } @@ -407,7 +407,7 @@ else if (ret <= 0) { gchar *tmp = g_strdup_printf(_("Lost connection with server: %s"), g_strerror(errno)); - purple_connection_error_reason(js->gc, + purple_connection_error(js->gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp); g_free(tmp); return; @@ -443,7 +443,7 @@ if (!account->disconnecting) { gchar *tmp = g_strdup_printf(_("Lost connection with server: %s"), g_strerror(errno)); - purple_connection_error_reason(js->gc, + purple_connection_error(js->gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp); g_free(tmp); } @@ -544,7 +544,7 @@ purple_debug_error("jabber", "sasl_encode error %d: %s\n", rc, sasl_errdetail(js->sasl)); - purple_connection_error_reason(gc, + purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, error); g_free(error); @@ -617,7 +617,7 @@ static gboolean jabber_keepalive_timeout(PurpleConnection *gc) { JabberStream *js = gc->proto_data; - purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, + purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Ping timed out")); js->keepalive_timeout = 0; return FALSE; @@ -670,7 +670,7 @@ else tmp = g_strdup_printf(_("Lost connection with server: %s"), g_strerror(errno)); - purple_connection_error_reason(js->gc, + purple_connection_error(js->gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp); g_free(tmp); } @@ -702,7 +702,7 @@ purple_debug_error("jabber", "sasl_decode_error %d: %s\n", rc, sasl_errdetail(js->sasl)); - purple_connection_error_reason(gc, + purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, error); } else if (olen > 0) { @@ -728,7 +728,7 @@ else tmp = g_strdup_printf(_("Lost connection with server: %s"), g_strerror(errno)); - purple_connection_error_reason(js->gc, + purple_connection_error(js->gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp); g_free(tmp); } @@ -789,7 +789,7 @@ if (!found) { purple_debug_warning("jabber", "Unable to find alternative XMPP connection " "methods after failing to connect directly.\n"); - purple_connection_error_reason(js->gc, + purple_connection_error(js->gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Unable to connect")); return; @@ -874,7 +874,7 @@ if (purple_proxy_connect(js->gc, purple_connection_get_account(js->gc), host, port, jabber_login_callback, js->gc) == NULL) { if (fatal_failure) { - purple_connection_error_reason(js->gc, + purple_connection_error(js->gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Unable to connect")); } @@ -940,7 +940,7 @@ js->user = jabber_id_new(user); if (!js->user) { - purple_connection_error_reason(gc, + purple_connection_error(gc, PURPLE_CONNECTION_ERROR_INVALID_SETTINGS, _("Invalid XMPP ID")); g_free(user); @@ -949,7 +949,7 @@ } if (!js->user->node || *(js->user->node) == '\0') { - purple_connection_error_reason(gc, + purple_connection_error(gc, PURPLE_CONNECTION_ERROR_INVALID_SETTINGS, _("Invalid XMPP ID. Username portion must be set.")); g_free(user); @@ -958,7 +958,7 @@ } if (!js->user->domain || *(js->user->domain) == '\0') { - purple_connection_error_reason(gc, + purple_connection_error(gc, PURPLE_CONNECTION_ERROR_INVALID_SETTINGS, _("Invalid XMPP ID. Domain must be set.")); g_free(user); @@ -978,7 +978,7 @@ g_free(user); if (!js->user_jb) { /* This basically *can't* fail, but for good measure... */ - purple_connection_error_reason(gc, + purple_connection_error(gc, PURPLE_CONNECTION_ERROR_INVALID_SETTINGS, _("Invalid XMPP ID")); /* Destroying the connection will free the JabberStream */ @@ -1037,7 +1037,7 @@ if (js->bosh) jabber_bosh_connection_connect(js->bosh); else { - purple_connection_error_reason(gc, + purple_connection_error(gc, PURPLE_CONNECTION_ERROR_INVALID_SETTINGS, _("Malformed BOSH URL")); } @@ -1054,12 +1054,12 @@ purple_account_get_int(account, "port", 5223), jabber_login_callback_ssl, jabber_ssl_connect_failure, gc); if (!js->gsc) { - purple_connection_error_reason(gc, + purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT, _("Unable to establish SSL connection")); } } else { - purple_connection_error_reason(gc, + purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT, _("SSL support unavailable")); }