Mercurial > pidgin.yaz
comparison src/protocols/msn/switchboard.c @ 10434:6be6da69d603
[gaim-migrate @ 11691]
A patch from Felipe to ensure switchboards are destroyed when we disconnect.
committer: Tailor Script <tailor@pidgin.im>
author | Stu Tomlinson <stu@nosnilmot.com> |
---|---|
date | Mon, 27 Dec 2004 18:53:59 +0000 |
parents | e5455f1dc9b6 |
children | 92d4a25fd33c |
comparison
equal
deleted
inserted
replaced
10433:f7f06cb69d5e | 10434:6be6da69d603 |
---|---|
446 user = cmd->params[0]; | 446 user = cmd->params[0]; |
447 | 447 |
448 if (swboard->conv == NULL) | 448 if (swboard->conv == NULL) |
449 { | 449 { |
450 /* This is a helper switchboard */ | 450 /* This is a helper switchboard */ |
451 msn_switchboard_disconnect(swboard); | 451 msn_switchboard_destroy(swboard); |
452 } | 452 } |
453 else if (swboard->current_users > 1) | 453 else if (swboard->current_users > 1) |
454 { | 454 { |
455 /* This is a switchboard used for a chat */ | 455 /* This is a switchboard used for a chat */ |
456 gaim_conv_chat_remove_user(GAIM_CONV_CHAT(swboard->conv), user, NULL); | 456 gaim_conv_chat_remove_user(GAIM_CONV_CHAT(swboard->conv), user, NULL); |
492 } | 492 } |
493 | 493 |
494 if (str != NULL) | 494 if (str != NULL) |
495 msn_switchboard_report_user(swboard, GAIM_MESSAGE_SYSTEM, str); | 495 msn_switchboard_report_user(swboard, GAIM_MESSAGE_SYSTEM, str); |
496 | 496 |
497 msn_switchboard_disconnect(swboard); | 497 msn_switchboard_destroy(swboard); |
498 } | 498 } |
499 } | 499 } |
500 | 500 |
501 static void | 501 static void |
502 iro_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) | 502 iro_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) |
918 msn_switchboard_connect(MsnSwitchBoard *swboard, const char *host, int port) | 918 msn_switchboard_connect(MsnSwitchBoard *swboard, const char *host, int port) |
919 { | 919 { |
920 g_return_val_if_fail(swboard != NULL, FALSE); | 920 g_return_val_if_fail(swboard != NULL, FALSE); |
921 | 921 |
922 msn_servconn_set_connect_cb(swboard->servconn, connect_cb); | 922 msn_servconn_set_connect_cb(swboard->servconn, connect_cb); |
923 msn_servconn_set_disconnect_cb(swboard->servconn, disconnect_cb); | |
923 | 924 |
924 return msn_servconn_connect(swboard->servconn, host, port); | 925 return msn_servconn_connect(swboard->servconn, host, port); |
925 } | 926 } |
926 | 927 |
927 void | 928 void |
928 msn_switchboard_disconnect(MsnSwitchBoard *swboard) | 929 msn_switchboard_disconnect(MsnSwitchBoard *swboard) |
929 { | 930 { |
930 g_return_if_fail(swboard != NULL); | 931 g_return_if_fail(swboard != NULL); |
931 | |
932 msn_servconn_set_disconnect_cb(swboard->servconn, disconnect_cb); | |
933 | 932 |
934 msn_servconn_disconnect(swboard->servconn); | 933 msn_servconn_disconnect(swboard->servconn); |
935 } | 934 } |
936 | 935 |
937 /************************************************************************** | 936 /************************************************************************** |