pidgin/pidgin

Make pidgin use report_disconnect_reason rather than report_disconnect, and
cpw.resiak.disconnectreason
2007-09-17, Will Thompson
786f26a8dc6f
Make pidgin use report_disconnect_reason rather than report_disconnect, and
check purple_connection_reason_is_fatal rather than wants_to_die. (NB. Since
none of the protocols use error_reason yet, purple_connection_reason_is_fatal
is always true for now...)
--- a/pidgin/gtkconn.c Mon Sep 17 16:52:38 2007 +0000
+++ b/pidgin/gtkconn.c Mon Sep 17 16:54:45 2007 +0000
@@ -41,6 +41,7 @@
#define INITIAL_RECON_DELAY_MAX 60000
#define MAX_RECON_DELAY 600000
+#define MAX_RACCOON_DELAY "shorter in urban areas"
typedef struct {
int delay;
@@ -136,7 +137,9 @@
}
static void
-pidgin_connection_report_disconnect(PurpleConnection *gc, const char *text)
+pidgin_connection_report_disconnect_reason (PurpleConnection *gc,
+ PurpleDisconnectReason reason,
+ const char *text)
{
PurpleAccount *account = NULL;
PidginAutoRecon *info;
@@ -145,7 +148,7 @@
info = g_hash_table_lookup(hash, account);
pidgin_blist_update_account_error_state(account, text);
- if (!gc->wants_to_die) {
+ if (!purple_connection_reason_is_fatal (reason)) {
if (info == NULL) {
info = g_new0(PidginAutoRecon, 1);
g_hash_table_insert(hash, account, info);
@@ -246,10 +249,10 @@
pidgin_connection_connected,
pidgin_connection_disconnected,
pidgin_connection_notice,
- pidgin_connection_report_disconnect,
+ NULL, /* report_disconnect */
pidgin_connection_network_connected,
pidgin_connection_network_disconnected,
- NULL,
+ pidgin_connection_report_disconnect_reason,
NULL,
NULL,
NULL