im.pidgin.cpw.resiak.disconnectreason: 548e06334e7772c9583776ecbd80e8d2a68fcd79

resiak at soc.pidgin.im resiak at soc.pidgin.im
Wed Oct 3 13:56:31 EDT 2007


revision:            548e06334e7772c9583776ecbd80e8d2a68fcd79
date:                2007-10-03T17:44:29
author:              resiak at soc.pidgin.im
branch:              im.pidgin.cpw.resiak.disconnectreason
changelog:
Add disconnection reasons to yahoo

manifest:
format_version "1"

new_manifest [f40073213962b834238ebc43d52a25c3509a6ccb]

old_revision [3bf36d05f31cdaa9f0a3d9ad2b752a86ffc3e61f]

patch "libpurple/protocols/yahoo/yahoo.c"
 from [e913333019838359fa464cd70d63e3cc52432b75]
   to [e503d41cf25891fd8c4286a21c961e4aef07c24f]

patch "libpurple/protocols/yahoo/yahoo_packet.c"
 from [cb6d13aad2b6f48eb92d2ae45940dd52a5cf2d15]
   to [6b59837050f7ca30a7ebf3ee15341c8c7078780b]
-------------- next part --------------
#
#
# patch "libpurple/protocols/yahoo/yahoo.c"
#  from [e913333019838359fa464cd70d63e3cc52432b75]
#    to [e503d41cf25891fd8c4286a21c961e4aef07c24f]
# 
# patch "libpurple/protocols/yahoo/yahoo_packet.c"
#  from [cb6d13aad2b6f48eb92d2ae45940dd52a5cf2d15]
#    to [6b59837050f7ca30a7ebf3ee15341c8c7078780b]
#
============================================================
--- libpurple/protocols/yahoo/yahoo.c	e913333019838359fa464cd70d63e3cc52432b75
+++ libpurple/protocols/yahoo/yahoo.c	e503d41cf25891fd8c4286a21c961e4aef07c24f
@@ -202,7 +202,8 @@ static void yahoo_process_status(PurpleC
 
 	if (pkt->service == YAHOO_SERVICE_LOGOFF && pkt->status == -1) {
 		gc->wants_to_die = TRUE;
-		purple_connection_error(gc, _("You have signed on from another location."));
+		purple_connection_error_reason(gc, PURPLE_REASON_NAME_IN_USE,
+			_("You have signed on from another location."));
 		return;
 	}
 
@@ -2135,7 +2136,7 @@ static void yahoo_process_authresp(Purpl
 		fullmsg = g_strdup(msg);
 
 	gc->wants_to_die = TRUE;
-	purple_connection_error(gc, fullmsg);
+	purple_connection_error_reason(gc, PURPLE_REASON_AUTHENTICATION_FAILED, fullmsg);
 	g_free(msg);
 	g_free(fullmsg);
 }
@@ -2459,11 +2460,12 @@ static void yahoo_pending(gpointer data,
 
 		tmp = g_strdup_printf(_("Lost connection with server:\n%s"),
 				strerror(errno));
-		purple_connection_error(gc, tmp);
+		purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR, tmp);
 		g_free(tmp);
 		return;
 	} else if (len == 0) {
-		purple_connection_error(gc, _("Server closed the connection."));
+		purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR,
+				_("Server closed the connection."));
 		return;
 	}
 
@@ -2554,7 +2556,7 @@ static void yahoo_got_connected(gpointer
 		gchar *tmp;
 		tmp = g_strdup_printf(_("Could not establish a connection with the server:\n%s"),
 				error_message);
-		purple_connection_error(gc, tmp);
+		purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR, tmp);
 		g_free(tmp);
 		return;
 	}
@@ -2586,7 +2588,7 @@ static void yahoo_got_web_connected(gpoi
 		gchar *tmp;
 		tmp = g_strdup_printf(_("Could not establish a connection with the server:\n%s"),
 				error_message);
-		purple_connection_error(gc, tmp);
+		purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR, tmp);
 		g_free(tmp);
 		return;
 	}
