pidgin/pidgin

Add disconnection reasons to qq.
cpw.resiak.disconnectreason
2007-10-02, Will Thompson
ca530c968a1b
Parents a9fc6198b5c6
Children c50bd2f30044
Add disconnection reasons to qq.
--- a/libpurple/protocols/qq/keep_alive.c Mon Oct 01 16:07:14 2007 +0000
+++ b/libpurple/protocols/qq/keep_alive.c Tue Oct 02 00:14:12 2007 +0000
@@ -84,7 +84,8 @@
/* 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);
--- a/libpurple/protocols/qq/login_logout.c Mon Oct 01 16:07:14 2007 +0000
+++ b/libpurple/protocols/qq/login_logout.c Tue Oct 02 00:14:12 2007 +0000
@@ -405,7 +405,7 @@
">>> %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 @@
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");
--- a/libpurple/protocols/qq/qq.c Mon Oct 01 16:07:14 2007 +0000
+++ b/libpurple/protocols/qq/qq.c Tue Oct 02 00:14:12 2007 +0000
@@ -136,7 +136,8 @@
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 */