pidgin.2.5.7: 04a542b9: Backport and apply Mark's changes in c5...

rekkanoryo at pidgin.im rekkanoryo at pidgin.im
Fri Jun 19 17:40:31 EDT 2009


-----------------------------------------------------------------
Revision: 04a542b938adc6879d8f59411563418e58cf2071
Ancestor: fccaf2332ee694d9be818a7ca0e79f0d7ccde977
Author: rekkanoryo at pidgin.im
Date: 2009-06-19T21:13:44
Branch: im.pidgin.pidgin.2.5.7
URL: http://d.pidgin.im/viewmtn/revision/info/04a542b938adc6879d8f59411563418e58cf2071

Modified files:
        libpurple/protocols/yahoo/yahoo.c
        libpurple/protocols/yahoo/yahoo_packet.h

ChangeLog: 

Backport and apply  Mark's changes in c586c7c63e038d187f56cc31c55b1e09dec584d2.

-------------- next part --------------
============================================================
--- libpurple/protocols/yahoo/yahoo.c	9ab3586a680a0d70ab0d0bfdf49c244fab4f664a
+++ libpurple/protocols/yahoo/yahoo.c	fb99edd98a8d003a621cf404c01daa64216d623a
@@ -748,6 +748,7 @@ struct _yahoo_im {
 	int time;
 	int utf8;
 	int buddy_icon;
+	char *id;
 	char *msg;
 };
 
@@ -790,6 +791,9 @@ static void yahoo_process_message(Purple
 			{
 				imv = pair->value;
 			}
+			if (pair->key == 429)
+				if (im)
+					im->id = pair->value;
 			l = l->next;
 		}
 	} else if (pkt->status == 2) {
@@ -845,6 +849,28 @@ static void yahoo_process_message(Purple
 			return;
 		}
 
+		/*
+		 * TODO: Is there anything else we should check when determining whether
+		 *       we should send an acknowledgement?
+		 */
+		if (im->id != NULL) {
+			/* Send acknowledgement.  If we don't do this then the official
+			 * Yahoo Messenger client for Windows will send us the same
+			 * message 7 seconds later as an offline message.  This is true
+			 * for at least version 9.0.0.2162 on Windows XP. */
+			struct yahoo_packet *pkt2;
+			pkt2 = yahoo_packet_new(YAHOO_SERVICE_MESSAGE_ACK,
+					YAHOO_STATUS_AVAILABLE, pkt->id);
+			yahoo_packet_hash(pkt2, "ssisii",
+					1, purple_connection_get_display_name(gc),
+					5, im->from,
+					302, 430,
+					430, im->id,
+					303, 430,
+					450, 0);
+			yahoo_packet_send_and_free(pkt2, yd);
+		}
+
 		m = yahoo_string_decode(gc, im->msg, im->utf8);
 		/* This may actually not be necessary, but it appears
 		 * that at least at one point some clients were sending
============================================================
--- libpurple/protocols/yahoo/yahoo_packet.h	60efa55ccc9f1fa4f439f1695d30ca976b1e8f1e
+++ libpurple/protocols/yahoo/yahoo_packet.h	8042ad71afab6c69f73b6d1a4d7ad2012871fa80
@@ -102,6 +102,7 @@ enum yahoo_service { /* these are easier
 	YAHOO_SERVICE_CHGRP_15 = 0xe7,
 	YAHOO_SERVICE_STATUS_15 = 0xf0,
 	YAHOO_SERVICE_LIST_15 = 0xf1,
+	YAHOO_SERVICE_MESSAGE_ACK = 0xfb,
 	YAHOO_SERVICE_FILETRANS_15 = 0xdc,
 	YAHOO_SERVICE_FILETRANS_INFO_15 = 0xdd,
 	YAHOO_SERVICE_FILETRANS_ACC_15 = 0xde,


More information about the Commits mailing list