diff src/protocols/msn/msn.c @ 10345:2e01c503aa4f

[gaim-migrate @ 11556] Patch 1078151 from Felipe Contreras to fix some more MSN bugs: "User Dislpay messages, and other less used, did not set an slpcall, so the callback that should not be called, was called (in some very special cases)." ... "Here it goes the real real one, as far as I can tell. Cleaning + organizing + documentation + hard bug fix = big patch." -- Felipe Contreras I also fixed drag-and-drop to conversation window file transfers (which I had broken when I fixed some other dnd thing), made the debug output of the autoreconnect plugin more useful, and stopped the message notification plugin notifying you for messages sent by ignored users. committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Sat, 11 Dec 2004 20:01:58 +0000
parents 56cc5d49472b
children bbf738a0ce7b
line wrap: on
line diff
--- a/src/protocols/msn/msn.c	Sat Dec 11 00:06:06 2004 +0000
+++ b/src/protocols/msn/msn.c	Sat Dec 11 20:01:58 2004 +0000
@@ -757,9 +757,7 @@
 		session = gc->proto_data;
 		swboard = msn_session_get_swboard(session, who);
 
-
-		if (!g_queue_is_empty(swboard->im_queue) ||
-			!swboard->user_joined)
+		if (!g_queue_is_empty(swboard->im_queue) || swboard->empty)
 		{
 			msn_switchboard_queue_msg(swboard, msg);
 		}
@@ -767,7 +765,6 @@
 		{
 			msn_switchboard_send_msg(swboard, msg);
 		}
-
 	}
 	else
 	{
@@ -824,7 +821,7 @@
 	if (swboard == NULL)
 		return 0;
 
-	if (!swboard->user_joined)
+	if (swboard->empty)
 		return 0;
 
 	msg = msn_message_new(MSN_MSG_TYPING);
@@ -834,7 +831,16 @@
 						 gaim_account_get_username(account));
 	msn_message_set_bin_data(msg, "\r\n", 2);
 
-	msn_switchboard_send_msg(swboard, msg);
+	swboard = msn_session_get_swboard(session, who);
+
+	if (!g_queue_is_empty(swboard->im_queue) || swboard->empty)
+	{
+		msn_switchboard_queue_msg(swboard, msg);
+	}
+	else
+	{
+		msn_switchboard_send_msg(swboard, msg);
+	}
 
 	msn_message_destroy(msg);
 
@@ -1155,30 +1161,30 @@
 	if (swboard == NULL)
 		return -EINVAL;
 
-	if (swboard->ready)
-	{
-		msn_import_html(message, &msgformat, &msgtext);
-
-		if (strlen(msgtext) + strlen(msgformat) + strlen(VERSION) > 1564)
-		{
-			g_free(msgformat);
-			g_free(msgtext);
+	if (!swboard->ready)
+		return 0;
 
-			return -E2BIG;
-		}
+	msn_import_html(message, &msgformat, &msgtext);
 
-		msg = msn_message_new_plain(msgtext);
-		msn_message_set_attr(msg, "X-MMS-IM-Format", msgformat);
-		msn_switchboard_send_msg(swboard, msg);
-		msn_message_destroy(msg);
-
+	if (strlen(msgtext) + strlen(msgformat) + strlen(VERSION) > 1564)
+	{
 		g_free(msgformat);
 		g_free(msgtext);
 
-		serv_got_chat_in(gc, id, gaim_account_get_username(account), 0,
-						 message, time(NULL));
+		return -E2BIG;
 	}
 
+	msg = msn_message_new_plain(msgtext);
+	msn_message_set_attr(msg, "X-MMS-IM-Format", msgformat);
+	msn_switchboard_send_msg(swboard, msg);
+	msn_message_destroy(msg);
+
+	g_free(msgformat);
+	g_free(msgtext);
+
+	serv_got_chat_in(gc, id, gaim_account_get_username(account), 0,
+					 message, time(NULL));
+
 	return 0;
 }