comparison libpurple/protocols/msn/switchboard.c @ 31791:6ce4f2272abc

Fix a crash when the account is disconnected and we have requested a SB. (Hanzz, ported by shlomif)(Fixes #12431)
author masca@cpw.pidgin.im
date Sun, 14 Aug 2011 19:04:59 +0000
parents 79ae7200a11a
children 22cb8c11bba8
comparison
equal deleted inserted replaced
31790:edd063ee1016 31791:6ce4f2272abc
419 { 419 {
420 MsnSwitchBoard *swboard = data; 420 MsnSwitchBoard *swboard = data;
421 421
422 purple_debug_info("msn", "unqueuing unsent message to %s\n", swboard->im_user); 422 purple_debug_info("msn", "unqueuing unsent message to %s\n", swboard->im_user);
423 423
424 msn_switchboard_request(swboard); 424 if (msn_switchboard_request(swboard)) {
425 msn_switchboard_request_add_user(swboard, swboard->im_user); 425 msn_switchboard_request_add_user(swboard, swboard->im_user);
426 swboard->reconn_timeout_h = 0; 426 swboard->reconn_timeout_h = 0;
427 }
427 return FALSE; 428 return FALSE;
428 } 429 }
429 430
430 void 431 void
431 msg_error_helper(MsnCmdProc *cmdproc, MsnMessage *msg, MsnMsgErrorType error) 432 msg_error_helper(MsnCmdProc *cmdproc, MsnMessage *msg, MsnMsgErrorType error)
1076 (trans->command ? trans->command : "(null)"), reason); 1077 (trans->command ? trans->command : "(null)"), reason);
1077 1078
1078 swboard_error_helper(swboard, reason, swboard->im_user); 1079 swboard_error_helper(swboard, reason, swboard->im_user);
1079 } 1080 }
1080 1081
1081 void 1082 gboolean
1082 msn_switchboard_request(MsnSwitchBoard *swboard) 1083 msn_switchboard_request(MsnSwitchBoard *swboard)
1083 { 1084 {
1084 MsnCmdProc *cmdproc; 1085 MsnCmdProc *cmdproc;
1085 MsnTransaction *trans; 1086 MsnTransaction *trans;
1086 1087
1092 msn_transaction_add_cb(trans, "XFR", got_swboard); 1093 msn_transaction_add_cb(trans, "XFR", got_swboard);
1093 1094
1094 msn_transaction_set_data(trans, swboard); 1095 msn_transaction_set_data(trans, swboard);
1095 msn_transaction_set_error_cb(trans, xfr_error); 1096 msn_transaction_set_error_cb(trans, xfr_error);
1096 1097
1097 msn_cmdproc_send_trans(cmdproc, trans); 1098 return msn_cmdproc_send_trans(cmdproc, trans);
1098 } 1099 }
1099 1100
1100 void 1101 void
1101 msn_switchboard_close(MsnSwitchBoard *swboard) 1102 msn_switchboard_close(MsnSwitchBoard *swboard)
1102 { 1103 {