changeset 24451:82452077f0db

Don't request an acknowledgement on an auto-response message and don't set a timeout to say that it was never received. Fixes #6604.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sun, 23 Nov 2008 22:40:18 +0000
parents dc7942955a7a
children 6ae245788b85
files libpurple/protocols/msn/msn.c libpurple/protocols/msn/switchboard.c
diffstat 2 files changed, 26 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/msn.c	Sun Nov 23 22:29:41 2008 +0000
+++ b/libpurple/protocols/msn/msn.c	Sun Nov 23 22:40:18 2008 +0000
@@ -1196,6 +1196,9 @@
 		purple_debug_info("msn", "prepare to send online Message\n");
 		if (g_ascii_strcasecmp(who, username))
 		{
+			if (flags & PURPLE_MESSAGE_AUTO_RESP) {
+				msn_message_set_flag(msg, 'U');
+			}
 			if (msn_user_is_yahoo(account, who)) {
 				/*we send the online and offline Message to Yahoo User via UBM*/
 				purple_debug_info("msn", "send to Yahoo User\n");
--- a/libpurple/protocols/msn/switchboard.c	Sun Nov 23 22:29:41 2008 +0000
+++ b/libpurple/protocols/msn/switchboard.c	Sun Nov 23 22:40:18 2008 +0000
@@ -577,6 +577,7 @@
 	MsnTransaction *trans;
 	char *payload;
 	gsize payload_len;
+	char flag;
 
 	g_return_if_fail(swboard != NULL);
 	g_return_if_fail(msg     != NULL);
@@ -590,32 +591,35 @@
 	msn_message_show_readable(msg, "SB SEND", FALSE);
 #endif
 
+	flag = msn_message_get_flag(msg);
 	trans = msn_transaction_new(cmdproc, "MSG", "%c %" G_GSIZE_FORMAT,
-								msn_message_get_flag(msg), payload_len);
+								flag, payload_len);
 
 	/* Data for callbacks */
 	msn_transaction_set_data(trans, msg);
 
-	if (msg->type == MSN_MSG_TEXT)
-	{
-		msg->ack_ref = TRUE;
-		msn_message_ref(msg);
-		swboard->ack_list = g_list_append(swboard->ack_list, msg);
-		msn_transaction_set_timeout_cb(trans, msg_timeout);
-	}
-	else if (msg->type == MSN_MSG_SLP)
-	{
-		msg->ack_ref = TRUE;
-		msn_message_ref(msg);
-		swboard->ack_list = g_list_append(swboard->ack_list, msg);
-		msn_transaction_set_timeout_cb(trans, msg_timeout);
+	if (flag != 'U') {
+		if (msg->type == MSN_MSG_TEXT)
+		{
+			msg->ack_ref = TRUE;
+			msn_message_ref(msg);
+			swboard->ack_list = g_list_append(swboard->ack_list, msg);
+			msn_transaction_set_timeout_cb(trans, msg_timeout);
+		}
+		else if (msg->type == MSN_MSG_SLP)
+		{
+			msg->ack_ref = TRUE;
+			msn_message_ref(msg);
+			swboard->ack_list = g_list_append(swboard->ack_list, msg);
+			msn_transaction_set_timeout_cb(trans, msg_timeout);
 #if 0
-		if (msg->ack_cb != NULL)
-		{
-			msn_transaction_add_cb(trans, "ACK", msg_ack);
-			msn_transaction_add_cb(trans, "NAK", msg_nak);
+			if (msg->ack_cb != NULL)
+			{
+				msn_transaction_add_cb(trans, "ACK", msg_ack);
+				msn_transaction_add_cb(trans, "NAK", msg_nak);
+			}
+#endif
 		}
-#endif
 	}
 
 	trans->payload = payload;