Mercurial > pidgin.yaz
comparison libpurple/protocols/oscar/family_icbm.c @ 30832:3eb2dd8a1cc7
Miranda expects a client ack from the other side for channel 2 messages,
so we now send it.
This is based on a patch by Jan Kaluza.
author | ivan.komarov@soc.pidgin.im |
---|---|
date | Thu, 05 Aug 2010 22:45:21 +0000 |
parents | bbb27d65681f |
children | 11c54d781835 |
comparison
equal
deleted
inserted
replaced
30831:be056399ae5f | 30832:3eb2dd8a1cc7 |
---|---|
1600 flap_connection_send_snac(od, conn, SNAC_FAMILY_ICBM, 0x000b, 0x0000, snacid, &bs); | 1600 flap_connection_send_snac(od, conn, SNAC_FAMILY_ICBM, 0x000b, 0x0000, snacid, &bs); |
1601 | 1601 |
1602 byte_stream_destroy(&bs); | 1602 byte_stream_destroy(&bs); |
1603 | 1603 |
1604 return 0; | 1604 return 0; |
1605 } | |
1606 | |
1607 /* | |
1608 * Subtype 0x000b. | |
1609 * Send confirmation for a channel 2 message (Miranda wants it by default). | |
1610 */ | |
1611 void | |
1612 aim_im_send_icq_confirmation(OscarData *od, const char *bn, const guchar *cookie) | |
1613 { | |
1614 ByteStream bs; | |
1615 aim_snacid_t snacid; | |
1616 guint32 header_size, data_size; | |
1617 guint16 cookie2 = (guint16)g_random_int(); | |
1618 | |
1619 purple_debug_misc("oscar", "Sending message ack to %s\n", bn); | |
1620 | |
1621 header_size = 8 + 2 + 1 + strlen(bn) + 2; | |
1622 data_size = 2 + 1 + 16 + 4*2 + 2*3 + 4*3 + 1*2 + 2*3 + 1; | |
1623 byte_stream_new(&bs, header_size + data_size); | |
1624 | |
1625 /* The message header. */ | |
1626 aim_im_puticbm(&bs, cookie, 0x0002, bn); | |
1627 byte_stream_put16(&bs, 0x0003); /* reason */ | |
1628 | |
1629 /* The actual message. */ | |
1630 byte_stream_putle16(&bs, 0x1b); /* subheader #1 length */ | |
1631 byte_stream_put8(&bs, 0x08); /* protocol version */ | |
1632 byte_stream_putcaps(&bs, OSCAR_CAPABILITY_EMPTY); | |
1633 byte_stream_put32(&bs, 0x3); /* client features */ | |
1634 byte_stream_put32(&bs, 0x0004); /* DC type */ | |
1635 byte_stream_put16(&bs, cookie2); /* a cookie, chosen by fair dice roll */ | |
1636 byte_stream_putle16(&bs, 0x0e); /* header #2 len? */ | |
1637 byte_stream_put16(&bs, cookie2); /* the same cookie again */ | |
1638 byte_stream_put32(&bs, 0); /* unknown */ | |
1639 byte_stream_put32(&bs, 0); /* unknown */ | |
1640 byte_stream_put32(&bs, 0); /* unknown */ | |
1641 byte_stream_put8(&bs, 0x01); /* plain text message */ | |
1642 byte_stream_put8(&bs, 0x00); /* no message flags */ | |
1643 byte_stream_put16(&bs, 0x0000); /* no icq status */ | |
1644 byte_stream_put16(&bs, 0x0100); /* priority */ | |
1645 byte_stream_putle16(&bs, 1); /* query message len */ | |
1646 byte_stream_put8(&bs, 0x00); /* empty query message */ | |
1647 | |
1648 snacid = aim_cachesnac(od, SNAC_FAMILY_ICBM, 0x000b, 0x0000, NULL, 0); | |
1649 flap_connection_send_snac(od, flap_connection_findbygroup(od, SNAC_FAMILY_ICBM), SNAC_FAMILY_ICBM, 0x000b, 0x0000, snacid, &bs); | |
1650 byte_stream_destroy(&bs); | |
1605 } | 1651 } |
1606 | 1652 |
1607 /* | 1653 /* |
1608 * Subtype 0x000b - Receive the response from an ICQ status message | 1654 * Subtype 0x000b - Receive the response from an ICQ status message |
1609 * request (in which case this contains the ICQ status message) or | 1655 * request (in which case this contains the ICQ status message) or |