comparison src/connection.c @ 5740:6ec7b32ab1df

[gaim-migrate @ 6164] Hopefully fixed an infinite loop bug on disconnect, but I'm not holding my breath. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Wed, 04 Jun 2003 07:28:36 +0000
parents 2e9f040f6b66
children 1b5e6e6e80e9
comparison
equal deleted inserted replaced
5739:edf4d443e671 5740:6ec7b32ab1df
109 gaim_connection_disconnect(GaimConnection *gc) 109 gaim_connection_disconnect(GaimConnection *gc)
110 { 110 {
111 GList *wins; 111 GList *wins;
112 112
113 g_return_if_fail(gc != NULL); 113 g_return_if_fail(gc != NULL);
114 g_return_if_fail(gaim_connection_get_state(gc) != GAIM_DISCONNECTED); 114
115 115 if (gaim_connection_get_state(gc) != GAIM_DISCONNECTED) {
116 if (gaim_connection_get_state(gc) != GAIM_CONNECTING) 116 if (gaim_connection_get_state(gc) != GAIM_CONNECTING)
117 gaim_blist_remove_account(gaim_connection_get_account(gc)); 117 gaim_blist_remove_account(gaim_connection_get_account(gc));
118 118
119 serv_close(gc); 119 serv_close(gc);
120 120
121 gaim_connection_set_state(gc, GAIM_DISCONNECTED); 121 gaim_connection_set_state(gc, GAIM_DISCONNECTED);
122 122
123 connections = g_list_remove(connections, gc); 123 connections = g_list_remove(connections, gc);
124 124
125 gaim_event_broadcast(event_signoff, gc); 125 gaim_event_broadcast(event_signoff, gc);
126 system_log(log_signoff, gc, NULL, OPT_LOG_BUDDY_SIGNON | OPT_LOG_MY_SIGNON); 126 system_log(log_signoff, gc, NULL,
127 127 OPT_LOG_BUDDY_SIGNON | OPT_LOG_MY_SIGNON);
128 /* 128
129 * XXX This is a hack! Remove this and replace it with a better event 129 /*
130 * notification system. 130 * XXX This is a hack! Remove this and replace it with a better event
131 */ 131 * notification system.
132 for (wins = gaim_get_windows(); wins != NULL; wins = wins->next) { 132 */
133 GaimWindow *win = (GaimWindow *)wins->data; 133 for (wins = gaim_get_windows(); wins != NULL; wins = wins->next) {
134 gaim_conversation_update(gaim_window_get_conversation_at(win, 0), 134 GaimWindow *win = (GaimWindow *)wins->data;
135 GAIM_CONV_ACCOUNT_OFFLINE); 135 gaim_conversation_update(gaim_window_get_conversation_at(win, 0),
136 } 136 GAIM_CONV_ACCOUNT_OFFLINE);
137 137 }
138 gaim_request_close_with_handle(gc); 138
139 gaim_notify_close_with_handle(gc); 139 gaim_request_close_with_handle(gc);
140 140 gaim_notify_close_with_handle(gc);
141 update_privacy_connections(); 141
142 update_privacy_connections();
143 }
142 144
143 gaim_connection_destroy(gc); 145 gaim_connection_destroy(gc);
144 146
145 /* XXX More UI stuff! */ 147 /* XXX More UI stuff! */
146 if (connections != NULL) 148 if (connections != NULL)