comparison src/protocols/msn/switchboard.c @ 19791:bddd32f36bde

[gaim-migrate @ 16653] a version can show the windows Live ID's Info correctly ready to send the oim,need to check committed by Ma Yuan<mayuan2006@gmail.com> committer: Ethan Blanton <elb@pidgin.im>
author Ma Yuan <mayuan2006@gmail.com>
date Sun, 06 Aug 2006 15:16:46 +0000
parents 967ef719cb62
children da3f8f7ec3ce
comparison
equal deleted inserted replaced
19790:4f21c73a0c48 19791:bddd32f36bde
26 #include "switchboard.h" 26 #include "switchboard.h"
27 #include "notification.h" 27 #include "notification.h"
28 #include "msn-utils.h" 28 #include "msn-utils.h"
29 29
30 #include "error.h" 30 #include "error.h"
31
32 #define MSN_DEBUG_SB
31 33
32 static MsnTable *cbs_table; 34 static MsnTable *cbs_table;
33 35
34 static void msg_error_helper(MsnCmdProc *cmdproc, MsnMessage *msg, 36 static void msg_error_helper(MsnCmdProc *cmdproc, MsnMessage *msg,
35 MsnMsgErrorType error); 37 MsnMsgErrorType error);
613 gboolean queue) 615 gboolean queue)
614 { 616 {
615 g_return_if_fail(swboard != NULL); 617 g_return_if_fail(swboard != NULL);
616 g_return_if_fail(msg != NULL); 618 g_return_if_fail(msg != NULL);
617 619
620 gaim_debug_info("Ma Yuan","switchboard send msg..\n");
618 if (msn_switchboard_can_send(swboard)) 621 if (msn_switchboard_can_send(swboard))
619 release_msg(swboard, msg); 622 release_msg(swboard, msg);
620 else if (queue) 623 else if (queue)
621 queue_msg(swboard, msg); 624 queue_msg(swboard, msg);
622 } 625 }
1049 1052
1050 static void 1053 static void
1051 cal_error(MsnCmdProc *cmdproc, MsnTransaction *trans, int error) 1054 cal_error(MsnCmdProc *cmdproc, MsnTransaction *trans, int error)
1052 { 1055 {
1053 int reason = MSN_SB_ERROR_UNKNOWN; 1056 int reason = MSN_SB_ERROR_UNKNOWN;
1057 MsnMessage *msg;
1058 MsnSwitchBoard *swboard = trans->data;
1054 1059
1055 if (error == 215) 1060 if (error == 215)
1056 { 1061 {
1057 gaim_debug_info("msn", "Invited user already in switchboard\n"); 1062 gaim_debug_info("msn", "Invited user already in switchboard\n");
1058 return; 1063 return;
1061 { 1066 {
1062 reason = MSN_SB_ERROR_USER_OFFLINE; 1067 reason = MSN_SB_ERROR_USER_OFFLINE;
1063 } 1068 }
1064 1069
1065 gaim_debug_warning("msn", "cal_error: command %s gave error %i\n", trans->command, error); 1070 gaim_debug_warning("msn", "cal_error: command %s gave error %i\n", trans->command, error);
1066 1071 gaim_debug_warning("msn", "Will Use Offline Message to sendit\n");
1072
1073 // cal_error_helper(trans, reason);
1074 /*offline Message send Process*/
1075
1076 while ((msg = g_queue_pop_head(swboard->msg_queue)) != NULL){
1077 gaim_debug_warning("Ma Yuan","offline msg to send:{%s}\n",msg->body);
1078 /* The messages could not be sent due to a switchboard error */
1079 swboard->error = MSN_SB_ERROR_USER_OFFLINE;
1080 msg_error_helper(swboard->cmdproc, msg,
1081 MSN_MSG_ERROR_SB);
1082 msn_message_unref(msg);
1083 }
1067 cal_error_helper(trans, reason); 1084 cal_error_helper(trans, reason);
1068 } 1085 }
1069 1086
1070 void 1087 void
1071 msn_switchboard_request_add_user(MsnSwitchBoard *swboard, const char *user) 1088 msn_switchboard_request_add_user(MsnSwitchBoard *swboard, const char *user)