Mercurial > pidgin.yaz
comparison src/protocols/msn/msn.c @ 10773:888d4c328be5
[gaim-migrate @ 12382]
Patch 1149564 from Felipe Contreras:
"[MSN] Cleanups and fixes
I know it fixes a multiple conversation close
notification but it probably fixes more stuff.
I don't know exactly what are the diferences with what
Stu did."
I munged it a bit, to make it compile and stuff.
Please test this, I might have broken it.
committer: Tailor Script <tailor@pidgin.im>
author | Stu Tomlinson <stu@nosnilmot.com> |
---|---|
date | Sat, 02 Apr 2005 16:38:33 +0000 |
parents | 55af3fa46329 |
children | a8e84a45db3e |
comparison
equal
deleted
inserted
replaced
10772:12aa8ce77077 | 10773:888d4c328be5 |
---|---|
336 msn_switchboard_request_add_user(swboard, buddy->name); | 336 msn_switchboard_request_add_user(swboard, buddy->name); |
337 | 337 |
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; | |
341 | 342 |
342 gaim_conv_chat_add_user(GAIM_CONV_CHAT(swboard->conv), | 343 gaim_conv_chat_add_user(GAIM_CONV_CHAT(swboard->conv), |
343 gaim_account_get_username(buddy->account), NULL, GAIM_CBFLAGS_NONE, TRUE); | 344 gaim_account_get_username(buddy->account), NULL, GAIM_CBFLAGS_NONE, TRUE); |
344 } | 345 } |
345 | 346 |
736 { | 737 { |
737 MsnSession *session; | 738 MsnSession *session; |
738 MsnSwitchBoard *swboard; | 739 MsnSwitchBoard *swboard; |
739 | 740 |
740 session = gc->proto_data; | 741 session = gc->proto_data; |
741 swboard = msn_session_get_swboard(session, who); | 742 swboard = msn_session_get_swboard(session, who, MSN_SB_FLAG_IM); |
742 | 743 |
743 msn_switchboard_send_msg(swboard, msg, TRUE); | 744 msn_switchboard_send_msg(swboard, msg, TRUE); |
744 } | 745 } |
745 else | 746 else |
746 { | 747 { |
796 | 797 |
797 swboard = msn_session_find_swboard(session, who); | 798 swboard = msn_session_find_swboard(session, who); |
798 | 799 |
799 if (swboard == NULL || !msn_switchboard_can_send(swboard)) | 800 if (swboard == NULL || !msn_switchboard_can_send(swboard)) |
800 return 0; | 801 return 0; |
802 | |
803 swboard->flag |= MSN_SB_FLAG_IM; | |
801 | 804 |
802 msg = msn_message_new(MSN_MSG_TYPING); | 805 msg = msn_message_new(MSN_MSG_TYPING); |
803 msn_message_set_content_type(msg, "text/x-msmsgscontrol"); | 806 msn_message_set_content_type(msg, "text/x-msmsgscontrol"); |
804 msn_message_set_flag(msg, 'U'); | 807 msn_message_set_flag(msg, 'U'); |
805 msn_message_set_attr(msg, "TypingUser", | 808 msn_message_set_attr(msg, "TypingUser", |
1094 msn_switchboard_request(swboard); | 1097 msn_switchboard_request(swboard); |
1095 swboard->chat_id = id; | 1098 swboard->chat_id = id; |
1096 swboard->conv = gaim_find_chat(gc, id); | 1099 swboard->conv = gaim_find_chat(gc, id); |
1097 } | 1100 } |
1098 | 1101 |
1102 swboard->flag |= MSN_SB_FLAG_IM; | |
1103 | |
1099 msn_switchboard_request_add_user(swboard, who); | 1104 msn_switchboard_request_add_user(swboard, who); |
1100 } | 1105 } |
1101 | 1106 |
1102 static void | 1107 static void |
1103 msn_chat_leave(GaimConnection *gc, int id) | 1108 msn_chat_leave(GaimConnection *gc, int id) |
1114 if (swboard == NULL) | 1119 if (swboard == NULL) |
1115 return; | 1120 return; |
1116 | 1121 |
1117 conv = swboard->conv; | 1122 conv = swboard->conv; |
1118 | 1123 |
1119 msn_switchboard_close(swboard); | 1124 msn_switchboard_release(swboard, MSN_SB_FLAG_IM); |
1120 | 1125 |
1121 /* If other switchboards managed to associate themselves with this | 1126 /* If other switchboards managed to associate themselves with this |
1122 * conv, make sure they know it's gone! */ | 1127 * conv, make sure they know it's gone! */ |
1123 if (conv != NULL) | 1128 if (conv != NULL) |
1124 { | 1129 { |
1144 if (swboard == NULL) | 1149 if (swboard == NULL) |
1145 return -EINVAL; | 1150 return -EINVAL; |
1146 | 1151 |
1147 if (!swboard->ready) | 1152 if (!swboard->ready) |
1148 return 0; | 1153 return 0; |
1154 | |
1155 swboard->flag |= MSN_SB_FLAG_IM; | |
1149 | 1156 |
1150 msn_import_html(message, &msgformat, &msgtext); | 1157 msn_import_html(message, &msgformat, &msgtext); |
1151 | 1158 |
1152 if (strlen(msgtext) + strlen(msgformat) + strlen(VERSION) > 1564) | 1159 if (strlen(msgtext) + strlen(msgformat) + strlen(VERSION) > 1564) |
1153 { | 1160 { |
1246 if (swboard == NULL) | 1253 if (swboard == NULL) |
1247 return; | 1254 return; |
1248 | 1255 |
1249 conv = swboard->conv; | 1256 conv = swboard->conv; |
1250 | 1257 |
1251 if (!(swboard->flag & MSN_SB_FLAG_FT)) | 1258 msn_switchboard_release(swboard, MSN_SB_FLAG_IM); |
1252 msn_switchboard_close(swboard); | |
1253 else | |
1254 swboard->conv = NULL; | |
1255 | 1259 |
1256 /* If other switchboards managed to associate themselves with this | 1260 /* If other switchboards managed to associate themselves with this |
1257 * conv, make sure they know it's gone! */ | 1261 * conv, make sure they know it's gone! */ |
1258 if (conv != NULL) | 1262 if (conv != NULL) |
1259 { | 1263 { |