Mon, 27 Dec 2004 18:53:59 +0000
[gaim-migrate @ 11691]
A patch from Felipe to ensure switchboards are destroyed when we disconnect.
committer: Stu Tomlinson <nosnilmot@pidgin.im>
| src/protocols/msn/servconn.c | file | annotate | diff | comparison | revisions | |
| src/protocols/msn/switchboard.c | file | annotate | diff | comparison | revisions |
--- a/src/protocols/msn/servconn.c Mon Dec 27 18:46:42 2004 +0000 +++ b/src/protocols/msn/servconn.c Mon Dec 27 18:53:59 2004 +0000 @@ -191,7 +191,14 @@ msn_servconn_disconnect(MsnServConn *servconn) { g_return_if_fail(servconn != NULL); - g_return_if_fail(servconn->connected); + + if (!servconn->connected) + { + if (servconn->disconnect_cb != NULL) + servconn->disconnect_cb(servconn); + + return; + } if (servconn->inpa > 0) {
--- a/src/protocols/msn/switchboard.c Mon Dec 27 18:46:42 2004 +0000 +++ b/src/protocols/msn/switchboard.c Mon Dec 27 18:53:59 2004 +0000 @@ -448,7 +448,7 @@ if (swboard->conv == NULL) { /* This is a helper switchboard */ - msn_switchboard_disconnect(swboard); + msn_switchboard_destroy(swboard); } else if (swboard->current_users > 1) { @@ -494,7 +494,7 @@ if (str != NULL) msn_switchboard_report_user(swboard, GAIM_MESSAGE_SYSTEM, str); - msn_switchboard_disconnect(swboard); + msn_switchboard_destroy(swboard); } } @@ -920,6 +920,7 @@ g_return_val_if_fail(swboard != NULL, FALSE); msn_servconn_set_connect_cb(swboard->servconn, connect_cb); + msn_servconn_set_disconnect_cb(swboard->servconn, disconnect_cb); return msn_servconn_connect(swboard->servconn, host, port); } @@ -929,8 +930,6 @@ { g_return_if_fail(swboard != NULL); - msn_servconn_set_disconnect_cb(swboard->servconn, disconnect_cb); - msn_servconn_disconnect(swboard->servconn); }