diff options
author | John Bailey <rekkanoryo@rekkanoryo.org> | 2009-06-19 21:13:44 +0000 |
---|---|---|
committer | John Bailey <rekkanoryo@rekkanoryo.org> | 2009-06-19 21:13:44 +0000 |
commit | 46159248b7f7673fd04160f5122a24280f3c204a (patch) | |
tree | c8d85bef77dd7f040fcb3d110b61e2d3f89512d7 | |
parent | 2694769a5a2a1a006525a17f35d3ccd81f0cc4fc (diff) | |
download | pidgin-46159248b7f7673fd04160f5122a24280f3c204a.tar.gz |
Backport and apply Mark's changes in c586c7c63e038d187f56cc31c55b1e09dec584d2.
-rw-r--r-- | libpurple/protocols/yahoo/yahoo.c | 26 | ||||
-rw-r--r-- | libpurple/protocols/yahoo/yahoo_packet.h | 1 |
2 files changed, 27 insertions, 0 deletions
diff --git a/libpurple/protocols/yahoo/yahoo.c b/libpurple/protocols/yahoo/yahoo.c index f8388e37d6..e889e2e2e5 100644 --- a/libpurple/protocols/yahoo/yahoo.c +++ b/libpurple/protocols/yahoo/yahoo.c @@ -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(PurpleConnection *gc, struct yahoo_packet *pkt { 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(PurpleConnection *gc, struct yahoo_packet *pkt 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 diff --git a/libpurple/protocols/yahoo/yahoo_packet.h b/libpurple/protocols/yahoo/yahoo_packet.h index b0cbc51d0d..d73ada6f7a 100644 --- a/libpurple/protocols/yahoo/yahoo_packet.h +++ b/libpurple/protocols/yahoo/yahoo_packet.h @@ -102,6 +102,7 @@ enum yahoo_service { /* these are easier to see in hex */ 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, |