diff 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
line wrap: on
line diff
--- a/src/protocols/msn/msn.c	Sat Apr 02 16:07:20 2005 +0000
+++ b/src/protocols/msn/msn.c	Sat Apr 02 16:38:33 2005 +0000
@@ -338,6 +338,7 @@
 	/* TODO: This might move somewhere else, after USR might be */
 	swboard->chat_id = session->conv_seq++;
 	swboard->conv = serv_got_joined_chat(gc, swboard->chat_id, "MSN Chat");
+	swboard->flag = MSN_SB_FLAG_IM;
 
 	gaim_conv_chat_add_user(GAIM_CONV_CHAT(swboard->conv),
 							gaim_account_get_username(buddy->account), NULL, GAIM_CBFLAGS_NONE, TRUE);
@@ -738,7 +739,7 @@
 		MsnSwitchBoard *swboard;
 
 		session = gc->proto_data;
-		swboard = msn_session_get_swboard(session, who);
+		swboard = msn_session_get_swboard(session, who, MSN_SB_FLAG_IM);
 
 		msn_switchboard_send_msg(swboard, msg, TRUE);
 	}
@@ -799,6 +800,8 @@
 	if (swboard == NULL || !msn_switchboard_can_send(swboard))
 		return 0;
 
+	swboard->flag |= MSN_SB_FLAG_IM;
+
 	msg = msn_message_new(MSN_MSG_TYPING);
 	msn_message_set_content_type(msg, "text/x-msmsgscontrol");
 	msn_message_set_flag(msg, 'U');
@@ -1096,6 +1099,8 @@
 		swboard->conv = gaim_find_chat(gc, id);
 	}
 
+	swboard->flag |= MSN_SB_FLAG_IM;
+
 	msn_switchboard_request_add_user(swboard, who);
 }
 
@@ -1116,7 +1121,7 @@
 
 	conv = swboard->conv;
 
-	msn_switchboard_close(swboard);
+	msn_switchboard_release(swboard, MSN_SB_FLAG_IM);
 
 	/* If other switchboards managed to associate themselves with this
 	 * conv, make sure they know it's gone! */
@@ -1147,6 +1152,8 @@
 	if (!swboard->ready)
 		return 0;
 
+	swboard->flag |= MSN_SB_FLAG_IM;
+
 	msn_import_html(message, &msgformat, &msgtext);
 
 	if (strlen(msgtext) + strlen(msgformat) + strlen(VERSION) > 1564)
@@ -1248,10 +1255,7 @@
 
 	conv = swboard->conv;
 
-	if (!(swboard->flag & MSN_SB_FLAG_FT))
-		msn_switchboard_close(swboard);
-	else
-		swboard->conv = NULL;
+	msn_switchboard_release(swboard, MSN_SB_FLAG_IM);
 
 	/* If other switchboards managed to associate themselves with this
 	 * conv, make sure they know it's gone! */