pidgin: 8d00fad3: Rename purple_connection_error_reason to...
markdoliner at pidgin.im
markdoliner at pidgin.im
Sun Aug 21 04:08:39 EDT 2011
----------------------------------------------------------------------
Revision: 8d00fad383d8a4bb6e15c1cb0ac18e7149aa085b
Parent: 1f514253ddd9ee1eaeaab94d37dfd0c8186b0fe4
Author: markdoliner at pidgin.im
Date: 08/21/11 04:00:53
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/8d00fad383d8a4bb6e15c1cb0ac18e7149aa085b
Changelog:
Rename purple_connection_error_reason to purple_connection_error
Changes against parent 1f514253ddd9ee1eaeaab94d37dfd0c8186b0fe4
patched ChangeLog.API
patched libpurple/connection.c
patched libpurple/connection.h
patched libpurple/protocols/bonjour/bonjour.c
patched libpurple/protocols/bonjour/mdns_win32.c
patched libpurple/protocols/gg/gg.c
patched libpurple/protocols/irc/irc.c
patched libpurple/protocols/irc/msgs.c
patched libpurple/protocols/irc/parse.c
patched libpurple/protocols/jabber/auth.c
patched libpurple/protocols/jabber/auth_cyrus.c
patched libpurple/protocols/jabber/auth_plain.c
patched libpurple/protocols/jabber/bosh.c
patched libpurple/protocols/jabber/jabber.c
patched libpurple/protocols/jabber/parser.c
patched libpurple/protocols/msn/msn.c
patched libpurple/protocols/msn/session.c
patched libpurple/protocols/mxit/http.c
patched libpurple/protocols/mxit/login.c
patched libpurple/protocols/mxit/protocol.c
patched libpurple/protocols/myspace/myspace.c
patched libpurple/protocols/myspace/user.c
patched libpurple/protocols/novell/novell.c
patched libpurple/protocols/oscar/clientlogin.c
patched libpurple/protocols/oscar/flap_connection.c
patched libpurple/protocols/oscar/oscar.c
patched libpurple/protocols/sametime/sametime.c
patched libpurple/protocols/silc/ops.c
patched libpurple/protocols/silc/silc.c
patched libpurple/protocols/silc/util.c
patched libpurple/protocols/silc10/ops.c
patched libpurple/protocols/silc10/silc.c
patched libpurple/protocols/simple/simple.c
patched libpurple/protocols/yahoo/libymsg.c
patched libpurple/protocols/yahoo/yahoo_packet.c
patched libpurple/protocols/yahoo/ycht.c
patched libpurple/protocols/zephyr/zephyr.c
-------------- next part --------------
============================================================
--- libpurple/protocols/irc/irc.c c50575ab5358f66696f67c259895634663e4efc1
+++ libpurple/protocols/irc/irc.c 2711e8001a672aebc7b00a5e18a167ff0a4372f6
@@ -130,7 +130,7 @@ irc_send_cb(gpointer data, gint source,
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 (gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
g_free(tmp);
return;
@@ -174,7 +174,7 @@ int irc_send_len(struct irc_conn *irc, c
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 (gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
g_free(tmp);
} else if (ret < buflen) {
@@ -359,7 +359,7 @@ static void irc_login(PurpleAccount *acc
gc->flags |= PURPLE_CONNECTION_NO_NEWLINES;
if (strpbrk(username, " \t\v\r\n") != NULL) {
- purple_connection_error_reason (gc,
+ purple_connection_error (gc,
PURPLE_CONNECTION_ERROR_INVALID_SETTINGS,
_("IRC nick and server may not contain whitespace"));
return;
@@ -390,7 +390,7 @@ static void irc_login(PurpleAccount *acc
purple_account_get_int(account, "port", IRC_DEFAULT_SSL_PORT),
irc_login_cb_ssl, irc_ssl_connect_failure, gc);
} else {
- purple_connection_error_reason (gc,
+ purple_connection_error (gc,
PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT,
_("SSL support unavailable"));
return;
@@ -403,7 +403,7 @@ static void irc_login(PurpleAccount *acc
purple_account_get_int(account, "port", IRC_DEFAULT_PORT),
irc_login_cb, gc) == NULL)
{
- purple_connection_error_reason (gc,
+ purple_connection_error (gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Unable to connect"));
return;
@@ -490,7 +490,7 @@ static void irc_login_cb(gpointer data,
if (source < 0) {
gchar *tmp = g_strdup_printf(_("Unable to connect: %s"),
error_message);
- purple_connection_error_reason (gc,
+ purple_connection_error (gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
g_free(tmp);
return;
@@ -699,12 +699,12 @@ static void irc_input_cb_ssl(gpointer da
} 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 (gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
g_free(tmp);
return;
} else if (len == 0) {
- purple_connection_error_reason (gc,
+ purple_connection_error (gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Server closed the connection"));
return;
@@ -730,12 +730,12 @@ static void irc_input_cb(gpointer data,
} 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 (gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
g_free(tmp);
return;
} else if (len == 0) {
- purple_connection_error_reason (gc,
+ purple_connection_error (gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Server closed the connection"));
return;
============================================================
--- libpurple/protocols/jabber/jabber.c ea24dc8eac78dc5c055c1b7afd5db9a1112cfc53
+++ libpurple/protocols/jabber/jabber.c 433eafec69f5a2661a8d46d61bcbb257fd03b08e
@@ -119,7 +119,7 @@ jabber_session_initialized_cb(JabberStre
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 @@ static void jabber_bind_result_cb(Jabber
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 @@ static void jabber_bind_result_cb(Jabber
} 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 @@ jabber_process_starttls(JabberStream *js
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 @@ void jabber_stream_features_parse(Jabber
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 @@ static void jabber_stream_handle_error(J
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 @@ static void jabber_send_cb(gpointer data
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 @@ static gboolean do_jabber_send_raw(Jabbe
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 @@ void jabber_send_raw(JabberStream *js, c
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
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 @@ jabber_recv_cb_ssl(gpointer data, Purple
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 @@ jabber_recv_cb(gpointer data, gint sourc
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 @@ jabber_recv_cb(gpointer data, gint sourc
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 @@ txt_resolved_cb(GList *responses, gpoint
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 @@ static gboolean jabber_login_connect(Jab
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 @@ jabber_stream_new(PurpleAccount *account
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 @@ jabber_stream_new(PurpleAccount *account
}
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 @@ jabber_stream_new(PurpleAccount *account
}
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 @@ jabber_stream_new(PurpleAccount *account
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 @@ jabber_stream_connect(JabberStream *js)
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 @@ jabber_stream_connect(JabberStream *js)
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"));
}
============================================================
--- libpurple/protocols/msn/msn.c bb50121259b8427e3b569b7e588392a4c4d377c1
+++ libpurple/protocols/msn/msn.c 0cbb4809cdbe8070d787e4850137d233b6cc1dcd
@@ -1333,7 +1333,7 @@ msn_login(PurpleAccount *account)
if (!purple_ssl_is_supported())
{
- purple_connection_error_reason(gc,
+ purple_connection_error(gc,
PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT,
_("SSL support is needed for MSN. Please install a supported "
"SSL library."));
@@ -1374,7 +1374,7 @@ msn_login(PurpleAccount *account)
}
if (!msn_session_connect(session, host, port, http_method))
- purple_connection_error_reason(gc,
+ purple_connection_error(gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Unable to connect"));
}
============================================================
--- libpurple/protocols/oscar/oscar.c e5f36539bc420857294980e4e01fac0ada7cb3f6
+++ libpurple/protocols/oscar/oscar.c 52b1a6aa506b5e0a94b78911ab7ba2f2c0cb4ffe
@@ -308,7 +308,7 @@ connection_common_error_cb(FlapConnectio
gchar *msg;
msg = g_strdup_printf(_("Unable to connect to authentication server: %s"),
error_message);
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, msg);
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, msg);
g_free(msg);
}
else if (conn->type == SNAC_FAMILY_LOCATE)
@@ -316,7 +316,7 @@ connection_common_error_cb(FlapConnectio
gchar *msg;
msg = g_strdup_printf(_("Unable to connect to BOS server: %s"),
error_message);
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, msg);
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, msg);
g_free(msg);
}
else
@@ -735,7 +735,7 @@ oscar_login(PurpleAccount *account)
if (!oscar_util_valid_name(purple_account_get_username(account))) {
gchar *buf;
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);
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_INVALID_SETTINGS, buf);
g_free(buf);
return;
}
@@ -756,7 +756,7 @@ oscar_login(PurpleAccount *account)
encryption_type = purple_account_get_string(account, "encryption", OSCAR_DEFAULT_ENCRYPTION);
if (!purple_ssl_is_supported() && strcmp(encryption_type, OSCAR_REQUIRE_ENCRYPTION) == 0) {
- purple_connection_error_reason(
+ purple_connection_error(
gc,
PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT,
_("You required encryption in your account settings, but encryption is not supported by your system."));
@@ -825,7 +825,7 @@ oscar_login(PurpleAccount *account)
}
if (newconn->gsc == NULL && newconn->connect_data == NULL) {
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Unable to connect"));
return;
}
@@ -1048,7 +1048,7 @@ int oscar_connect_to_bos(PurpleConnectio
if (conn->gsc == NULL && conn->connect_data == NULL)
{
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Unable to connect"));
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Unable to connect"));
return 0;
}
@@ -1087,41 +1087,41 @@ purple_parse_auth_resp(OscarData *od, Fl
switch (info->errorcode) {
case 0x01:
/* Unregistered username */
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_INVALID_USERNAME, _("Username does not exist"));
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_INVALID_USERNAME, _("Username does not exist"));
break;
case 0x05:
/* 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(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(gc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, _("Your account is currently suspended"));
break;
case 0x02:
case 0x14:
/* service temporarily unavailable */
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("The AOL Instant Messenger service is temporarily unavailable."));
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("The AOL Instant Messenger service is temporarily unavailable."));
break;
case 0x18:
/* username connecting too frequently */
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, _("Your username has been connecting and disconnecting too frequently. Wait ten minutes and try again. If you continue to try, you will need to wait even longer."));
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, _("Your username has been connecting and disconnecting too frequently. Wait ten minutes and try again. If you continue to try, you will need to wait even longer."));
break;
case 0x1c:
{
/* client too old */
g_snprintf(buf, sizeof(buf), _("The client version you are using is too old. Please upgrade at %s"),
oscar_get_ui_info_string("website", PURPLE_WEBSITE));
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, buf);
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, buf);
break;
}
case 0x1d:
/* IP address connecting too frequently */
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, _("Your IP address has been connecting and disconnecting too frequently. Wait a minute and try again. If you continue to try, you will need to wait even longer."));
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, _("Your IP address has been connecting and disconnecting too frequently. Wait a minute and try again. If you continue to try, you will need to wait even longer."));
break;
default:
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, _("Unknown reason"));
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, _("Unknown reason"));
break;
}
purple_debug_info("oscar", "Login Error Code 0x%04hx\n", info->errorcode);
@@ -1169,7 +1169,7 @@ purple_parse_auth_resp(OscarData *od, Fl
g_free(host);
if (newconn->gsc == NULL && newconn->connect_data == NULL)
{
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Unable to connect"));
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Unable to connect"));
return 0;
}
@@ -1199,7 +1199,7 @@ purple_parse_auth_securid_request_no_cb(
PurpleConnection *gc = user_data;
/* Disconnect */
- purple_connection_error_reason(gc,
+ purple_connection_error(gc,
PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED,
_("The SecurID key entered is invalid"));
}
@@ -1292,7 +1292,7 @@ purple_handle_redirect(OscarData *od, Fl
purple_debug_warning("oscar", "We won't use SSL for FLAP type 0x%04hx.\n", redir->group);
} else if (strcmp(encryption_type, OSCAR_REQUIRE_ENCRYPTION) == 0) {
purple_debug_error("oscar", "FLAP server %s:%d of type 0x%04hx doesn't support encryption.", host, port, redir->group);
- purple_connection_error_reason(
+ purple_connection_error(
gc,
PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT,
_("You required encryption in your account settings, but one of the servers doesn't support it."));
============================================================
--- libpurple/protocols/zephyr/zephyr.c 3e9a51760bb929a4a01fdcf3148844a354e03685
+++ libpurple/protocols/zephyr/zephyr.c 0fdd0d9dad0859eb0b9c3f2670eebea3afb8314b
@@ -146,7 +146,7 @@ struct _zephyr_triple {
return TRUE;
#define z_call_s(func, err) if (func != ZERR_NONE) {\
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, err);\
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, err);\
return;\
}
@@ -1585,7 +1585,7 @@ static void zephyr_login(PurpleAccount *
/* XXX z_call_s should actually try to report the com_err determined error */
if (use_tzc(zephyr)) {
pid_t pid;
- /* purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, "tzc not supported yet"); */
+ /* purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, "tzc not supported yet"); */
if ((pipe(zephyr->totzc) != 0) || (pipe(zephyr->fromtzc) != 0)) {
purple_debug_error("zephyr", "pipe creation failed. killing\n");
exit(-1);
@@ -1706,7 +1706,7 @@ static void zephyr_login(PurpleAccount *
ptr++;
}
if (ptr >=bufcur) {
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, "invalid output by tzc (or bad parsing code)");
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, "invalid output by tzc (or bad parsing code)");
free(buf);
return;
}
@@ -1821,7 +1821,7 @@ static void zephyr_login(PurpleAccount *
purple_debug_info("zephyr","realm: %s\n",zephyr->realm);
}
else {
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, "Only ZEPH0.2 supported currently");
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, "Only ZEPH0.2 supported currently");
return;
}
purple_debug_info("zephyr","does it get here\n");
============================================================
--- libpurple/protocols/gg/gg.c 54b48accfaa54546037cbe490a5057dfc5659ca7
+++ libpurple/protocols/gg/gg.c d398445e62f438fd236d2b35c7e6eead382c2975
@@ -354,14 +354,14 @@ static void ggp_callback_register_accoun
if (email == NULL || p1 == NULL || p2 == NULL || t == NULL ||
*email == '\0' || *p1 == '\0' || *p2 == '\0' || *t == '\0') {
- purple_connection_error_reason (gc,
+ purple_connection_error (gc,
PURPLE_CONNECTION_ERROR_OTHER_ERROR,
_("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 (gc,
PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED,
_("Passwords do not match"));
goto exit_err;
@@ -371,7 +371,7 @@ static void ggp_callback_register_accoun
token->id, t);
h = gg_register3(email, p1, token->id, t, 0);
if (h == NULL || !(s = h->data) || !s->success) {
- purple_connection_error_reason (gc,
+ purple_connection_error (gc,
PURPLE_CONNECTION_ERROR_OTHER_ERROR,
_("Unable to register new account. An unknown error occurred."));
goto exit_err;
@@ -1714,7 +1714,7 @@ static void ggp_callback_recv(gpointer _
if (!(ev = gg_watch_fd(info->session))) {
purple_debug_error("gg",
"ggp_callback_recv: gg_watch_fd failed -- CRITICAL!\n");
- purple_connection_error_reason (gc,
+ purple_connection_error (gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Unable to read from socket"));
return;
@@ -1880,7 +1880,7 @@ static void ggp_async_login_handler(gpoi
if (!(ev = gg_watch_fd(info->session))) {
purple_debug_error("gg", "login_handler: gg_watch_fd failed!\n");
- purple_connection_error_reason (gc,
+ purple_connection_error (gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Unable to read from socket"));
return;
@@ -1919,7 +1919,7 @@ static void ggp_async_login_handler(gpoi
case GG_EVENT_CONN_FAILED:
purple_input_remove(gc->inpa);
gc->inpa = 0;
- purple_connection_error_reason (gc,
+ purple_connection_error (gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Connection failed"));
break;
@@ -2157,7 +2157,7 @@ static void ggp_login(PurpleAccount *acc
if (addr == NULL) {
gchar *tmp = g_strdup_printf(_("Unable to resolve hostname '%s': %s"),
address, g_strerror(errno));
- purple_connection_error_reason(gc,
+ purple_connection_error(gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR, /* should this be a settings error? */
tmp);
g_free(tmp);
@@ -2172,7 +2172,7 @@ static void ggp_login(PurpleAccount *acc
info->session = gg_login(glp);
purple_connection_update_progress(gc, _("Connecting"), 0, 2);
if (info->session == NULL) {
- purple_connection_error_reason (gc,
+ purple_connection_error (gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Connection failed"));
g_free(glp);
@@ -2582,7 +2582,7 @@ static void ggp_keepalive(PurpleConnecti
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_reason (gc,
+ purple_connection_error (gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Not connected to the server"));
}
============================================================
--- libpurple/protocols/yahoo/libymsg.c 7a64ff71a5ef64295f68cfc3e49a4c0c9af7c19f
+++ libpurple/protocols/yahoo/libymsg.c 7d40600cccbdece77c95fc0dab2cb23410ea5a6e
@@ -159,7 +159,7 @@ static void yahoo_process_status(PurpleC
if (pkt->service == YAHOO_SERVICE_LOGOFF && pkt->status == -1) {
if (!purple_account_get_remember_password(account))
purple_account_set_password(account, NULL);
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NAME_IN_USE,
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NAME_IN_USE,
_("You have signed on from another location"));
return;
}
@@ -1803,7 +1803,7 @@ static void yahoo_auth16_stage2(PurpleUt
if (error_message != NULL) {
purple_debug_error("yahoo", "Login Failed, unable to retrieve stage 2 url: %s\n", error_message);
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, error_message);
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, error_message);
g_free(auth_data->seed);
g_free(auth_data);
return;
@@ -1890,7 +1890,7 @@ static void yahoo_auth16_stage2(PurpleUt
if(error_reason) {
purple_debug_error("yahoo", "Authentication error: %s. "
"Code %d\n", error_reason, response_no);
- purple_connection_error_reason(gc, error, error_reason);
+ purple_connection_error(gc, error, error_reason);
g_free(error_reason);
g_free(auth_data->seed);
g_free(auth_data);
@@ -1919,7 +1919,7 @@ static void yahoo_auth16_stage1_cb(Purpl
if (error_message != NULL) {
purple_debug_error("yahoo", "Login Failed, unable to retrieve login url: %s\n", error_message);
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, error_message);
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, error_message);
g_free(auth_data->seed);
g_free(auth_data);
return;
@@ -2000,7 +2000,7 @@ static void yahoo_auth16_stage1_cb(Purpl
}
purple_debug_error("yahoo", "Authentication error: %s. Code %d\n",
error_reason, response_no);
- purple_connection_error_reason(gc, error, error_reason);
+ purple_connection_error(gc, error, error_reason);
g_free(error_reason);
g_free(auth_data->seed);
g_free(auth_data);
@@ -2040,7 +2040,7 @@ static void yahoo_auth16_stage1(PurpleCo
purple_debug_info("yahoo", "Authentication: In yahoo_auth16_stage1\n");
if(!purple_ssl_is_supported()) {
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT, _("SSL support unavailable"));
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT, _("SSL support unavailable"));
return;
}
@@ -2285,7 +2285,7 @@ static void yahoo_process_authresp(Purpl
else
fullmsg = g_strdup(msg);
- purple_connection_error_reason(gc, reason, fullmsg);
+ purple_connection_error(gc, reason, fullmsg);
g_free(msg);
g_free(fullmsg);
}
@@ -3147,11 +3147,11 @@ static void yahoo_pending(gpointer data,
tmp = g_strdup_printf(_("Lost connection with server: %s"),
g_strerror(errno));
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
+ purple_connection_error(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,
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Server closed the connection"));
return;
}
@@ -3235,7 +3235,7 @@ static void yahoo_got_connected(gpointer
if (source < 0) {
gchar *tmp;
tmp = g_strdup_printf(_("Unable to connect: %s"), error_message);
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
g_free(tmp);
return;
}
@@ -3261,7 +3261,7 @@ static void yahoo_got_web_connected(gpoi
if (source < 0) {
gchar *tmp;
tmp = g_strdup_printf(_("Unable to connect: %s"), error_message);
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
g_free(tmp);
return;
}
@@ -3301,11 +3301,11 @@ static void yahoo_web_pending(gpointer d
tmp = g_strdup_printf(_("Lost connection with server: %s"),
g_strerror(errno));
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
+ purple_connection_error(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,
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Server closed the connection"));
return;
}
@@ -3321,7 +3321,7 @@ static void yahoo_web_pending(gpointer d
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,
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Received unexpected HTTP response from server"));
purple_debug_misc("yahoo", "Unexpected HTTP response: %s\n", buf);
return;
@@ -3351,7 +3351,7 @@ static void yahoo_web_pending(gpointer d
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_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Unable to connect"));
return;
}
@@ -3380,7 +3380,7 @@ static void yahoo_got_cookies_send_cb(gp
gc->inpa = 0;
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);
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
g_free(tmp);
return;
}
@@ -3405,7 +3405,7 @@ static void yahoo_got_cookies(gpointer d
gchar *tmp;
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);
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
g_free(tmp);
return;
}
@@ -3489,7 +3489,7 @@ yahoo_login_page_cb(PurpleUtilFetchUrlDa
if (error_message != NULL)
{
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
error_message);
return;
}
@@ -3539,7 +3539,7 @@ yahoo_login_page_cb(PurpleUtilFetchUrlDa
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_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Unable to connect"));
return;
}
@@ -3619,12 +3619,12 @@ static void yahoo_got_pager_server(Purpl
error_message ? error_message : "(null)");
if(yahoo_is_japan(a)) { /* We don't know fallback hosts for Yahoo Japan :( */
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Unable to connect: The server returned an empty response."));
} else {
if(purple_proxy_connect(gc, a, YAHOO_PAGER_HOST_FALLBACK, port,
yahoo_got_connected, gc) == NULL) {
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Unable to connect"));
}
}
@@ -3646,20 +3646,20 @@ static void yahoo_got_pager_server(Purpl
if(cs_server) { /* got an address; get on with connecting */
if(purple_proxy_connect(gc, a, cs_server, port, yahoo_got_connected, gc) == NULL)
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Unable to connect"));
} else {
purple_debug_error("yahoo", "No CS address retrieved! Server "
"response:\n%s\n", url_text ? url_text : "(null)");
if(yahoo_is_japan(a)) { /* We don't know fallback hosts for Yahoo Japan :( */
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Unable to connect: The server's response did not contain "
"the necessary information"));
} else
if(purple_proxy_connect(gc, a, YAHOO_PAGER_HOST_FALLBACK, port,
yahoo_got_connected, gc) == NULL) {
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Unable to connect"));
}
}
============================================================
--- libpurple/protocols/msn/session.c e026000c2dd603d8e5e15eafdb5210751fce66c2
+++ libpurple/protocols/msn/session.c ecc04c767dd6d9c5f66fcc137c59e6b6d0e0cbf3
@@ -420,7 +420,7 @@ msn_session_set_error(MsnSession *sessio
msn_session_disconnect(session);
- purple_connection_error_reason(gc, reason, msg);
+ purple_connection_error(gc, reason, msg);
g_free(msg);
}
============================================================
--- libpurple/connection.c 3df7e683632b0ffbb878ddee6cd20be3ce87095c
+++ libpurple/connection.c c82ad48edd5011deb0c9c0395997078a06adbb2d
@@ -528,7 +528,7 @@ void
}
void
-purple_connection_error_reason (PurpleConnection *gc,
+purple_connection_error (PurpleConnection *gc,
PurpleConnectionError reason,
const char *description)
{
@@ -542,13 +542,13 @@ purple_connection_error_reason (PurpleCo
*/
if (reason > PURPLE_CONNECTION_ERROR_OTHER_ERROR) {
purple_debug_error("connection",
- "purple_connection_error_reason: reason %u isn't a "
+ "purple_connection_error: reason %u isn't a "
"valid reason\n", reason);
reason = PURPLE_CONNECTION_ERROR_OTHER_ERROR;
}
if (description == NULL) {
- purple_debug_error("connection", "purple_connection_error_reason called with NULL description\n");
+ purple_debug_error("connection", "purple_connection_error called with NULL description\n");
description = _("Unknown error");
}
@@ -595,7 +595,7 @@ purple_connection_ssl_error (PurpleConne
reason = PURPLE_CONNECTION_ERROR_CERT_OTHER_ERROR;
}
- purple_connection_error_reason (gc, reason,
+ purple_connection_error (gc, reason,
purple_ssl_strerror(ssl_error));
}
============================================================
--- libpurple/connection.h 7451f7ab69e099c633ccf85942badacd22c43c50
+++ libpurple/connection.h bd283d6499a978f990ebc0698ae29cb2727db719
@@ -128,7 +128,7 @@ typedef enum
/** Some other error occurred which fits into none of the other
* categories.
*/
- /* purple_connection_error_reason() in connection.c uses the fact that
+ /* purple_connection_error() in connection.c uses the fact that
* this is the last member of the enum when sanity-checking; if other
* reasons are added after it, the check must be updated.
*/
@@ -215,7 +215,7 @@ typedef struct
* #PURPLE_CONNECTION_ERROR_OTHER_ERROR, if not.
* @param text a localized message describing the disconnection
* in more detail to the user.
- * @see #purple_connection_error_reason
+ * @see #purple_connection_error
*
* @since 2.3.0
*/
@@ -252,7 +252,7 @@ struct _PurpleConnection
/** Wants to Die state. This is set when the user chooses to log out, or
* when the protocol is disconnected and should not be automatically
* reconnected (incorrect password, etc.). prpls should rely on
- * purple_connection_error_reason() to set this for them rather than
+ * purple_connection_error() to set this for them rather than
* setting it themselves.
* @see purple_connection_error_is_fatal
*/
@@ -465,14 +465,14 @@ void
* @since 2.3.0
*/
void
-purple_connection_error_reason (PurpleConnection *gc,
- PurpleConnectionError reason,
- const char *description);
+purple_connection_error(PurpleConnection *gc,
+ PurpleConnectionError reason,
+ const char *description);
/**
* Closes a connection due to an SSL error; this is basically a shortcut to
* turning the #PurpleSslErrorType into a #PurpleConnectionError and a
- * human-readable string and then calling purple_connection_error_reason().
+ * human-readable string and then calling purple_connection_error().
*
* @since 2.3.0
*/
============================================================
--- libpurple/protocols/irc/msgs.c e3a01ebf143502b0ea9b59aa3c2294f818608ea5
+++ libpurple/protocols/irc/msgs.c 062a97bb86a323755845d4bc2a85a26657cf391b
@@ -1075,7 +1075,7 @@ void irc_msg_badnick(struct irc_conn *ir
_("Your selected nickname was rejected by the server. It probably contains invalid characters."));
} else {
- purple_connection_error_reason (gc,
+ purple_connection_error (gc,
PURPLE_CONNECTION_ERROR_INVALID_SETTINGS,
_("Your selected account name was rejected by the server. It probably contains invalid characters."));
}
============================================================
--- libpurple/protocols/irc/parse.c 2a9a5d6a67100220c2f4186e69e281f55a1f3f18
+++ libpurple/protocols/irc/parse.c 96e4f4e12e436c0db7935c1d11fbd1a424982935
@@ -670,11 +670,11 @@ void irc_parse_msg(struct irc_conn *irc,
} else if (!strncmp(input, "ERROR ", 6)) {
if (g_utf8_validate(input, -1, NULL)) {
char *tmp = g_strdup_printf("%s\n%s", _("Disconnected."), input);
- purple_connection_error_reason (gc,
+ purple_connection_error (gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
g_free(tmp);
} else
- purple_connection_error_reason (gc,
+ purple_connection_error (gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Disconnected."));
return;
============================================================
--- libpurple/protocols/jabber/auth.c bec1a5293c6078d9a9cef298a53403f114b3e034
+++ libpurple/protocols/jabber/auth.c 783c4232424ebc280a2dc992e1497b7884054021
@@ -77,7 +77,7 @@ static void disallow_plaintext_auth(Purp
static void disallow_plaintext_auth(PurpleAccount *account)
{
- purple_connection_error_reason(purple_account_get_connection(account),
+ purple_connection_error(purple_account_get_connection(account),
PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR,
_("Server requires plaintext authentication over an unencrypted stream"));
}
@@ -145,7 +145,7 @@ jabber_auth_start(JabberStream *js, xmln
mechs = xmlnode_get_child(packet, "mechanisms");
if(!mechs) {
- purple_connection_error_reason(js->gc,
+ purple_connection_error(js->gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Invalid response from server"));
return;
@@ -186,7 +186,7 @@ jabber_auth_start(JabberStream *js, xmln
if (js->auth_mech == NULL) {
/* Found no good mechanisms... */
- purple_connection_error_reason(js->gc,
+ purple_connection_error(js->gc,
PURPLE_CONNECTION_ERROR_AUTHENTICATION_IMPOSSIBLE,
_("Server does not use any supported authentication method"));
return;
@@ -194,7 +194,7 @@ jabber_auth_start(JabberStream *js, xmln
state = js->auth_mech->start(js, mechs, &response, &msg);
if (state == JABBER_SASL_STATE_FAIL) {
- purple_connection_error_reason(js->gc,
+ purple_connection_error(js->gc,
PURPLE_CONNECTION_ERROR_AUTHENTICATION_IMPOSSIBLE,
msg ? msg : _("Unknown Error"));
} else if (response) {
@@ -231,7 +231,7 @@ static void auth_old_result_cb(JabberStr
purple_account_set_password(account, NULL);
}
- purple_connection_error_reason(js->gc, reason, msg);
+ purple_connection_error(js->gc, reason, msg);
g_free(msg);
}
}
@@ -247,7 +247,7 @@ static void auth_old_cb(JabberStream *js
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(js->gc, reason, msg);
g_free(msg);
} else if (type == JABBER_IQ_RESULT) {
query = xmlnode_get_child(packet, "query");
@@ -321,7 +321,7 @@ static void auth_old_cb(JabberStream *js
}
finish_plaintext_authentication(js);
} else {
- purple_connection_error_reason(js->gc,
+ purple_connection_error(js->gc,
PURPLE_CONNECTION_ERROR_AUTHENTICATION_IMPOSSIBLE,
_("Server does not use any supported authentication method"));
return;
@@ -345,7 +345,7 @@ void jabber_auth_start_old(JabberStream
if (!jabber_stream_is_ssl(js) &&
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_ENCRYPTION_ERROR,
_("You require encryption, but it is not available on this server."));
return;
@@ -394,7 +394,7 @@ jabber_auth_handle_challenge(JabberStrea
const char *ns = xmlnode_get_namespace(packet);
if (!purple_strequal(ns, NS_XMPP_SASL)) {
- purple_connection_error_reason(js->gc,
+ purple_connection_error(js->gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Invalid response from server"));
return;
@@ -405,7 +405,7 @@ jabber_auth_handle_challenge(JabberStrea
char *msg = NULL;
JabberSaslState state = js->auth_mech->handle_challenge(js, packet, &response, &msg);
if (state == JABBER_SASL_STATE_FAIL) {
- purple_connection_error_reason(js->gc,
+ purple_connection_error(js->gc,
PURPLE_CONNECTION_ERROR_AUTHENTICATION_IMPOSSIBLE,
msg ? msg : _("Invalid challenge from server"));
} else if (response) {
@@ -423,7 +423,7 @@ void jabber_auth_handle_success(JabberSt
const char *ns = xmlnode_get_namespace(packet);
if (!purple_strequal(ns, NS_XMPP_SASL)) {
- purple_connection_error_reason(js->gc,
+ purple_connection_error(js->gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Invalid response from server"));
return;
@@ -434,12 +434,12 @@ void jabber_auth_handle_success(JabberSt
JabberSaslState state = js->auth_mech->handle_success(js, packet, &msg);
if (state == JABBER_SASL_STATE_FAIL) {
- purple_connection_error_reason(js->gc,
+ purple_connection_error(js->gc,
PURPLE_CONNECTION_ERROR_AUTHENTICATION_IMPOSSIBLE,
msg ? msg : _("Invalid response from server"));
return;
} else if (state == JABBER_SASL_STATE_CONTINUE) {
- purple_connection_error_reason(js->gc,
+ purple_connection_error(js->gc,
PURPLE_CONNECTION_ERROR_AUTHENTICATION_IMPOSSIBLE,
msg ? msg : _("Server thinks authentication is complete, but client does not"));
return;
@@ -479,11 +479,11 @@ void jabber_auth_handle_failure(JabberSt
msg = jabber_parse_error(js, packet, &reason);
if (!msg) {
- purple_connection_error_reason(js->gc,
+ purple_connection_error(js->gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Invalid response from server"));
} else {
- purple_connection_error_reason(js->gc, reason, msg);
+ purple_connection_error(js->gc, reason, msg);
g_free(msg);
}
}
============================================================
--- libpurple/protocols/jabber/parser.c 3e583281ad12eae1efe37e6296357dcabb9b0edf
+++ libpurple/protocols/jabber/parser.c c11c205994b7ca4ee3ba51a63148b1c9383870bf
@@ -52,7 +52,7 @@ jabber_parser_element_start_libxml(void
*/
purple_debug_error("jabber", "Expecting stream header, got %s with "
"xmlns %s\n", element_name, namespace);
- purple_connection_error_reason(js->gc,
+ purple_connection_error(js->gc,
PURPLE_CONNECTION_ERROR_AUTHENTICATION_IMPOSSIBLE,
_("XMPP stream header missing"));
return;
@@ -73,7 +73,7 @@ jabber_parser_element_start_libxml(void
if (js->protocol_version.major > 1) {
/* TODO: Send <unsupported-version/> error */
- purple_connection_error_reason(js->gc,
+ purple_connection_error(js->gc,
PURPLE_CONNECTION_ERROR_AUTHENTICATION_IMPOSSIBLE,
_("XMPP Version Mismatch"));
g_free(attrib);
@@ -98,7 +98,7 @@ jabber_parser_element_start_libxml(void
/* This was underspecified in rfc3920 as only being a SHOULD, so
* we cannot rely on it. See #12331 and Oracle's server.
*/
- purple_connection_error_reason(js->gc,
+ purple_connection_error(js->gc,
PURPLE_CONNECTION_ERROR_AUTHENTICATION_IMPOSSIBLE,
_("XMPP stream missing ID"));
#else
@@ -300,7 +300,7 @@ void jabber_parser_process(JabberStream
break;
case XML_ERR_FATAL:
purple_debug_error("jabber", "xmlParseChunk returned fatal %i\n", ret);
- purple_connection_error_reason (js->gc,
+ purple_connection_error (js->gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("XML Parse error"));
break;
============================================================
--- libpurple/protocols/novell/novell.c 068fb38ed404fd2ad79057e3ef7eaf2e50630577
+++ libpurple/protocols/novell/novell.c 38d97475ce77c0fcd31ea0debd9b13c48d2a152b
@@ -140,7 +140,7 @@ _login_resp_cb(NMUser * user, NMERR_T re
reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR;
}
- purple_connection_error_reason(gc, reason, err);
+ purple_connection_error(gc, reason, err);
g_free(err);
}
}
@@ -1126,7 +1126,7 @@ _check_for_disconnect(NMUser * user, NME
if (_is_disconnect_error(err)) {
- purple_connection_error_reason(gc,
+ purple_connection_error(gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Error communicating with server. Closing connection."));
return TRUE;
@@ -1702,7 +1702,7 @@ novell_ssl_recv_cb(gpointer data, Purple
if (_is_disconnect_error(rc)) {
- purple_connection_error_reason(gc,
+ purple_connection_error(gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Error communicating with server. Closing connection."));
} else {
@@ -1743,7 +1743,7 @@ novell_ssl_connected_cb(gpointer data, P
conn->connected = TRUE;
purple_ssl_input_add(gsc, novell_ssl_recv_cb, gc);
} else {
- purple_connection_error_reason(gc,
+ purple_connection_error(gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Unable to connect"));
}
@@ -2028,7 +2028,7 @@ _evt_user_disconnect(NMUser * user, NMEv
{
if (!purple_account_get_remember_password(account))
purple_account_set_password(account, NULL);
- purple_connection_error_reason(gc,
+ purple_connection_error(gc,
PURPLE_CONNECTION_ERROR_NAME_IN_USE,
_("You have signed on from another location"));
}
@@ -2184,7 +2184,7 @@ novell_login(PurpleAccount * account)
*/
/* ...but for now just error out with a nice message. */
- purple_connection_error_reason(gc,
+ purple_connection_error(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,7 +2213,7 @@ novell_login(PurpleAccount * account)
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(gc,
PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT,
_("SSL support unavailable"));
}
============================================================
--- libpurple/protocols/silc/ops.c 30ab18780af11a53b6564a44c4e8ebfc1a296d78
+++ libpurple/protocols/silc/ops.c 4858bfe02aa534943ce720f6a4302d0eb40fafb9
@@ -72,7 +72,7 @@ void silc_say(SilcClient client, SilcCli
gc = client->application;
if (gc != NULL)
- purple_connection_error_reason(gc, reason, tmp);
+ purple_connection_error(gc, reason, tmp);
else
purple_notify_error(NULL, _("Error"), _("Error occurred"), tmp);
}
============================================================
--- libpurple/protocols/silc/silc.c 44579749a5fb879df8c2c87ae38600a0aaa280b9
+++ libpurple/protocols/silc/silc.c d521e3cf8c4cf75b4e8ffc1e6af24bb4c3ae4307
@@ -316,7 +316,7 @@ silcpurple_connect_cb(SilcClient client,
/* Close the connection */
if (!sg->detaching)
- purple_connection_error_reason(gc,
+ purple_connection_error(gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Disconnected by server"));
else
@@ -325,30 +325,30 @@ silcpurple_connect_cb(SilcClient client,
break;
case SILC_CLIENT_CONN_ERROR:
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Error connecting to SILC Server"));
g_unlink(silcpurple_session_file(purple_account_get_username(sg->account)));
break;
case SILC_CLIENT_CONN_ERROR_KE:
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR,
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR,
_("Key Exchange failed"));
break;
case SILC_CLIENT_CONN_ERROR_AUTH:
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED,
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED,
_("Authentication failed"));
break;
case SILC_CLIENT_CONN_ERROR_RESUME:
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR,
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR,
_("Resuming detached session failed. "
"Press Reconnect to create new connection."));
g_unlink(silcpurple_session_file(purple_account_get_username(sg->account)));
break;
case SILC_CLIENT_CONN_ERROR_TIMEOUT:
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Connection timed out"));
break;
}
@@ -370,7 +370,7 @@ silcpurple_stream_created(SilcSocketStre
sg = gc->proto_data;
if (status != SILC_SOCKET_OK) {
- purple_connection_error_reason(gc,
+ purple_connection_error(gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Connection failed"));
silc_pkcs_public_key_free(sg->public_key);
@@ -418,7 +418,7 @@ silcpurple_login_connected(gpointer data
sg = gc->proto_data;
if (source < 0) {
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Connection failed"));
silc_pkcs_public_key_free(sg->public_key);
silc_pkcs_private_key_free(sg->private_key);
@@ -447,7 +447,7 @@ static void silcpurple_continue_running(
purple_account_get_int(account, "port", 706),
silcpurple_login_connected, gc) == NULL)
{
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Unable to connect"));
gc->proto_data = NULL;
silc_free(sg);
@@ -490,7 +490,7 @@ static void silcpurple_got_password_cb(P
(char *)purple_account_get_string(account, "private-key", prd),
password,
&sg->public_key, &sg->private_key)) {
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR,
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR,
_("Unable to load SILC key pair"));
gc->proto_data = NULL;
silc_free(sg);
@@ -506,7 +506,7 @@ static void silcpurple_no_password_cb(Pu
if (!PURPLE_CONNECTION_IS_VALID(gc))
return;
sg = gc->proto_data;
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR,
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR,
_("Unable to load SILC key pair"));
gc->proto_data = NULL;
silc_free(sg);
@@ -535,7 +535,7 @@ static void silcpurple_running(SilcClien
G_CALLBACK(silcpurple_no_password_cb), gc);
return;
}
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR,
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR,
_("Unable to load SILC key pair"));
gc->proto_data = NULL;
silc_free(sg);
@@ -566,7 +566,7 @@ silcpurple_login(PurpleAccount *account)
/* Allocate SILC client */
client = silc_client_alloc(&ops, ¶ms, gc, NULL);
if (!client) {
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR,
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR,
_("Out of memory"));
return;
}
@@ -617,7 +617,7 @@ silcpurple_login(PurpleAccount *account)
/* Init SILC client */
if (!silc_client_init(client, username, hostname, realname,
silcpurple_running, sg)) {
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR,
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR,
_("Unable to initialize SILC protocol"));
gc->proto_data = NULL;
silc_free(sg);
@@ -630,7 +630,7 @@ silcpurple_login(PurpleAccount *account)
/* Check the ~/.silc dir and create it, and new key pair if necessary. */
if (!silcpurple_check_silc_dir(gc)) {
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR,
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR,
_("Error loading SILC key pair"));
gc->proto_data = NULL;
silc_free(sg);
============================================================
--- libpurple/protocols/silc/util.c 2ae622a1858070722f4052b0755ce0a115d06b53
+++ libpurple/protocols/silc/util.c 4462ecbaa7259da78c059e9633985232fd41fec1
@@ -213,7 +213,7 @@ gboolean silcpurple_check_silc_dir(Purpl
(gc->password == NULL)
? "" : gc->password,
NULL, NULL, FALSE)) {
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR,
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR,
_("Unable to create SILC key pair"));
return FALSE;
}
@@ -256,7 +256,7 @@ gboolean silcpurple_check_silc_dir(Purpl
(gc->password == NULL)
? "" : gc->password,
NULL, NULL, FALSE)) {
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR,
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR,
_("Unable to create SILC key pair"));
return FALSE;
}
============================================================
--- ChangeLog.API 2dc218d72e860321c597e5afef0602f25de4497e
+++ ChangeLog.API 542f487ea59cbb742901120c122e9e5ff91d5192
@@ -13,6 +13,8 @@ version 3.0.0 (??/??/????):
the first parameter
* PurpleConnectionUiOps.report_disconnect now passes a
PurpleConnectionError as the second parameter
+ * purple_connection_error now takes a PurpleConnectionError
+ as the second parameter
Removed:
* GtkIMHtml.clipboard_html_string
@@ -24,7 +26,7 @@ version 3.0.0 (??/??/????):
* pidgin_set_custom_buddy_icon
* pidgin_setup_screenname_autocomplete
* PidginConversation.sg
- * purple_connection_error
+ * purple_connection_error_reason
* purple_core_migrate
* purple_notify_searchresults_column_get_title
* purple_notify_searchresults_get_columns_count
============================================================
--- libpurple/protocols/yahoo/ycht.c 7164ce55fa88ac59c33a5f4229163014cfafe412
+++ libpurple/protocols/yahoo/ycht.c e592a3fe8e9efab5c47868008397a15eb021f889
@@ -285,7 +285,7 @@ static void ycht_packet_send_write_cb(gp
/*
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(purple_account_get_connection(irc->account),
PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
g_free(tmp);
*/
============================================================
--- libpurple/protocols/yahoo/yahoo_packet.c 28dbeb27d2900b9e6801791e9c666c5df9fdda8f
+++ libpurple/protocols/yahoo/yahoo_packet.c 72a6d9964d5be6d347da384888324c8eeecbcaa4
@@ -302,7 +302,7 @@ yahoo_packet_send_can_write(gpointer dat
return;
else if (ret < 0) {
/* TODO: what to do here - do we really have to disconnect? */
- purple_connection_error_reason(yd->gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
+ purple_connection_error(yd->gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Write Error"));
return;
}
============================================================
--- libpurple/protocols/sametime/sametime.c c45c7abf4f92ff58a7ebb2abb80d755cf4f4edbf
+++ libpurple/protocols/sametime/sametime.c abd8a01eff4d1dedc9dff9cb2b018d9c9d8d6c8e
@@ -413,7 +413,7 @@ static int mw_session_io_write(struct mw
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(pd->gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
tmp);
g_free(tmp);
@@ -1613,7 +1613,7 @@ static void mw_session_stateChange(struc
default:
reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR;
}
- purple_connection_error_reason(gc, reason, err);
+ purple_connection_error(gc, reason, err);
g_free(err);
}
break;
@@ -1762,7 +1762,7 @@ static void read_cb(gpointer data, gint
if(! ret) {
DEBUG_INFO("connection reset\n");
- purple_connection_error_reason(pd->gc,
+ purple_connection_error(pd->gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Server closed the connection"));
@@ -1773,7 +1773,7 @@ static void read_cb(gpointer data, gint
DEBUG_INFO("error in read callback: %s\n", err_str);
msg = g_strdup_printf(_("Lost connection with server: %s"), err_str);
- purple_connection_error_reason(pd->gc,
+ purple_connection_error(pd->gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
msg);
g_free(msg);
@@ -1799,7 +1799,7 @@ static void connect_cb(gpointer data, gi
/* this is a regular connect, error out */
gchar *tmp = g_strdup_printf(_("Unable to connect: %s"),
error_message);
- purple_connection_error_reason(pd->gc,
+ purple_connection_error(pd->gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
tmp);
g_free(tmp);
@@ -3691,7 +3691,7 @@ static void prompt_host_cancel_cb(Purple
static void prompt_host_cancel_cb(PurpleConnection *gc) {
const char *msg = _("No Sametime Community Server specified");
- purple_connection_error_reason(gc,
+ purple_connection_error(gc,
PURPLE_CONNECTION_ERROR_INVALID_SETTINGS,
msg);
}
@@ -3806,7 +3806,7 @@ static void mw_prpl_login(PurpleAccount
purple_connection_update_progress(gc, _("Connecting"), 1, MW_CONNECT_STEPS);
if (purple_proxy_connect(gc, account, host, port, connect_cb, pd) == NULL) {
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Unable to connect"));
}
}
============================================================
--- libpurple/protocols/simple/simple.c 01a4f7c178ea61e4b48b5665e7870b2aaf9f48f1
+++ libpurple/protocols/simple/simple.c 2f073d2b31def0b301a975251323f25bde18be00
@@ -432,7 +432,7 @@ static void simple_canwrite_cb(gpointer
/*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(gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
g_free(tmp);
return;
@@ -451,7 +451,7 @@ static void send_later_cb(gpointer data,
if(source < 0) {
gchar *tmp = g_strdup_printf(_("Unable to connect: %s"),
error_message);
- purple_connection_error_reason(gc,
+ purple_connection_error(gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
g_free(tmp);
return;
@@ -479,7 +479,7 @@ static void sendlater(PurpleConnection *
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, _("Unable to connect"));
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Unable to connect"));
}
sip->connecting = TRUE;
}
@@ -1122,7 +1122,7 @@ gboolean process_register_response(struc
if(sip->registrar.retries > SIMPLE_REGISTER_RETRY_MAX) {
if (!purple_account_get_remember_password(sip->gc->account))
purple_account_set_password(sip->gc->account, NULL);
- purple_connection_error_reason(sip->gc,
+ purple_connection_error(sip->gc,
PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED,
_("Incorrect password"));
return TRUE;
@@ -1137,7 +1137,7 @@ gboolean process_register_response(struc
if (sip->registerstatus != SIMPLE_REGISTER_RETRY) {
purple_debug_info("simple", "Unrecognized return code for REGISTER.\n");
if (sip->registrar.retries > SIMPLE_REGISTER_RETRY_MAX) {
- purple_connection_error_reason(sip->gc,
+ purple_connection_error(sip->gc,
PURPLE_CONNECTION_ERROR_OTHER_ERROR,
_("Unknown server response"));
return TRUE;
@@ -1739,7 +1739,7 @@ static void login_cb(gpointer data, gint
if(source < 0) {
gchar *tmp = g_strdup_printf(_("Unable to connect: %s"),
error_message);
- purple_connection_error_reason(gc,
+ purple_connection_error(gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
g_free(tmp);
return;
@@ -1775,7 +1775,7 @@ static void simple_udp_host_resolved_lis
sip->listen_data = NULL;
if(listenfd == -1) {
- purple_connection_error_reason(sip->gc,
+ purple_connection_error(sip->gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Unable to create listen socket"));
return;
@@ -1804,7 +1804,7 @@ static void simple_udp_host_resolved(GSL
sip->query_data = NULL;
if (!hosts || !hosts->data) {
- purple_connection_error_reason(sip->gc,
+ purple_connection_error(sip->gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Unable to resolve hostname"));
return;
@@ -1825,7 +1825,7 @@ static void simple_udp_host_resolved(GSL
sip->listen_data = purple_network_listen_range(5060, 5160, SOCK_DGRAM,
simple_udp_host_resolved_listen_cb, sip);
if (sip->listen_data == NULL) {
- purple_connection_error_reason(sip->gc,
+ purple_connection_error(sip->gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Unable to create listen socket"));
return;
@@ -1840,7 +1840,7 @@ simple_tcp_connect_listen_cb(int listenf
sip->listenfd = listenfd;
if(sip->listenfd == -1) {
- purple_connection_error_reason(sip->gc,
+ purple_connection_error(sip->gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Unable to create listen socket"));
return;
@@ -1855,7 +1855,7 @@ simple_tcp_connect_listen_cb(int listenf
/* open tcp connection to the server */
if (purple_proxy_connect(sip->gc, sip->account, sip->realhostname,
sip->realport, login_cb, sip->gc) == NULL) {
- purple_connection_error_reason(sip->gc,
+ purple_connection_error(sip->gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Unable to connect"));
}
@@ -1895,7 +1895,7 @@ static void srvresolved(PurpleSrvRespons
sip->listen_data = purple_network_listen_range(5060, 5160, SOCK_STREAM,
simple_tcp_connect_listen_cb, sip);
if (sip->listen_data == NULL) {
- purple_connection_error_reason(sip->gc,
+ purple_connection_error(sip->gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Unable to create listen socket"));
return;
@@ -1906,7 +1906,7 @@ static void srvresolved(PurpleSrvRespons
sip->query_data = purple_dnsquery_a_account(sip->account, hostname,
port, simple_udp_host_resolved, sip);
if (sip->query_data == NULL) {
- purple_connection_error_reason(sip->gc,
+ purple_connection_error(sip->gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Unable to resolve hostname"));
}
@@ -1924,7 +1924,7 @@ static void simple_login(PurpleAccount *
gc = purple_account_get_connection(account);
if (strpbrk(username, " \t\v\r\n") != NULL) {
- purple_connection_error_reason(gc,
+ purple_connection_error(gc,
PURPLE_CONNECTION_ERROR_INVALID_SETTINGS,
_("SIP usernames may not contain whitespaces or @ symbols"));
return;
@@ -1943,7 +1943,7 @@ static void simple_login(PurpleAccount *
userserver = g_strsplit(username, "@", 2);
if (userserver[1] == NULL || userserver[1][0] == '\0') {
- purple_connection_error_reason(gc,
+ purple_connection_error(gc,
PURPLE_CONNECTION_ERROR_INVALID_SETTINGS,
_("SIP connect server not specified"));
return;
============================================================
--- libpurple/protocols/bonjour/bonjour.c 36c6d536994d7b5cbb85fb2a6a08f57586b140e0
+++ libpurple/protocols/bonjour/bonjour.c 866646a997078df617aefb7e8d034549fdb6a34e
@@ -94,7 +94,7 @@ bonjour_login(PurpleAccount *account)
#ifdef _WIN32
if (!dns_sd_available()) {
- purple_connection_error_reason(gc,
+ purple_connection_error(gc,
PURPLE_CONNECTION_ERROR_OTHER_ERROR,
_("Unable to find Apple's \"Bonjour for Windows\" toolkit, see "
"http://d.pidgin.im/BonjourWindows for more information."));
@@ -114,7 +114,7 @@ bonjour_login(PurpleAccount *account)
if (bonjour_jabber_start(bd->jabber_data) == -1) {
/* Send a message about the connection error */
- purple_connection_error_reason (gc,
+ purple_connection_error (gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Unable to listen for incoming IM connections"));
return;
@@ -141,7 +141,7 @@ bonjour_login(PurpleAccount *account)
bd->dns_sd_data->account = account;
if (!bonjour_dns_sd_start(bd->dns_sd_data))
{
- purple_connection_error_reason (gc,
+ purple_connection_error (gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Unable to establish connection with the local mDNS server. Is it running?"));
return;
============================================================
--- libpurple/protocols/oscar/flap_connection.c 417c9927a73baf39e1fe786bdcfd863b64aaad61
+++ libpurple/protocols/oscar/flap_connection.c faceb88102b041b253e299c46dd31331da868003
@@ -487,7 +487,7 @@ flap_connection_destroy_cb(gpointer data
if (tmp != NULL)
{
- purple_connection_error_reason(od->gc, reason, tmp);
+ purple_connection_error(od->gc, reason, tmp);
g_free(tmp);
}
}
============================================================
--- libpurple/protocols/myspace/myspace.c a0f5f587c444aa3bf24e8ef599318e94795011eb
+++ libpurple/protocols/myspace/myspace.c 221d71caa590465e2d792c9bbd09d8ccfcea99c8
@@ -698,7 +698,7 @@ msim_login_challenge(MsimSession *sessio
if (nc_len != MSIM_AUTH_CHALLENGE_LENGTH) {
purple_debug_info("msim", "bad nc length: %" G_GSIZE_MODIFIER
"x != 0x%x\n", nc_len, MSIM_AUTH_CHALLENGE_LENGTH);
- purple_connection_error_reason (session->gc,
+ purple_connection_error (session->gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Unexpected challenge length from server"));
return FALSE;
@@ -835,7 +835,7 @@ msim_check_alive(gpointer data)
purple_debug_info("msim",
"msim_check_alive: %zu > interval of %d, presumed dead\n",
delta, MSIM_KEEPALIVE_INTERVAL);
- purple_connection_error_reason(session->gc,
+ purple_connection_error(session->gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Lost connection with server"));
@@ -1866,7 +1866,7 @@ msim_error(MsimSession *session, MsimMes
purple_account_set_password(session->account, NULL);
break;
}
- purple_connection_error_reason(session->gc, reason, full_errmsg);
+ purple_connection_error(session->gc, reason, full_errmsg);
} else {
purple_notify_error(session->account, _("MySpaceIM Error"), full_errmsg, NULL);
}
@@ -2027,7 +2027,7 @@ msim_input_cb(gpointer gc_uncasted, gint
/* libpurple/eventloop.h only defines these two */
if (cond != PURPLE_INPUT_READ && cond != PURPLE_INPUT_WRITE) {
purple_debug_info("msim_input_cb", "unknown condition=%d\n", cond);
- purple_connection_error_reason (gc,
+ purple_connection_error (gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Invalid input condition"));
return;
@@ -2069,12 +2069,12 @@ msim_input_cb(gpointer gc_uncasted, gint
tmp = g_strdup_printf(_("Lost connection with server: %s"),
g_strerror(errno));
- purple_connection_error_reason(gc,
+ purple_connection_error(gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
g_free(tmp);
return;
} else if (n == 0) {
- purple_connection_error_reason(gc,
+ purple_connection_error(gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Server closed the connection"));
return;
@@ -2092,7 +2092,7 @@ msim_input_cb(gpointer gc_uncasted, gint
purple_debug_info("msim", "msim_input_cb: strlen=%d, but read %d bytes"
"--null byte encountered?\n",
strlen(session->rxbuf + session->rxoff), n);
- /*purple_connection_error_reason (gc,
+ /*purple_connection_error (gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
"Invalid message - null byte on input"); */
return;
@@ -2117,7 +2117,7 @@ msim_input_cb(gpointer gc_uncasted, gint
msg = msim_parse(session->rxbuf);
if (!msg) {
purple_debug_info("msim", "msim_input_cb: couldn't parse rxbuf\n");
- purple_connection_error_reason (gc,
+ purple_connection_error (gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Unable to parse message"));
break;
@@ -2162,7 +2162,7 @@ msim_connect_cb(gpointer data, gint sour
if (source < 0) {
gchar *tmp = g_strdup_printf(_("Unable to connect: %s"),
error_message);
- purple_connection_error_reason (gc,
+ purple_connection_error (gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
g_free(tmp);
return;
@@ -2219,7 +2219,7 @@ msim_login(PurpleAccount *acct)
if (!purple_proxy_connect(gc, acct, host, port, msim_connect_cb, gc)) {
/* TODO: try other ports if in auto mode, then save
* working port and try that first next time. */
- purple_connection_error_reason (gc,
+ purple_connection_error (gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Unable to connect"));
return;
============================================================
--- libpurple/protocols/bonjour/mdns_win32.c ee0c98057f6a0f9ae49cfe70bdc0e4e06e350d8d
+++ libpurple/protocols/bonjour/mdns_win32.c 7d80de474b3ebee47a339ff2f77eda76cb8a3f39
@@ -105,7 +105,7 @@ _mdns_handle_event(gpointer data, gint s
purple_debug_error("bonjour", "Error (%d) handling mDNS response.\n", errorCode);
/* This happens when the mDNSResponder goes down, I haven't seen it happen any other time (in my limited testing) */
if (errorCode == kDNSServiceErr_Unknown) {
- purple_connection_error_reason(srh->account->gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
+ purple_connection_error(srh->account->gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Error communicating with local mDNSResponder."));
}
}
============================================================
--- libpurple/protocols/silc10/ops.c 4c5f7785eaaa7987406a82f04f20134d4c584d00
+++ libpurple/protocols/silc10/ops.c 82ea63c073d9c3c565410665b9a083b87667c514
@@ -1697,31 +1697,31 @@ silc_connected(SilcClient client, SilcCl
return;
break;
case SILC_CLIENT_CONN_ERROR:
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Error during connecting to SILC Server"));
g_unlink(silcpurple_session_file(purple_account_get_username(sg->account)));
break;
case SILC_CLIENT_CONN_ERROR_KE:
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR,
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR,
_("Key Exchange failed"));
break;
case SILC_CLIENT_CONN_ERROR_AUTH:
- purple_connection_error_reason(gc,
+ purple_connection_error(gc,
PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED,
_("Authentication failed"));
break;
case SILC_CLIENT_CONN_ERROR_RESUME:
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR,
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR,
_("Resuming detached session failed. "
"Press Reconnect to create new connection."));
g_unlink(silcpurple_session_file(purple_account_get_username(sg->account)));
break;
case SILC_CLIENT_CONN_ERROR_TIMEOUT:
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Connection timed out"));
break;
}
@@ -1751,7 +1751,7 @@ silc_disconnected(SilcClient client, Sil
/* Close the connection */
if (!sg->detaching)
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Disconnected by server"));
else
/* TODO: Does this work correctly? Maybe we need to set wants_to_die? */
============================================================
--- libpurple/protocols/silc10/silc.c 290a6f1e94d20c0de993a6bbcf0da365956dc702
+++ libpurple/protocols/silc10/silc.c b2177d246a0a86caddb0efae076a22ffc62cbe0a
@@ -159,7 +159,7 @@ silcpurple_login_connected(gpointer data
sg = gc->proto_data;
if (source < 0) {
- purple_connection_error_reason(gc,
+ purple_connection_error(gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Connection failed"));
return;
@@ -182,7 +182,7 @@ silcpurple_login_connected(gpointer data
"silc.silcnet.org"),
purple_account_get_int(account, "port", 706), sg);
if (!conn) {
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Unable to initialize SILC Client connection"));
gc->proto_data = NULL;
return;
@@ -268,7 +268,7 @@ silcpurple_login(PurpleAccount *account)
/* Allocate SILC client */
client = silc_client_alloc(&ops, ¶ms, gc, NULL);
if (!client) {
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR,
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR,
_("Out of memory"));
return;
}
@@ -314,14 +314,14 @@ silcpurple_login(PurpleAccount *account)
/* Init SILC client */
if (!silc_client_init(client)) {
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR,
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR,
_("Unable to initialize SILC protocol"));
return;
}
/* Check the ~/.silc dir and create it, and new key pair if necessary. */
if (!silcpurple_check_silc_dir(gc)) {
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR,
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR,
_("Error loading SILC key pair"));
return;
}
@@ -337,7 +337,7 @@ silcpurple_login(PurpleAccount *account)
(gc->password == NULL) ? "" : gc->password, &client->pkcs,
&client->public_key, &client->private_key)) {
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,
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR,
pkd);
return;
}
@@ -358,7 +358,7 @@ silcpurple_login(PurpleAccount *account)
purple_account_get_int(account, "port", 706),
silcpurple_login_connected, gc) == NULL)
{
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Unable to create connection"));
return;
}
============================================================
--- libpurple/protocols/myspace/user.c b59cb830479ac0022aaf6d1c91b91f55f8d1075d
+++ libpurple/protocols/myspace/user.c 65cb6dc5bd9448880b75bb41b648e0d71d78e718
@@ -636,7 +636,7 @@ static void msim_username_is_set_cb(Msim
if (!body) {
purple_debug_info("msim_username_is_set_cb", "No body");
/* Error: No body! */
- purple_connection_error_reason(session->gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, errmsg);
+ purple_connection_error(session->gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, errmsg);
}
username = msim_msg_get_string(body, "UserName");
code = msim_msg_get_integer(body,"Code");
@@ -678,13 +678,13 @@ static void msim_username_is_set_cb(Msim
NULL)) {
/* Error! */
/* Can't set... Disconnect */
- purple_connection_error_reason(session->gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, errmsg);
+ purple_connection_error(session->gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, errmsg);
}
} else {
/* Error! */
purple_debug_info("msim","username_is_set Error: Invalid cmd/dsn/lid combination");
- purple_connection_error_reason(session->gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, errmsg);
+ purple_connection_error(session->gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, errmsg);
}
}
@@ -782,7 +782,7 @@ static void msim_username_is_available_c
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,
+ purple_connection_error(session->gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR,
_("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."));
@@ -867,7 +867,7 @@ void msim_do_not_set_username_cb(PurpleC
purple_debug_info("msim", "Don't set username");
/* Protocol won't log in now without a username set.. Disconnect */
- purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, _("No username set"));
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, _("No username set"));
}
/**
============================================================
--- libpurple/protocols/jabber/bosh.c 6fa708783871a0e610674fca66dab5210b099bec
+++ libpurple/protocols/jabber/bosh.c 090f99599f681c24d18ac9ad105da64a083d7875
@@ -436,7 +436,7 @@ static gboolean jabber_bosh_connection_e
if (type != NULL && !strcmp(type, "terminate")) {
conn->state = BOSH_CONN_OFFLINE;
- purple_connection_error_reason(conn->js->gc,
+ purple_connection_error(conn->js->gc,
PURPLE_CONNECTION_ERROR_OTHER_ERROR,
_("The BOSH connection manager terminated your session."));
return TRUE;
@@ -539,7 +539,7 @@ static void boot_response_cb(PurpleBOSHC
if (sid) {
conn->sid = g_strdup(sid);
} else {
- purple_connection_error_reason(js->gc,
+ purple_connection_error(js->gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("No session ID given"));
return;
@@ -556,7 +556,7 @@ static void boot_response_cb(PurpleBOSHC
minor = atoi(dot + 1);
if (major != 1 || minor < 6) {
- purple_connection_error_reason(js->gc,
+ purple_connection_error(js->gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Unsupported version of BOSH protocol"));
return;
@@ -733,7 +733,7 @@ static void http_connection_disconnected
return;
if (++conn->bosh->failed_connections == MAX_FAILED_CONNECTIONS) {
- purple_connection_error_reason(conn->bosh->js->gc,
+ purple_connection_error(conn->bosh->js->gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Unable to establish a connection with the server"));
} else {
@@ -939,7 +939,7 @@ connection_established_cb(gpointer data,
gchar *tmp;
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);
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
g_free(tmp);
return;
}
@@ -965,18 +965,18 @@ static void http_connection_connect(Purp
ssl_connection_error_cb,
conn);
if (!conn->psc) {
- 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"));
}
} else if (purple_proxy_connect(conn, account, bosh->host, bosh->port,
connection_established_cb, conn) == NULL) {
- purple_connection_error_reason(gc,
+ purple_connection_error(gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Unable to connect"));
}
@@ -1023,7 +1023,7 @@ http_connection_send_cb(gpointer data, g
*/
gchar *tmp = g_strdup_printf(_("Lost connection with server: %s"),
g_strerror(errno));
- purple_connection_error_reason(conn->bosh->js->gc,
+ purple_connection_error(conn->bosh->js->gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
tmp);
g_free(tmp);
@@ -1079,7 +1079,7 @@ http_connection_send_request(PurpleHTTPC
*/
gchar *tmp = g_strdup_printf(_("Lost connection with server: %s"),
g_strerror(errno));
- purple_connection_error_reason(conn->bosh->js->gc,
+ purple_connection_error(conn->bosh->js->gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
tmp);
g_free(tmp);
============================================================
--- libpurple/protocols/oscar/clientlogin.c 5119961dfae740a8b7fd89c34988f9c583e8c759
+++ libpurple/protocols/oscar/clientlogin.c 5cabbddca7acb2acf40e5d11b4d1a5858489c414
@@ -182,7 +182,7 @@ static gboolean parse_start_oscar_sessio
/* Note to translators: %s in this string is a URL */
msg = generate_error_message(response_node,
get_start_oscar_session_url(od));
- purple_connection_error_reason(gc,
+ purple_connection_error(gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR, msg);
g_free(msg);
return FALSE;
@@ -204,7 +204,7 @@ static gboolean parse_start_oscar_sessio
"missing statusCode: %s\n", response);
msg = generate_error_message(response_node,
get_start_oscar_session_url(od));
- purple_connection_error_reason(gc,
+ purple_connection_error(gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR, msg);
g_free(msg);
xmlnode_free(response_node);
@@ -232,7 +232,7 @@ static gboolean parse_start_oscar_sessio
"was %s: %s\n", tmp, response);
if ((code == 401 && status_detail != 1014) || code == 607)
- purple_connection_error_reason(gc,
+ purple_connection_error(gc,
PURPLE_CONNECTION_ERROR_OTHER_ERROR,
_("You have been connecting and disconnecting too "
"frequently. Wait ten minutes and try again. If "
@@ -242,7 +242,7 @@ static gboolean parse_start_oscar_sessio
char *msg;
msg = generate_error_message(response_node,
get_start_oscar_session_url(od));
- purple_connection_error_reason(gc,
+ purple_connection_error(gc,
PURPLE_CONNECTION_ERROR_OTHER_ERROR, msg);
g_free(msg);
}
@@ -261,7 +261,7 @@ static gboolean parse_start_oscar_sessio
"something: %s\n", response);
msg = generate_error_message(response_node,
get_start_oscar_session_url(od));
- purple_connection_error_reason(gc,
+ purple_connection_error(gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR, msg);
g_free(msg);
xmlnode_free(response_node);
@@ -277,7 +277,7 @@ static gboolean parse_start_oscar_sessio
purple_debug_warning("oscar", "We haven't received a tlsCertName to use. We will not do SSL to BOS.\n");
} else {
purple_debug_error("oscar", "startOSCARSession was missing tlsCertName: %s\n", response);
- purple_connection_error_reason(
+ purple_connection_error(
gc,
PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT,
_("You required encryption in your account settings, but one of the servers doesn't support it."));
@@ -299,7 +299,7 @@ static gboolean parse_start_oscar_sessio
"something: %s\n", response);
msg = generate_error_message(response_node,
get_start_oscar_session_url(od));
- purple_connection_error_reason(gc,
+ purple_connection_error(gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR, msg);
g_free(msg);
g_free(*host);
@@ -337,7 +337,7 @@ static void start_oscar_session_cb(Purpl
tmp = g_strdup_printf(_("Error requesting %s: %s"),
get_start_oscar_session_url(od), error_message ?
error_message : _("The server returned an empty response"));
- purple_connection_error_reason(gc,
+ purple_connection_error(gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
g_free(tmp);
return;
@@ -395,7 +395,7 @@ static void send_start_oscar_session(Osc
* and extracts the useful information.
*
* @param gc The PurpleConnection. If the response data does
- * not indicate then purple_connection_error_reason()
+ * not indicate then purple_connection_error()
* will be called to close this connection.
* @param response The response data from the clientLogin request.
* @param response_len The length of the above response, or -1 if
@@ -431,7 +431,7 @@ static gboolean parse_client_login_respo
"response as XML: %s\n", response);
msg = generate_error_message(response_node,
get_client_login_url(od));
- purple_connection_error_reason(gc,
+ purple_connection_error(gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR, msg);
g_free(msg);
return FALSE;
@@ -455,7 +455,7 @@ static gboolean parse_client_login_respo
"missing statusCode: %s\n", response);
msg = generate_error_message(response_node,
get_client_login_url(od));
- purple_connection_error_reason(gc,
+ purple_connection_error(gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR, msg);
g_free(msg);
xmlnode_free(response_node);
@@ -482,23 +482,23 @@ static gboolean parse_client_login_respo
PurpleAccount *account = purple_connection_get_account(gc);
if (!purple_account_get_remember_password(account))
purple_account_set_password(account, NULL);
- purple_connection_error_reason(gc,
+ purple_connection_error(gc,
PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED,
_("Incorrect password"));
} else if (status_code == 330 && status_detail_code == 3015) {
- purple_connection_error_reason(gc,
+ purple_connection_error(gc,
PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED,
_("Server requested that you fill out a CAPTCHA in order to "
"sign in, but this client does not currently support CAPTCHAs."));
} else if (status_code == 401 && status_detail_code == 3019) {
- purple_connection_error_reason(gc,
+ purple_connection_error(gc,
PURPLE_CONNECTION_ERROR_OTHER_ERROR,
_("AOL does not allow your screen name to authenticate here"));
} else {
char *msg;
msg = generate_error_message(response_node,
get_client_login_url(od));
- purple_connection_error_reason(gc,
+ purple_connection_error(gc,
PURPLE_CONNECTION_ERROR_OTHER_ERROR, msg);
g_free(msg);
}
@@ -517,7 +517,7 @@ static gboolean parse_client_login_respo
"something: %s\n", response);
msg = generate_error_message(response_node,
get_client_login_url(od));
- purple_connection_error_reason(gc,
+ purple_connection_error(gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR, msg);
g_free(msg);
xmlnode_free(response_node);
@@ -535,7 +535,7 @@ static gboolean parse_client_login_respo
"something: %s\n", response);
msg = generate_error_message(response_node,
get_client_login_url(od));
- purple_connection_error_reason(gc,
+ purple_connection_error(gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR, msg);
g_free(msg);
g_free(*token);
@@ -572,7 +572,7 @@ static void client_login_cb(PurpleUtilFe
tmp = g_strdup_printf(_("Error requesting %s: %s"),
get_client_login_url(od), error_message ?
error_message : _("The server returned an empty response"));
- purple_connection_error_reason(gc,
+ purple_connection_error(gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
g_free(tmp);
return;
============================================================
--- libpurple/protocols/jabber/auth_cyrus.c 57d143f0a0995911a79a1349ef220b987cbfaef3
+++ libpurple/protocols/jabber/auth_cyrus.c 78c174f96adac3eca018bfa035a07752d4ebdb90
@@ -34,7 +34,7 @@ static void disallow_plaintext_auth(Purp
static void disallow_plaintext_auth(PurpleAccount *account)
{
- purple_connection_error_reason(purple_account_get_connection(account),
+ purple_connection_error(purple_account_get_connection(account),
PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR,
_("Server may require plaintext authentication over an unencrypted stream"));
}
@@ -46,7 +46,7 @@ static void start_cyrus_wrapper(JabberSt
JabberSaslState state = jabber_auth_start_cyrus(js, &response, &error);
if (state == JABBER_SASL_STATE_FAIL) {
- purple_connection_error_reason(js->gc,
+ purple_connection_error(js->gc,
PURPLE_CONNECTION_ERROR_AUTHENTICATION_IMPOSSIBLE,
error);
g_free(error);
============================================================
--- libpurple/protocols/jabber/auth_plain.c 65a514154d52ad5ff95bd2d8055bef78902ae042
+++ libpurple/protocols/jabber/auth_plain.c 70dd5952fccef022551cd459940362388ad3c144
@@ -75,7 +75,7 @@ static void disallow_plaintext_auth(Purp
static void disallow_plaintext_auth(PurpleAccount *account)
{
- purple_connection_error_reason(purple_account_get_connection(account),
+ purple_connection_error(purple_account_get_connection(account),
PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR,
_("Server requires plaintext authentication over an unencrypted stream"));
}
============================================================
--- libpurple/protocols/mxit/http.c 9e169cadb80750e392ae7fb62e31861e012e7f39
+++ libpurple/protocols/mxit/http.c 317396d300b8ebd4211260d5526421be87fe7061
@@ -273,7 +273,7 @@ static void mxit_cb_http_connect( gpoint
/* source is the file descriptor of the new connection */
if ( source < 0 ) {
purple_debug_info( MXIT_PLUGIN_ID, "mxit_cb_http_connect failed: %s\n", error_message );
- purple_connection_error_reason( req->session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "Unable to connect to the MXit HTTP server. Please check your server settings." ) );
+ purple_connection_error( req->session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "Unable to connect to the MXit HTTP server. Please check your server settings." ) );
return;
}
============================================================
--- libpurple/protocols/mxit/login.c d94b4a58d73bbdf41622cb2a4993343e78501b90
+++ libpurple/protocols/mxit/login.c 5e374d2d40456c3b11cf8d9eb6ec2a3da31f53be
@@ -165,7 +165,7 @@ static void mxit_cb_connect( gpointer us
/* source is the file descriptor of the new connection */
if ( source < 0 ) {
purple_debug_info( MXIT_PLUGIN_ID, "mxit_cb_connect failed: %s\n", error_message );
- purple_connection_error_reason( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "Unable to connect to the MXit server. Please check your server settings." ) );
+ purple_connection_error( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "Unable to connect to the MXit server. Please check your server settings." ) );
return;
}
@@ -202,7 +202,7 @@ static void mxit_login_connect( struct M
/* socket connection */
data = purple_proxy_connect( session->con, session->acc, session->server, session->port, mxit_cb_connect, session );
if ( !data ) {
- purple_connection_error_reason( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "Unable to connect to the MXit server. Please check your server settings." ) );
+ purple_connection_error( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "Unable to connect to the MXit server. Please check your server settings." ) );
return;
}
}
@@ -391,7 +391,7 @@ static void mxit_cb_clientinfo2( PurpleU
if ( !url_text ) {
/* no reply from the WAP site */
- purple_connection_error_reason( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "Error contacting the MXit WAP site. Please try again later." ) );
+ purple_connection_error( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "Error contacting the MXit WAP site. Please try again later." ) );
return;
}
@@ -400,7 +400,7 @@ static void mxit_cb_clientinfo2( PurpleU
if ( !parts ) {
/* wapserver error */
- purple_connection_error_reason( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "MXit is currently unable to process the request. Please try again later." ) );
+ purple_connection_error( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "MXit is currently unable to process the request. Please try again later." ) );
return;
}
@@ -410,26 +410,26 @@ static void mxit_cb_clientinfo2( PurpleU
/* valid reply! */
break;
case '1' :
- purple_connection_error_reason( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "Wrong security code entered. Please try again later." ) );
+ purple_connection_error( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "Wrong security code entered. Please try again later." ) );
return;
case '2' :
- purple_connection_error_reason( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "Your session has expired. Please try again later." ) );
+ purple_connection_error( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "Your session has expired. Please try again later." ) );
return;
case '5' :
- purple_connection_error_reason( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "Invalid country selected. Please try again." ) );
+ purple_connection_error( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "Invalid country selected. Please try again." ) );
return;
case '6' :
- purple_connection_error_reason( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "The MXit ID you entered is not registered. Please register first." ) );
+ purple_connection_error( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "The MXit ID you entered is not registered. Please register first." ) );
return;
case '7' :
- purple_connection_error_reason( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "The MXit ID you entered is already registered. Please choose another." ) );
+ purple_connection_error( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "The MXit ID you entered is already registered. Please choose another." ) );
/* this user's account already exists, so we need to change the registration login flag to be login */
purple_account_set_int( session->acc, MXIT_CONFIG_STATE, MXIT_STATE_LOGIN );
return;
case '3' :
case '4' :
default :
- purple_connection_error_reason( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "Internal error. Please try again later." ) );
+ purple_connection_error( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "Internal error. Please try again later." ) );
return;
}
@@ -611,7 +611,7 @@ static void mxit_cb_clientinfo1( PurpleU
if ( !url_text ) {
/* no reply from the WAP site */
- purple_connection_error_reason( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "Error contacting the MXit WAP site. Please try again later." ) );
+ purple_connection_error( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "Error contacting the MXit WAP site. Please try again later." ) );
return;
}
@@ -620,7 +620,7 @@ static void mxit_cb_clientinfo1( PurpleU
if ( ( !parts ) || ( parts[0][0] != '0' ) ) {
/* server could not find the user */
- purple_connection_error_reason( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "MXit is currently unable to process the request. Please try again later." ) );
+ purple_connection_error( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "MXit is currently unable to process the request. Please try again later." ) );
return;
}
============================================================
--- libpurple/protocols/mxit/protocol.c b41d4d6188420e4d19d566203030eb0634afeda9
+++ libpurple/protocols/mxit/protocol.c f5f90862513d570a58d7a60d424dd4b5929ba52a
@@ -408,7 +408,7 @@ static void mxit_send_packet( struct MXi
res = mxit_write_sock_packet( session->fd, data, datalen );
if ( res < 0 ) {
/* we must have lost the connection, so terminate it so that we can reconnect */
- purple_connection_error_reason( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "We have lost the connection to MXit. Please reconnect." ) );
+ purple_connection_error( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "We have lost the connection to MXit. Please reconnect." ) );
}
}
else {
@@ -530,7 +530,7 @@ static void mxit_manage_queue( struct MX
if ( session->last_tx <= mxit_now_milli() - ( MXIT_ACK_TIMEOUT * 1000 ) ) {
/* ack timeout! so we close the connection here */
purple_debug_info( MXIT_PLUGIN_ID, "mxit_manage_queue: Timeout awaiting ACK for command '%i'\n", session->outack );
- purple_connection_error_reason( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "Timeout while waiting for a response from the MXit server." ) );
+ purple_connection_error( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "Timeout while waiting for a response from the MXit server." ) );
}
return;
}
@@ -2192,7 +2192,7 @@ static void mxit_perform_redirect( struc
session->port = atoi( host[2] );
}
else {
- purple_connection_error_reason( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "Cannot perform redirect using the specified protocol" ) );
+ purple_connection_error( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "Cannot perform redirect using the specified protocol" ) );
goto redirect_fail;
}
@@ -2361,7 +2361,7 @@ static int process_error_response( struc
if ( packet->errcode == MXIT_ERRCODE_LOGGEDOUT ) {
/* we are not currently logged in, so we need to reconnect */
- purple_connection_error_reason( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( errdesc ) );
+ purple_connection_error( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( errdesc ) );
}
/* packet command */
@@ -2375,12 +2375,12 @@ static int process_error_response( struc
}
else {
snprintf( errmsg, sizeof( errmsg ), _( "Login error: %s (%i)" ), errdesc, packet->errcode );
- purple_connection_error_reason( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, errmsg );
+ purple_connection_error( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, errmsg );
return -1;
}
case CP_CMD_LOGOUT :
snprintf( errmsg, sizeof( errmsg ), _( "Logout error: %s (%i)" ), errdesc, packet->errcode );
- purple_connection_error_reason( session->con, PURPLE_CONNECTION_ERROR_NAME_IN_USE, _( errmsg ) );
+ purple_connection_error( session->con, PURPLE_CONNECTION_ERROR_NAME_IN_USE, _( errmsg ) );
return -1;
case CP_CMD_CONTACT :
mxit_popup( PURPLE_NOTIFY_MSG_WARNING, _( "Contact Error" ), _( errdesc ) );
@@ -2643,7 +2643,7 @@ int mxit_parse_packet( struct MXitSessio
if ( packet.rcount < 2 ) {
/* bad packet */
- purple_connection_error_reason( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "Invalid packet received from MXit." ) );
+ purple_connection_error( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "Invalid packet received from MXit." ) );
free_rx_packet( &packet );
continue;
}
@@ -2708,12 +2708,12 @@ void mxit_cb_rx( gpointer user_data, gin
len = read( session->fd, &ch, 1 );
if ( len < 0 ) {
/* connection error */
- purple_connection_error_reason( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "A connection error occurred to MXit. (read stage 0x01)" ) );
+ purple_connection_error( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "A connection error occurred to MXit. (read stage 0x01)" ) );
return;
}
else if ( len == 0 ) {
/* connection closed */
- purple_connection_error_reason( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "A connection error occurred to MXit. (read stage 0x02)" ) );
+ purple_connection_error( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "A connection error occurred to MXit. (read stage 0x02)" ) );
return;
}
else {
@@ -2723,7 +2723,7 @@ void mxit_cb_rx( gpointer user_data, gin
session->rx_lbuf[session->rx_i] = '\0';
session->rx_res = atoi( &session->rx_lbuf[3] );
if ( session->rx_res > CP_MAX_PACKET ) {
- purple_connection_error_reason( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "A connection error occurred to MXit. (read stage 0x03)" ) );
+ purple_connection_error( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "A connection error occurred to MXit. (read stage 0x03)" ) );
}
session->rx_state = RX_STATE_DATA;
session->rx_i = 0;
@@ -2734,7 +2734,7 @@ void mxit_cb_rx( gpointer user_data, gin
session->rx_i++;
if ( session->rx_i >= sizeof( session->rx_lbuf ) ) {
/* malformed packet length record (too long) */
- purple_connection_error_reason( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "A connection error occurred to MXit. (read stage 0x04)" ) );
+ purple_connection_error( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "A connection error occurred to MXit. (read stage 0x04)" ) );
return;
}
}
@@ -2745,12 +2745,12 @@ void mxit_cb_rx( gpointer user_data, gin
len = read( session->fd, &session->rx_dbuf[session->rx_i], session->rx_res );
if ( len < 0 ) {
/* connection error */
- purple_connection_error_reason( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "A connection error occurred to MXit. (read stage 0x05)" ) );
+ purple_connection_error( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "A connection error occurred to MXit. (read stage 0x05)" ) );
return;
}
else if ( len == 0 ) {
/* connection closed */
- purple_connection_error_reason( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "A connection error occurred to MXit. (read stage 0x06)" ) );
+ purple_connection_error( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "A connection error occurred to MXit. (read stage 0x06)" ) );
return;
}
else {
More information about the Commits
mailing list