From: Stu T. <nos...@us...> - 2004-12-27 18:54:08
|
Update of /cvsroot/gaim/gaim/src/protocols/msn In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3291 Modified Files: servconn.c switchboard.c Log Message: A patch from Felipe to ensure switchboards are destroyed when we disconnect. Index: servconn.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/msn/servconn.c,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -p -r1.43 -r1.44 --- servconn.c 23 Dec 2004 20:13:54 -0000 1.43 +++ servconn.c 27 Dec 2004 18:53:59 -0000 1.44 @@ -191,7 +191,14 @@ void 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) { Index: switchboard.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/msn/switchboard.c,v retrieving revision 1.88 retrieving revision 1.89 diff -u -d -p -r1.88 -r1.89 --- switchboard.c 23 Dec 2004 20:13:54 -0000 1.88 +++ switchboard.c 27 Dec 2004 18:53:59 -0000 1.89 @@ -448,7 +448,7 @@ bye_cmd(MsnCmdProc *cmdproc, MsnCommand 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 @@ bye_cmd(MsnCmdProc *cmdproc, MsnCommand if (str != NULL) msn_switchboard_report_user(swboard, GAIM_MESSAGE_SYSTEM, str); - msn_switchboard_disconnect(swboard); + msn_switchboard_destroy(swboard); } } @@ -920,6 +920,7 @@ msn_switchboard_connect(MsnSwitchBoard * 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 @@ msn_switchboard_disconnect(MsnSwitchBoar { g_return_if_fail(swboard != NULL); - msn_servconn_set_disconnect_cb(swboard->servconn, disconnect_cb); - msn_servconn_disconnect(swboard->servconn); } |