changeset 9190:9e3289499977

[gaim-migrate @ 9985] Patch by Evan Schoenberg. The disconnected UI op was called twice on connection errors. Now it is only called once. He describes it as follows: "Currently, the UI's disconnected callback is called twice when there is a connection error. First, it is called by gaim_connection_error(). Then, gaim_connection_disconnect_cb is called, leading to a call to gaim_connection_set_state() at which point the gc's state is set to GAIM_DISCONNECTED. Finally, the UI's disconnected callback is called once the state is set to GAIM_DISCONNECTED. The call in gaim_connection_error() is incorrect; there is no need to manually call the UI's disconnected callback. It causes really nasty problems for smart reconnection handling and is wasteful. :)" committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sun, 06 Jun 2004 02:07:59 +0000
parents 2645d2ccbe80
children 06b28fb24300
files ChangeLog src/connection.c
diffstat 2 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Jun 06 01:44:19 2004 +0000
+++ b/ChangeLog	Sun Jun 06 02:07:59 2004 +0000
@@ -20,6 +20,8 @@
 	  the buddy list (Pekka Riikonen)
 	* Parallel compiles of the perl plugin should work better
 	  (Stu Tomlinson)
+	* The disconnected UI op was called twice on connection errors. Now
+	  it is only called once. (Evan Schoenberg).
 
 version 0.78 (05/30/2004):
 	New Features:
--- a/src/connection.c	Sun Jun 06 01:44:19 2004 +0000
+++ b/src/connection.c	Sun Jun 06 02:07:59 2004 +0000
@@ -401,13 +401,13 @@
 			gaim_log_write(log, GAIM_MESSAGE_SYSTEM,
 						   gaim_account_get_username(account), time(NULL),
 						   msg);
-			g_free(msg);						   
+			g_free(msg);
 		}
 
 		gaim_account_destroy_log(account);
 
 		if (ops != NULL && ops->disconnected != NULL)
-			ops->disconnected(gc);		
+			ops->disconnected(gc);
 	}
 }
 
@@ -503,9 +503,6 @@
 	if (ops != NULL) {
 		if (ops->report_disconnect != NULL)
 			ops->report_disconnect(gc, text);
-
-		if (ops->disconnected != NULL)
-			ops->disconnected(gc);
 	}
 
 	gc->disconnect_timeout = gaim_timeout_add(0, gaim_connection_disconnect_cb,