pidgin/pidgin

Add disconnection reasons to qq
cpw.resiak.disconnectreason
2007-10-02, Will Thompson
c50bd2f30044
Parents ca530c968a1b
Children 058f341481a5
Add disconnection reasons to qq
--- a/libpurple/protocols/qq/qq_proxy.c Tue Oct 02 00:14:12 2007 +0000
+++ b/libpurple/protocols/qq/qq_proxy.c Tue Oct 02 00:27:50 2007 +0000
@@ -139,7 +139,7 @@
g_return_if_fail(gc != NULL && gc->proto_data != NULL);
if (source < 0) { /* socket returns -1 */
- purple_connection_error(gc, error_message);
+ purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR, error_message);
return;
}
@@ -494,7 +494,7 @@
ret = send(qd->fd, data, len, 0);
}
if (ret == -1)
- purple_connection_error(qd->gc, strerror(errno));
+ purple_connection_error_reason(qd->gc, PURPLE_REASON_NETWORK_ERROR, strerror(errno));
return ret;
}
--- a/libpurple/protocols/qq/recv_core.c Tue Oct 02 00:14:12 2007 +0000
+++ b/libpurple/protocols/qq/recv_core.c Tue Oct 02 00:27:50 2007 +0000
@@ -306,7 +306,8 @@
gc = (PurpleConnection *) data;
if(cond != PURPLE_INPUT_READ) {
- purple_connection_error(gc, _("Socket error"));
+ purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR,
+ _("Socket error"));
return;
}
@@ -316,7 +317,8 @@
/* here we have UDP proxy suppport */
len = qq_proxy_read(qd, buf, MAX_PACKET_SIZE);
if (len <= 0) {
- purple_connection_error(gc, _("Unable to read from socket"));
+ purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR,
+ _("Unable to read from socket"));
return;
} else {
_qq_packet_process(buf, len, gc);
--- a/libpurple/protocols/qq/sendqueue.c Tue Oct 02 00:14:12 2007 +0000
+++ b/libpurple/protocols/qq/sendqueue.c Tue Oct 02 00:27:50 2007 +0000
@@ -120,7 +120,8 @@
case QQ_CMD_KEEP_ALIVE:
if (qd->logged_in) {
purple_debug(PURPLE_DEBUG_ERROR, "QQ", "Connection lost!\n");
- purple_connection_error(gc, _("Connection lost"));
+ purple_connection_error_reason(gc,
+ PURPLE_REASON_NETWORK_ERROR, _("Connection lost"));
qd->logged_in = FALSE;
}
p->resend_times = -1;
@@ -128,7 +129,8 @@
case QQ_CMD_LOGIN:
case QQ_CMD_REQUEST_LOGIN_TOKEN:
if (!qd->logged_in) /* cancel login progress */
- purple_connection_error(gc, _("Login failed, no reply"));
+ purple_connection_error_reason(gc,
+ PURPLE_REASON_NETWORK_ERROR, _("Login failed, no reply"));
p->resend_times = -1;
break;
default:{