Mercurial > pidgin.yaz
comparison src/connection.c @ 6018:d4caf585f6ff
[gaim-migrate @ 6468]
Nizathan: I'm reverting your connection.c changes that were supposed to
fix jabber (at least, I hope so).
It was causing aim to crash on signon because do_away_menu() was getting
called when the aim gc existed, but was signed offline (and the aim away
menu thing looks at gc->data, which has already been freed by this point).
You should talk to Christian if you have any questions, because I don't
really know what's going on :-)
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Fri, 04 Jul 2003 21:29:55 +0000 |
parents | 9ab75d4fafac |
children | 38999b6b1838 |
comparison
equal
deleted
inserted
replaced
6017:968a00c9f230 | 6018:d4caf585f6ff |
---|---|
48 gc->prpl = gaim_find_prpl(gaim_account_get_protocol(account)); | 48 gc->prpl = gaim_find_prpl(gaim_account_get_protocol(account)); |
49 | 49 |
50 gaim_connection_set_account(gc, account); | 50 gaim_connection_set_account(gc, account); |
51 gaim_account_set_connection(account, gc); | 51 gaim_account_set_connection(account, gc); |
52 | 52 |
53 connections = g_list_append(connections, gc); | |
54 | |
55 return gc; | 53 return gc; |
56 } | 54 } |
57 | 55 |
58 void | 56 void |
59 gaim_connection_destroy(GaimConnection *gc) | 57 gaim_connection_destroy(GaimConnection *gc) |
68 return; | 66 return; |
69 } | 67 } |
70 | 68 |
71 gaim_debug(GAIM_DEBUG_INFO, "connection", | 69 gaim_debug(GAIM_DEBUG_INFO, "connection", |
72 "Destroying connection %p\n", gc); | 70 "Destroying connection %p\n", gc); |
73 | |
74 connections = g_list_remove(connections, gc); | |
75 | 71 |
76 account = gaim_connection_get_account(gc); | 72 account = gaim_connection_get_account(gc); |
77 gaim_account_set_connection(account, NULL); | 73 gaim_account_set_connection(account, NULL); |
78 | 74 |
79 if (gc->display_name != NULL) | 75 if (gc->display_name != NULL) |
120 | 116 |
121 gaim_connection_set_state(gc, GAIM_CONNECTING); | 117 gaim_connection_set_state(gc, GAIM_CONNECTING); |
122 | 118 |
123 gaim_debug(GAIM_DEBUG_INFO, "connection", "Calling serv_login\n"); | 119 gaim_debug(GAIM_DEBUG_INFO, "connection", "Calling serv_login\n"); |
124 | 120 |
121 connections = g_list_append(connections, gc); | |
122 | |
125 serv_login(account); | 123 serv_login(account); |
126 } | 124 } |
127 | 125 |
128 void | 126 void |
129 gaim_connection_disconnect(GaimConnection *gc) | 127 gaim_connection_disconnect(GaimConnection *gc) |
146 if (gaim_connection_get_state(gc) != GAIM_DISCONNECTED) { | 144 if (gaim_connection_get_state(gc) != GAIM_DISCONNECTED) { |
147 if (gaim_connection_get_state(gc) != GAIM_CONNECTING) | 145 if (gaim_connection_get_state(gc) != GAIM_CONNECTING) |
148 gaim_blist_remove_account(gaim_connection_get_account(gc)); | 146 gaim_blist_remove_account(gaim_connection_get_account(gc)); |
149 | 147 |
150 serv_close(gc); | 148 serv_close(gc); |
149 | |
150 connections = g_list_remove(connections, gc); | |
151 | 151 |
152 gaim_connection_set_state(gc, GAIM_DISCONNECTED); | 152 gaim_connection_set_state(gc, GAIM_DISCONNECTED); |
153 | 153 |
154 gaim_event_broadcast(event_signoff, gc); | 154 gaim_event_broadcast(event_signoff, gc); |
155 system_log(log_signoff, gc, NULL, | 155 system_log(log_signoff, gc, NULL, |
346 | 346 |
347 if (ops != NULL && ops->notice != NULL) | 347 if (ops != NULL && ops->notice != NULL) |
348 ops->notice(gc, text); | 348 ops->notice(gc, text); |
349 } | 349 } |
350 | 350 |
351 static gboolean disconnect_conn_cb(gpointer data) | |
352 { | |
353 GaimAccount *account = (GaimAccount *)data; | |
354 GaimConnection *gc; | |
355 | |
356 gc = gaim_account_get_connection(account); | |
357 | |
358 if (gc != NULL) | |
359 gaim_connection_disconnect(data); | |
360 | |
361 return FALSE; | |
362 } | |
363 | |
364 void | 351 void |
365 gaim_connection_error(GaimConnection *gc, const char *text) | 352 gaim_connection_error(GaimConnection *gc, const char *text) |
366 { | 353 { |
367 GaimConnectionUiOps *ops; | 354 GaimConnectionUiOps *ops; |
368 | 355 |
372 ops = gaim_get_connection_ui_ops(); | 359 ops = gaim_get_connection_ui_ops(); |
373 | 360 |
374 if (ops != NULL && ops->disconnected != NULL) | 361 if (ops != NULL && ops->disconnected != NULL) |
375 ops->disconnected(gc, text); | 362 ops->disconnected(gc, text); |
376 | 363 |
377 g_timeout_add(0, disconnect_conn_cb, gaim_connection_get_account(gc)); | 364 gaim_connection_disconnect(gc); |
378 } | 365 } |
379 | 366 |
380 void | 367 void |
381 gaim_connections_disconnect_all(void) | 368 gaim_connections_disconnect_all(void) |
382 { | 369 { |