diff libpurple/protocols/msn/session.c @ 20120:557c4c67bd29

Use purple_connection_error_reason in prpl-msn.
author Will Thompson <will.thompson@collabora.co.uk>
date Wed, 19 Sep 2007 16:38:33 +0000
parents 44b4e8bd759b
children f3cfcbbac3d8
line wrap: on
line diff
--- a/libpurple/protocols/msn/session.c	Wed Sep 19 15:16:32 2007 +0000
+++ b/libpurple/protocols/msn/session.c	Wed Sep 19 16:38:33 2007 +0000
@@ -286,6 +286,7 @@
 					  const char *info)
 {
 	PurpleConnection *gc;
+	PurpleDisconnectReason reason;
 	char *msg;
 
 	gc = purple_account_get_connection(session->account);
@@ -293,47 +294,56 @@
 	switch (error)
 	{
 		case MSN_ERROR_SERVCONN:
+			reason = PURPLE_REASON_NETWORK_ERROR;
 			msg = g_strdup(info);
 			break;
 		case MSN_ERROR_UNSUPPORTED_PROTOCOL:
+			reason = PURPLE_REASON_NETWORK_ERROR;
 			msg = g_strdup(_("Our protocol is not supported by the "
 							 "server."));
 			break;
 		case MSN_ERROR_HTTP_MALFORMED:
+			reason = PURPLE_REASON_NETWORK_ERROR;
 			msg = g_strdup(_("Error parsing HTTP."));
 			break;
 		case MSN_ERROR_SIGN_OTHER:
 			gc->wants_to_die = TRUE;
+			reason = PURPLE_REASON_NAME_IN_USE;
 			msg = g_strdup(_("You have signed on from another location."));
 			break;
 		case MSN_ERROR_SERV_UNAVAILABLE:
+			reason = PURPLE_REASON_NETWORK_ERROR;
 			msg = g_strdup(_("The MSN servers are temporarily "
 							 "unavailable. Please wait and try "
 							 "again."));
 			break;
 		case MSN_ERROR_SERV_DOWN:
+			reason = PURPLE_REASON_NETWORK_ERROR;
 			msg = g_strdup(_("The MSN servers are going down "
 							 "temporarily."));
 			break;
 		case MSN_ERROR_AUTH:
+			reason = PURPLE_REASON_AUTHENTICATION_FAILED;
 			gc->wants_to_die = TRUE;
 			msg = g_strdup_printf(_("Unable to authenticate: %s"),
 								  (info == NULL ) ?
 								  _("Unknown error") : info);
 			break;
 		case MSN_ERROR_BAD_BLIST:
+			reason = PURPLE_REASON_NETWORK_ERROR;
 			msg = g_strdup(_("Your MSN buddy list is temporarily "
 							 "unavailable. Please wait and try "
 							 "again."));
 			break;
 		default:
+			reason = PURPLE_REASON_NETWORK_ERROR;
 			msg = g_strdup(_("Unknown error."));
 			break;
 	}
 
 	msn_session_disconnect(session);
 
-	purple_connection_error(gc, msg);
+	purple_connection_error_reason (gc, reason, msg);
 
 	g_free(msg);
 }