im.pidgin.cpw.resiak.disconnectreason: b1da9593a95e0a9cfd47a48ae2d4655c5bce83d4

resiak at soc.pidgin.im resiak at soc.pidgin.im
Wed Oct 3 13:57:54 EDT 2007


revision:            b1da9593a95e0a9cfd47a48ae2d4655c5bce83d4
date:                2007-09-19T16:38:33
author:              resiak at soc.pidgin.im
branch:              im.pidgin.cpw.resiak.disconnectreason
changelog:
Use purple_connection_error_reason in prpl-msn.

manifest:
format_version "1"

new_manifest [f434af6c697142e302e0d4da0391ce8a789888cf]

old_revision [0d8e7c642905805be5e7d1c5774de8d2d14b4584]

patch "libpurple/protocols/msn/msn.c"
 from [5cf2c5495f1eee96279c1f3a22642c3397150e5b]
   to [92cc741fa63a75576f88c4847d1fd4c60fcbb71a]

patch "libpurple/protocols/msn/session.c"
 from [c00810400b189db9e2a3ffa25f1f430d41561bd1]
   to [f9162756ad2b89aebe3eb01153aa97b5e2a44aa0]
-------------- next part --------------
#
#
# patch "libpurple/protocols/msn/msn.c"
#  from [5cf2c5495f1eee96279c1f3a22642c3397150e5b]
#    to [92cc741fa63a75576f88c4847d1fd4c60fcbb71a]
# 
# patch "libpurple/protocols/msn/session.c"
#  from [c00810400b189db9e2a3ffa25f1f430d41561bd1]
#    to [f9162756ad2b89aebe3eb01153aa97b5e2a44aa0]
#
============================================================
--- libpurple/protocols/msn/msn.c	5cf2c5495f1eee96279c1f3a22642c3397150e5b
+++ libpurple/protocols/msn/msn.c	92cc741fa63a75576f88c4847d1fd4c60fcbb71a
@@ -722,7 +722,7 @@ msn_login(PurpleAccount *account)
 	if (!purple_ssl_is_supported())
 	{
 		gc->wants_to_die = TRUE;
-		purple_connection_error(gc,
+		purple_connection_error_reason (gc, PURPLE_REASON_ENCRYPTION_ERROR,
 			_("SSL support is needed for MSN. Please install a supported "
 			  "SSL library."));
 		return;
@@ -751,7 +751,8 @@ msn_login(PurpleAccount *account)
 		purple_account_set_username(account, username);
 
 	if (!msn_session_connect(session, host, port, http_method))
-		purple_connection_error(gc, _("Failed to connect to server."));
+		purple_connection_error_reason (gc, PURPLE_REASON_NETWORK_ERROR,
+			_("Failed to connect to server."));
 }
 
 static void
============================================================
--- libpurple/protocols/msn/session.c	c00810400b189db9e2a3ffa25f1f430d41561bd1
+++ libpurple/protocols/msn/session.c	f9162756ad2b89aebe3eb01153aa97b5e2a44aa0
@@ -286,6 +286,7 @@ msn_session_set_error(MsnSession *sessio
 					  const char *info)
 {
 	PurpleConnection *gc;
+	PurpleDisconnectReason reason;
 	char *msg;
 
 	gc = purple_account_get_connection(session->account);
@@ -293,47 +294,56 @@ msn_session_set_error(MsnSession *sessio
 	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);
 }


More information about the Commits mailing list