@@ -2626,11 +2628,12 @@ static void yahoo_web_pending(gpointer d
 
 		tmp = g_strdup_printf(_("Lost connection with server:\n%s"),
 				strerror(errno));
-		purple_connection_error(gc, tmp);
+		purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR, tmp);
 		g_free(tmp);
 		return;
 	} else if (len == 0) {
-		purple_connection_error(gc, _("Server closed the connection."));
+		purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR,
+			_("Server closed the connection."));
 		return;
 	}
 
@@ -2645,7 +2648,8 @@ 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(gc, _("Received unexpected HTTP response from server."));
+		purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR,
+			_("Received unexpected HTTP response from server."));
 		return;
 	}
 
@@ -2667,9 +2671,10 @@ static void yahoo_web_pending(gpointer d
 	yd->rxlen = 0;
 	/* Now we have our cookies to login with.  I'll go get the milk. */
 	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(gc, _("Connection problem"));
+	                         purple_account_get_int(account, "port", YAHOO_PAGER_PORT),
+	                         yahoo_got_web_connected, gc) == NULL) {
+		purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR,
+		                               _("Connection problem"));
 		return;
 	}
 }
@@ -2697,7 +2702,7 @@ static void yahoo_got_cookies_send_cb(gp
 		gc->inpa = 0;
 		tmp = g_strdup_printf(_("Lost connection with %s:\n%s"),
 				"login.yahoo.com:80", strerror(errno));
-		purple_connection_error(gc, tmp);
+		purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR, tmp);
 		g_free(tmp);
 		return;
 	}
@@ -2722,7 +2727,7 @@ static void yahoo_got_cookies(gpointer d
 		gchar *tmp;
 		tmp = g_strdup_printf(_("Could not establish a connection with %s:\n%s"),
 				"login.yahoo.com:80", error_message);
-		purple_connection_error(gc, tmp);
+		purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR, tmp);
 		g_free(tmp);
 		return;
 	}
@@ -2806,7 +2811,8 @@ yahoo_login_page_cb(PurpleUtilFetchUrlDa
 
 	if (error_message != NULL)
 	{
-		purple_connection_error(gc, error_message);
+		purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR,
+		                               error_message);
 		return;
 	}
 
@@ -2855,7 +2861,8 @@ 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(gc, _("Connection problem"));
+		purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR,
+		                               _("Connection problem"));
 		return;
 	}
 
@@ -2958,7 +2965,8 @@ static void yahoo_login(PurpleAccount *a
 		                       purple_account_get_int(account, "port", YAHOO_PAGER_PORT),
 		                       yahoo_got_connected, gc) == NULL)
 		{
-			purple_connection_error(gc, _("Connection problem"));
+			purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR,
+			                               _("Connection problem"));
 			return;
 		}
 	} else {
@@ -2968,7 +2976,8 @@ static void yahoo_login(PurpleAccount *a
 		                       purple_account_get_int(account, "port", YAHOO_PAGER_PORT),
 		                       yahoo_got_connected, gc) == NULL)
 		{
-			purple_connection_error(gc, _("Connection problem"));
+			purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR,
+			                               _("Connection problem"));
 			return;
 		}
 	}
============================================================
--- libpurple/protocols/yahoo/yahoo_packet.c	cb6d13aad2b6f48eb92d2ae45940dd52a5cf2d15
+++ libpurple/protocols/yahoo/yahoo_packet.c	6b59837050f7ca30a7ebf3ee15341c8c7078780b
@@ -304,7 +304,8 @@ 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(yd->gc, _("Write Error"));
+		purple_connection_error_reason(yd->gc, PURPLE_REASON_NETWORK_ERROR,
+		                               _("Write Error"));
 		return;
 	}
 


More information about the Commits mailing list