From: Stu T. <nos...@us...> - 2004-12-27 18:53:59
|
Update of /cvsroot/gaim/gaim/src/protocols/msn In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3139 Modified Files: Tag: oldstatus 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.40.2.3 retrieving revision 1.40.2.4 diff -u -d -p -r1.40.2.3 -r1.40.2.4 --- servconn.c 23 Dec 2004 20:13:38 -0000 1.40.2.3 +++ servconn.c 27 Dec 2004 18:53:50 -0000 1.40.2.4 @@ -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.76.2.11 retrieving revision 1.76.2.12 diff -u -d -p -r1.76.2.11 -r1.76.2.12 --- switchboard.c 23 Dec 2004 20:13:38 -0000 1.76.2.11 +++ switchboard.c 27 Dec 2004 18:53:50 -0000 1.76.2.12 @@ -444,7 +444,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) { @@ -490,7 +490,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); } } @@ -916,6 +916,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); } @@ -925,8 +926,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); } |