comparison src/protocols/msn/msn.c @ 10533:ace8cd0de6ea

[gaim-migrate @ 11862] Some minor MSN reorganization from Felipe and a bunch of MSN chat related fixes and improvements from me. committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Thu, 20 Jan 2005 16:37:14 +0000
parents 1a97d5e88d12
children fed2a7c2471d
comparison
equal deleted inserted replaced
10532:8f2b74c5aa24 10533:ace8cd0de6ea
1074 msn_chat_invite(GaimConnection *gc, int id, const char *msg, 1074 msn_chat_invite(GaimConnection *gc, int id, const char *msg,
1075 const char *who) 1075 const char *who)
1076 { 1076 {
1077 MsnSession *session; 1077 MsnSession *session;
1078 MsnSwitchBoard *swboard; 1078 MsnSwitchBoard *swboard;
1079 MsnCmdProc *cmdproc;
1080 1079
1081 session = gc->proto_data; 1080 session = gc->proto_data;
1082 1081
1083 swboard = msn_session_find_switch_with_id(session, id); 1082 swboard = msn_session_find_switch_with_id(session, id);
1084 g_return_if_fail(swboard != NULL); 1083
1085 1084 if (swboard == NULL)
1086 cmdproc = swboard->servconn->cmdproc; 1085 {
1087 1086 /* if we have no switchboard, everyone else left the chat already */
1088 msn_cmdproc_send(cmdproc, "CAL", "%s", who); 1087 swboard = msn_switchboard_new(session);
1088 msn_switchboard_request(swboard);
1089 swboard->chat_id = id;
1090 swboard->conv = gaim_find_chat(gc, id);
1091 }
1092
1093 msn_switchboard_request_add_user(swboard, who);
1089 } 1094 }
1090 1095
1091 static void 1096 static void
1092 msn_chat_leave(GaimConnection *gc, int id) 1097 msn_chat_leave(GaimConnection *gc, int id)
1093 { 1098 {
1095 MsnSwitchBoard *swboard; 1100 MsnSwitchBoard *swboard;
1096 1101
1097 session = gc->proto_data; 1102 session = gc->proto_data;
1098 1103
1099 swboard = msn_session_find_switch_with_id(session, id); 1104 swboard = msn_session_find_switch_with_id(session, id);
1100 g_return_if_fail(swboard != NULL); 1105
1106 /* if swboard is NULL we were the only person left anyway */
1107 if (swboard == NULL)
1108 return;
1101 1109
1102 msn_switchboard_close(swboard); 1110 msn_switchboard_close(swboard);
1103
1104 /* serv_got_chat_left(gc, id); */
1105 } 1111 }
1106 1112
1107 static int 1113 static int
1108 msn_chat_send(GaimConnection *gc, int id, const char *message) 1114 msn_chat_send(GaimConnection *gc, int id, const char *message)
1109 { 1115 {