--- a/libpurple/protocols/sametime/sametime.c Tue Oct 02 00:27:50 2007 +0000
+++ b/libpurple/protocols/sametime/sametime.c Tue Oct 02 15:57:32 2007 +0000
@@ -414,7 +414,8 @@
DEBUG_ERROR("write returned %i, %i bytes left unwritten\n", ret, len);
- purple_connection_error(pd->gc, _("Connection closed (writing)"));
+ purple_connection_error_reason(pd->gc, PURPLE_REASON_NETWORK_ERROR, + _("Connection closed (writing)")); @@ -1552,7 +1553,38 @@
if(GPOINTER_TO_UINT(info) & ERR_FAILURE) {
char *err = mwError(GPOINTER_TO_UINT(info));
- purple_connection_error(gc, err);
+ PurpleDisconnectReason reason; + switch (GPOINTER_TO_UINT(info)) { + reason = PURPLE_REASON_OTHER_ERROR; + case USER_UNREGISTERED: + reason = PURPLE_REASON_AUTHENTICATION_FAILED; + case ERR_ENCRYPT_NO_SUPPORT: + case ERR_NO_COMMON_ENCRYPT: + reason = PURPLE_REASON_ENCRYPTION_ERROR; + case VERIFICATION_DOWN: + reason = PURPLE_REASON_AUTHENTICATION_IMPOSSIBLE; + case MULTI_SERVER_LOGIN: + case MULTI_SERVER_LOGIN2: + reason = PURPLE_REASON_NAME_IN_USE; + reason = PURPLE_REASON_NETWORK_ERROR; + purple_connection_error_reason(gc, reason, err); @@ -1698,8 +1730,9 @@
+ const char *msg = _("Connection reset"); DEBUG_INFO("connection reset\n");
- purple_connection_error(pd->gc, _("Connection reset"));
+ purple_connection_error_reason(pd->gc, PURPLE_REASON_NETWORK_ERROR, msg); char *msg = strerror(err);
@@ -1707,7 +1740,7 @@
DEBUG_INFO("error in read callback: %s\n", msg);
msg = g_strdup_printf(_("Error reading from socket: %s"), msg);
- purple_connection_error(pd->gc, msg);
+ purple_connection_error_reason(pd->gc, PURPLE_REASON_NETWORK_ERROR, msg); @@ -1729,7 +1762,8 @@
/* this is a regular connect, error out */
- purple_connection_error(pd->gc, _("Unable to connect to host"));
+ const char *msg = _("Unable to connect to host"); + purple_connection_error_reason(pd->gc, PURPLE_REASON_NETWORK_ERROR, msg); @@ -3611,7 +3645,8 @@
static void prompt_host_cancel_cb(PurpleConnection *gc) {
- purple_connection_error(gc, _("No Sametime Community Server specified"));
+ const char *msg = _("No Sametime Community Server specified"); + purple_connection_error_reason(gc, PURPLE_REASON_INVALID_USERNAME, msg); @@ -3723,7 +3758,8 @@
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(gc, _("Unable to connect to host"));
+ purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR, + _("Unable to connect to host"));