im.pidgin.cpw.resiak.disconnectreason: 1c4a76a16cd4f8e8ae374ea786d9c7001acf7918

resiak at soc.pidgin.im resiak at soc.pidgin.im
Sat Oct 27 13:50:38 EDT 2007


-----------------------------------------------------------------
Revision: 1c4a76a16cd4f8e8ae374ea786d9c7001acf7918
Ancestor: fbe80ce5e4857c1c963cb7e3add0c24a24e7bcb9
Author: resiak at soc.pidgin.im
Date: 2007-10-27T17:45:05
Branch: im.pidgin.cpw.resiak.disconnectreason

Modified files:
        pidgin/gtkblist.c pidgin/gtkconn.c

ChangeLog: 

Call pidgin_blist_update_account_error_state in response to
account-error-changed rather than in various places in gtkconn.c.

-------------- next part --------------
============================================================
--- pidgin/gtkblist.c	bf87dec6f61fadc1572c87b2a4d8b14e57d21ebe
+++ pidgin/gtkblist.c	02ac21eafa5eb0c5f26487eae41ac3752e79d469
@@ -4394,6 +4394,16 @@ void
 }
 
 void
+account_error_changed_cb(PurpleAccount *account,
+                         PurpleAccountCurrentError *err)
+{
+	if (err)
+		pidgin_blist_update_account_error_state(account, err->description);
+	else
+		pidgin_blist_update_account_error_state(account, NULL);
+}
+
+void
 pidgin_blist_update_account_error_state(PurpleAccount *account, const char *text)
 {
 	GList *l;
@@ -4956,6 +4966,9 @@ static void pidgin_blist_show(PurpleBudd
 	purple_signal_connect(handle, "account-status-changed", gtkblist,
 	                      PURPLE_CALLBACK(account_status_changed),
 	                      gtkblist);
+	purple_signal_connect(handle, "account-error-changed", gtkblist,
+	                      PURPLE_CALLBACK(account_error_changed_cb),
+	                      gtkblist);
 
 	handle = pidgin_account_get_handle();
 	purple_signal_connect(handle, "account-modified", gtkblist,
============================================================
--- pidgin/gtkconn.c	1849b019933b67460d67529ee412ac025582859c
+++ pidgin/gtkconn.c	93569dffe21bfeb2fef63bfe1bc635d547d533f1
@@ -82,8 +82,6 @@ pidgin_connection_connected(PurpleConnec
 					   (purple_connections_get_connecting() != NULL));
 
 	g_hash_table_remove(auto_reconns, account);
-
-	pidgin_blist_update_account_error_state(account, NULL);
 }
 
 static void
@@ -149,7 +147,6 @@ pidgin_connection_report_disconnect_reas
 	account = purple_connection_get_account(gc);
 	info = g_hash_table_lookup(auto_reconns, account);
 
-	pidgin_blist_update_account_error_state(account, text);
 	if (!purple_connection_error_is_fatal (reason)) {
 		if (info == NULL) {
 			info = g_new0(PidginAutoRecon, 1);
@@ -301,8 +298,6 @@ account_removed_cb(PurpleAccount *accoun
 account_removed_cb(PurpleAccount *account, gpointer user_data)
 {
 	g_hash_table_remove(auto_reconns, account);
-
-	pidgin_blist_update_account_error_state(account, NULL);
 }
 
 


More information about the Commits mailing list