--- a/libpurple/protocols/silc/silc.c Tue Oct 02 19:17:34 2007 +0000
+++ b/libpurple/protocols/silc/silc.c Wed Oct 03 13:12:39 2007 +0000
@@ -214,34 +214,40 @@
/* Close the connection */
- purple_connection_error(gc, _("Disconnected by server"));
+ purple_connection_error_reason(gc, + PURPLE_REASON_NETWORK_ERROR, + _("Disconnected by server")); /* TODO: Does this work correctly? Maybe we need to set wants_to_die? */
purple_account_disconnect(purple_connection_get_account(gc));
case SILC_CLIENT_CONN_ERROR:
- purple_connection_error(gc, _("Error during connecting to SILC Server"));
+ purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR, + _("Error during connecting to SILC Server")); g_unlink(silcpurple_session_file(purple_account_get_username(sg->account)));
case SILC_CLIENT_CONN_ERROR_KE:
- purple_connection_error(gc, _("Key Exchange failed"));
+ purple_connection_error_reason(gc, PURPLE_REASON_ENCRYPTION_ERROR, + _("Key Exchange failed")); case SILC_CLIENT_CONN_ERROR_AUTH:
- purple_connection_error(gc, _("Authentication failed"));
+ purple_connection_error_reason(gc, PURPLE_REASON_AUTHENTICATION_FAILED, + _("Authentication failed")); case SILC_CLIENT_CONN_ERROR_RESUME:
- purple_connection_error(gc,
- _("Resuming detached session failed. "
- "Press Reconnect to create new connection."));
+ purple_connection_error_reason(gc, PURPLE_REASON_OTHER_ERROR, + _("Resuming detached session failed. " + "Press Reconnect to create new connection.")); g_unlink(silcpurple_session_file(purple_account_get_username(sg->account)));
case SILC_CLIENT_CONN_ERROR_TIMEOUT:
- purple_connection_error(gc, _("Connection Timeout"));
+ purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR, + _("Connection Timeout")); @@ -262,7 +268,8 @@
if (status != SILC_SOCKET_OK) {
- purple_connection_error(gc, _("Connection failed"));
+ purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR, + _("Connection failed")); silc_pkcs_public_key_free(sg->public_key);
silc_pkcs_private_key_free(sg->private_key);
@@ -308,7 +315,8 @@
- purple_connection_error(gc, _("Connection failed"));
+ purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR, + _("Connection failed")); silc_pkcs_public_key_free(sg->public_key);
silc_pkcs_private_key_free(sg->private_key);
@@ -349,8 +357,8 @@
(char *)purple_account_get_string(account, "private-key", prd),
(gc->password == NULL) ? "" : gc->password,
&sg->public_key, &sg->private_key)) {
- g_snprintf(pkd, sizeof(pkd), _("Could not load SILC key pair"));
- purple_connection_error(gc, pkd);
+ purple_connection_error_reason(gc, PURPLE_REASON_OTHER_ERROR, + _("Could not load SILC key pair")); @@ -363,7 +371,8 @@
purple_account_get_int(account, "port", 706),
silcpurple_login_connected, gc) == NULL)
- purple_connection_error(gc, _("Unable to create connection"));
+ purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR, + _("Unable to create connection")); @@ -392,7 +401,8 @@
/* Allocate SILC client */
client = silc_client_alloc(&ops, ¶ms, gc, NULL);
- purple_connection_error(gc, _("Out of memory"));
+ purple_connection_error_reason(gc, PURPLE_REASON_OTHER_ERROR, @@ -435,14 +445,16 @@
if (!silc_client_init(client, username, hostname, realname,
silcpurple_running, account)) {
- purple_connection_error(gc, _("Cannot initialize SILC protocol"));
+ purple_connection_error_reason(gc, PURPLE_REASON_OTHER_ERROR, + _("Cannot initialize SILC protocol")); /* Check the ~/.silc dir and create it, and new key pair if necessary. */
if (!silcpurple_check_silc_dir(gc)) {
- purple_connection_error(gc, _("Error loading SILC key pair"));
+ purple_connection_error_reason(gc, PURPLE_REASON_OTHER_ERROR, + _("Error loading SILC key pair")); --- a/libpurple/protocols/silc/util.c Tue Oct 02 19:17:34 2007 +0000
+++ b/libpurple/protocols/silc/util.c Wed Oct 03 13:12:39 2007 +0000
@@ -212,7 +212,8 @@
- purple_connection_error(gc, _("Cannot create SILC key pair\n"));
+ purple_connection_error_reason(gc, PURPLE_REASON_OTHER_ERROR, + _("Cannot create SILC key pair\n")); @@ -254,7 +255,8 @@
- purple_connection_error(gc, _("Cannot create SILC key pair\n"));
+ purple_connection_error_reason(gc, PURPLE_REASON_OTHER_ERROR, + _("Cannot create SILC key pair\n"));