comparison src/connection.c @ 11507:18c18cbc0967

[gaim-migrate @ 13752] Fix HEAD bug #16 - offline buddies remain in buddy list after disconnecting committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Sun, 11 Sep 2005 15:24:58 +0000
parents 0d3d1031e397
children 9f521a61ef58
comparison
equal deleted inserted replaced
11506:88d504770c60 11507:18c18cbc0967
155 GaimAccount *account; 155 GaimAccount *account;
156 #if 0 156 #if 0
157 GList *wins; 157 GList *wins;
158 #endif 158 #endif
159 GaimPluginProtocolInfo *prpl_info = NULL; 159 GaimPluginProtocolInfo *prpl_info = NULL;
160 gboolean remove = FALSE;
160 161
161 g_return_if_fail(gc != NULL); 162 g_return_if_fail(gc != NULL);
162 163
163 account = gaim_connection_get_account(gc); 164 account = gaim_connection_get_account(gc);
164 165
165 gaim_debug_info("connection", "Disconnecting connection %p\n", gc); 166 gaim_debug_info("connection", "Disconnecting connection %p\n", gc);
166 167
167 if (gaim_connection_get_state(gc) != GAIM_CONNECTING) 168 if (gaim_connection_get_state(gc) != GAIM_CONNECTING)
168 gaim_blist_remove_account(account); 169 remove = TRUE;
169 170
170 gaim_signal_emit(gaim_connections_get_handle(), "signing-off", gc); 171 gaim_signal_emit(gaim_connections_get_handle(), "signing-off", gc);
171 172
172 while (gc->buddy_chats) 173 while (gc->buddy_chats)
173 { 174 {
192 } 193 }
193 194
194 connections = g_list_remove(connections, gc); 195 connections = g_list_remove(connections, gc);
195 196
196 gaim_connection_set_state(gc, GAIM_DISCONNECTED); 197 gaim_connection_set_state(gc, GAIM_DISCONNECTED);
198
199 if (remove)
200 gaim_blist_remove_account(account);
197 201
198 /* LOG system_log(log_signoff, gc, NULL, 202 /* LOG system_log(log_signoff, gc, NULL,
199 OPT_LOG_BUDDY_SIGNON | OPT_LOG_MY_SIGNON); */ 203 OPT_LOG_BUDDY_SIGNON | OPT_LOG_MY_SIGNON); */
200 gaim_signal_emit(gaim_connections_get_handle(), "signed-off", gc); 204 gaim_signal_emit(gaim_connections_get_handle(), "signed-off", gc);
201 205