im.pidgin.cpw.resiak.disconnectreason: e13c0fd64600fdc3758beda2797b41750d75807b

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


revision:            e13c0fd64600fdc3758beda2797b41750d75807b
date:                2007-10-02T00:14:12
author:              resiak at soc.pidgin.im
branch:              im.pidgin.cpw.resiak.disconnectreason
changelog:
Add disconnection reasons to qq.

manifest:
format_version "1"

new_manifest [ddbcb3221abe554df8c4f9fc61faefab4e5131aa]

old_revision [7266acdcb410efd87541ac9165bc9c877b871565]

patch "libpurple/protocols/qq/keep_alive.c"
 from [d484a69f067fd36173f3d61ca99b1ece7bb55d20]
   to [154aff8cde963b9cb3e6bab4162b2beb6bf067a1]

patch "libpurple/protocols/qq/login_logout.c"
 from [29b6f3c6a8fde82d33d0b2310504e05b7fcd5427]
   to [5cfe4e52f459aab9236643e3022fb3a7a364be63]

patch "libpurple/protocols/qq/qq.c"
 from [e96d1ecc360a1b7e094e8e81fda90d893e90617b]
   to [dbf9f032010e4a4644dbc2bdcfede7f1fb4d6230]
-------------- next part --------------
#
#
# patch "libpurple/protocols/qq/keep_alive.c"
#  from [d484a69f067fd36173f3d61ca99b1ece7bb55d20]
#    to [154aff8cde963b9cb3e6bab4162b2beb6bf067a1]
# 
# patch "libpurple/protocols/qq/login_logout.c"
#  from [29b6f3c6a8fde82d33d0b2310504e05b7fcd5427]
#    to [5cfe4e52f459aab9236643e3022fb3a7a364be63]
# 
# patch "libpurple/protocols/qq/qq.c"
#  from [e96d1ecc360a1b7e094e8e81fda90d893e90617b]
#    to [dbf9f032010e4a4644dbc2bdcfede7f1fb4d6230]
#
============================================================
--- libpurple/protocols/qq/keep_alive.c	d484a69f067fd36173f3d61ca99b1ece7bb55d20
+++ libpurple/protocols/qq/keep_alive.c	154aff8cde963b9cb3e6bab4162b2beb6bf067a1
@@ -84,7 +84,8 @@ void qq_process_keep_alive_reply(guint8 
 		/* segments[0] and segment[1] are all 0x30 ("0") */
 		qd->all_online = strtol(segments[2], NULL, 10);
 		if(0 == qd->all_online)
-			purple_connection_error(gc, _("Keep alive error"));
+			purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR,
+					_("Keep alive error"));
 		g_free(qd->my_ip);
 		qd->my_ip = g_strdup(segments[3]);
 		qd->my_port = strtol(segments[4], NULL, 10);
============================================================
--- libpurple/protocols/qq/login_logout.c	29b6f3c6a8fde82d33d0b2310504e05b7fcd5427
+++ libpurple/protocols/qq/login_logout.c	5cfe4e52f459aab9236643e3022fb3a7a364be63
@@ -405,7 +405,7 @@ void qq_process_request_login_token_repl
 				">>> %d bytes -> [default] decrypt and dump\n%s",
 				buf_len, hex_dump);
 		try_dump_as_gbk(buf, buf_len);
-		purple_connection_error(gc, _("Error requesting login token"));
+		purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR, _("Error requesting login token"));
 	}
 	g_free(hex_dump);
 }
@@ -480,10 +480,12 @@ void qq_process_login_reply(guint8 *buf,
 	switch (ret) {
 	case QQ_LOGIN_REPLY_PWD_ERROR:
 		gc->wants_to_die = TRUE;
-		purple_connection_error(gc, _("Incorrect password."));
+		purple_connection_error_reason(gc,
+			PURPLE_REASON_AUTHENTICATION_FAILED, _("Incorrect password."));
 		break;
 	case QQ_LOGIN_REPLY_MISC_ERROR:
-		purple_connection_error(gc, _("Unable to login, check debug log"));
+		purple_connection_error_reason(gc,
+			PURPLE_REASON_NETWORK_ERROR, _("Unable to login, check debug log"));
 		break;
 	case QQ_LOGIN_REPLY_OK:
 		purple_debug(PURPLE_DEBUG_INFO, "QQ", "Login replys OK, everything is fine\n");
============================================================
--- libpurple/protocols/qq/qq.c	e96d1ecc360a1b7e094e8e81fda90d893e90617b
+++ libpurple/protocols/qq/qq.c	dbf9f032010e4a4644dbc2bdcfede7f1fb4d6230
@@ -136,7 +136,8 @@ static void _qq_login(PurpleAccount *acc
 	purple_connection_update_progress(gc, _("Connecting"), 0, QQ_CONNECT_STEPS);
 
 	if (qq_connect(account, qq_server, strtol(qq_port, NULL, 10), use_tcp, FALSE) < 0)
-		purple_connection_error(gc, _("Unable to connect."));
+		purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR,
+			_("Unable to connect."));
 }
 
 /* directly goes for qq_disconnect */


More information about the Commits mailing list