|
Lines 338-344
initiate_chat_cb(GaimBlistNode *node, gp
Link Here
|
| 338 |
/* TODO: This might move somewhere else, after USR might be */ |
338 |
/* TODO: This might move somewhere else, after USR might be */ |
| 339 |
swboard->chat_id = session->conv_seq++; |
339 |
swboard->chat_id = session->conv_seq++; |
| 340 |
swboard->conv = serv_got_joined_chat(gc, swboard->chat_id, "MSN Chat"); |
340 |
swboard->conv = serv_got_joined_chat(gc, swboard->chat_id, "MSN Chat"); |
| 341 |
swboard->flag = MSN_SB_FLAG_IM; |
|
|
| 342 |
gaim_conv_chat_add_user(GAIM_CONV_CHAT(swboard->conv), |
341 |
gaim_conv_chat_add_user(GAIM_CONV_CHAT(swboard->conv), |
| 343 |
gaim_account_get_username(buddy->account), NULL, GAIM_CBFLAGS_NONE, |
342 |
gaim_account_get_username(buddy->account), NULL, GAIM_CBFLAGS_NONE, |
|
|
343 |
TRUE); |
|
Lines 697-703
msn_send_im(GaimConnection *gc, const ch
Link Here
|
| 697 |
MsnSwitchBoard *swboard; |
696 |
MsnSwitchBoard *swboard; |
| 698 |
session = gc->proto_data; |
697 |
session = gc->proto_data; |
| 699 |
swboard = msn_session_get_swboard(session, who, MSN_SB_FLAG_IM); |
698 |
swboard = msn_session_get_swboard(session, who); |
| 700 |
msn_switchboard_send_msg(swboard, msg, TRUE); |
699 |
msn_switchboard_send_msg(swboard, msg, TRUE); |
| 701 |
} |
700 |
} |
|
Lines 753-759
msn_send_typing(GaimConnection *gc, cons
Link Here
|
| 753 |
return MSN_TYPING_SEND_TIMEOUT; |
752 |
return MSN_TYPING_SEND_TIMEOUT; |
| 754 |
} |
753 |
} |
| 755 |
swboard = msn_session_find_swboard(session, who, MSN_SB_FLAG_IM); |
754 |
swboard = msn_session_find_swboard(session, who); |
| 756 |
if (swboard == NULL || !msn_switchboard_can_send(swboard)) |
755 |
if (swboard == NULL || !msn_switchboard_can_send(swboard)) |
| 757 |
return 0; |
756 |
return 0; |
|
Lines 1056-1062
msn_chat_invite(GaimConnection *gc, int
Link Here
|
| 1056 |
session = gc->proto_data; |
1055 |
session = gc->proto_data; |
| 1057 |
swboard = msn_session_find_swboard_with_id(session, id, MSN_SB_FLAG_IM); |
1056 |
swboard = msn_session_find_swboard_with_id(session, id); |
| 1058 |
if (swboard == NULL) |
1057 |
if (swboard == NULL) |
| 1059 |
{ |
1058 |
{ |
|
Lines 1065-1071
msn_chat_invite(GaimConnection *gc, int
Link Here
|
| 1065 |
msn_switchboard_request(swboard); |
1064 |
msn_switchboard_request(swboard); |
| 1066 |
swboard->chat_id = id; |
1065 |
swboard->chat_id = id; |
| 1067 |
swboard->conv = gaim_find_chat(gc, id); |
1066 |
swboard->conv = gaim_find_chat(gc, id); |
| 1068 |
swboard->flag = MSN_SB_FLAG_IM; |
|
|
| 1069 |
} |
1067 |
} |
| 1070 |
msn_switchboard_request_add_user(swboard, who); |
1068 |
msn_switchboard_request_add_user(swboard, who); |
|
Lines 1076-1091
msn_chat_leave(GaimConnection *gc, int i
Link Here
|
| 1076 |
{ |
1074 |
{ |
| 1077 |
MsnSession *session; |
1075 |
MsnSession *session; |
| 1078 |
MsnSwitchBoard *swboard; |
1076 |
MsnSwitchBoard *swboard; |
|
|
1077 |
GaimConversation *conv; |
| 1079 |
session = gc->proto_data; |
1078 |
session = gc->proto_data; |
| 1080 |
swboard = msn_session_find_swboard_with_id(session, id, MSN_SB_FLAG_IM); |
1079 |
swboard = msn_session_find_swboard_with_id(session, id); |
| 1081 |
/* if swboard is NULL we were the only person left anyway */ |
1080 |
/* if swboard is NULL we were the only person left anyway */ |
| 1082 |
if (swboard == NULL) |
1081 |
if (swboard == NULL) |
| 1083 |
return; |
1082 |
return; |
|
|
1083 |
conv = swboard->conv; |
| 1084 |
|
| 1084 |
msn_switchboard_close(swboard); |
1085 |
msn_switchboard_close(swboard); |
|
|
1086 |
|
| 1087 |
/* If other switchboards managed to associate themselves with this |
| 1088 |
* conv, make sure they know it's gone! */ |
| 1089 |
if (conv != NULL) |
| 1090 |
{ |
| 1091 |
while ((swboard = msn_session_find_swboard_with_conv(session, conv)) != NULL) |
| 1092 |
swboard->conv = NULL; |
| 1093 |
} |
| 1085 |
} |
1094 |
} |
| 1086 |
static int |
1095 |
static int |
|
Lines 1100-1106
msn_chat_send(GaimConnection *gc, int id
Link Here
|
| 1100 |
account = gaim_connection_get_account(gc); |
1109 |
account = gaim_connection_get_account(gc); |
| 1101 |
session = gc->proto_data; |
1110 |
session = gc->proto_data; |
| 1102 |
swboard = msn_session_find_swboard_with_id(session, id, MSN_SB_FLAG_IM); |
1111 |
swboard = msn_session_find_swboard_with_id(session, id); |
| 1103 |
if (swboard == NULL) |
1112 |
if (swboard == NULL) |
| 1104 |
return -EINVAL; |
1113 |
return -EINVAL; |
|
Lines 1193-1202
msn_convo_closed(GaimConnection *gc, con
Link Here
|
| 1193 |
{ |
1202 |
{ |
| 1194 |
MsnSession *session; |
1203 |
MsnSession *session; |
| 1195 |
MsnSwitchBoard *swboard; |
1204 |
MsnSwitchBoard *swboard; |
|
|
1205 |
GaimConversation *conv; |
| 1196 |
session = gc->proto_data; |
1206 |
session = gc->proto_data; |
| 1197 |
swboard = msn_session_find_swboard(session, who, MSN_SB_FLAG_IM); |
1207 |
swboard = msn_session_find_swboard(session, who); |
| 1198 |
/* |
1208 |
/* |
| 1199 |
* Don't perform an assertion here. If swboard is NULL, then the |
1209 |
* Don't perform an assertion here. If swboard is NULL, then the |
|
Lines 1206-1215
msn_convo_closed(GaimConnection *gc, con
Link Here
|
| 1206 |
if (swboard == NULL) |
1216 |
if (swboard == NULL) |
| 1207 |
return; |
1217 |
return; |
|
|
1218 |
conv = swboard->conv; |
| 1219 |
|
| 1208 |
if (!(swboard->flag & MSN_SB_FLAG_FT)) |
1220 |
if (!(swboard->flag & MSN_SB_FLAG_FT)) |
| 1209 |
msn_switchboard_close(swboard); |
1221 |
msn_switchboard_close(swboard); |
| 1210 |
else |
1222 |
else |
| 1211 |
swboard->conv = NULL; |
1223 |
swboard->conv = NULL; |
|
|
1224 |
|
| 1225 |
/* If other switchboards managed to associate themselves with this |
| 1226 |
* conv, make sure they know it's gone! */ |
| 1227 |
if (conv != NULL) |
| 1228 |
{ |
| 1229 |
while ((swboard = msn_session_find_swboard_with_conv(session, conv)) != NULL) |
| 1230 |
swboard->conv = NULL; |
| 1231 |
} |
| 1212 |
} |
1232 |
} |
| 1213 |
static void |
1233 |
static void |