Mercurial > pidgin.yaz
comparison libpurple/protocols/oscar/family_icbm.c @ 28588:8d5380556f12
Rename two variables based on insight from
http://dev.aol.com/aim/oscar/#ICBM__CLIENT_EVENT
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sun, 06 Sep 2009 21:16:57 +0000 |
parents | 98c5109a3d1f |
children | 493f48f8d17f 28d73d34d792 |
comparison
equal
deleted
inserted
replaced
28587:98c5109a3d1f | 28588:8d5380556f12 |
---|---|
2712 * | 2712 * |
2713 * This is supported by winaim5 and newer, MacAIM bleh and newer, iChat bleh and newer, | 2713 * This is supported by winaim5 and newer, MacAIM bleh and newer, iChat bleh and newer, |
2714 * and Purple 0.60 and newer. | 2714 * and Purple 0.60 and newer. |
2715 * | 2715 * |
2716 */ | 2716 */ |
2717 int aim_im_sendmtn(OscarData *od, guint16 type1, const char *bn, guint16 type2) | 2717 int aim_im_sendmtn(OscarData *od, guint16 channel, const char *bn, guint16 event) |
2718 { | 2718 { |
2719 FlapConnection *conn; | 2719 FlapConnection *conn; |
2720 ByteStream bs; | 2720 ByteStream bs; |
2721 aim_snacid_t snacid; | 2721 aim_snacid_t snacid; |
2722 | 2722 |
2728 | 2728 |
2729 byte_stream_new(&bs, 11+strlen(bn)+2); | 2729 byte_stream_new(&bs, 11+strlen(bn)+2); |
2730 | 2730 |
2731 snacid = aim_cachesnac(od, SNAC_FAMILY_ICBM, 0x0014, 0x0000, NULL, 0); | 2731 snacid = aim_cachesnac(od, SNAC_FAMILY_ICBM, 0x0014, 0x0000, NULL, 0); |
2732 | 2732 |
2733 /* | 2733 /* ICBM cookie */ |
2734 * 8 days of light | 2734 byte_stream_put32(&bs, 0x00000000); |
2735 * Er, that is to say, 8 bytes of 0's | 2735 byte_stream_put32(&bs, 0x00000000); |
2736 */ | 2736 |
2737 byte_stream_put16(&bs, 0x0000); | 2737 /* |
2738 byte_stream_put16(&bs, 0x0000); | 2738 * Channel (should be 0x0001 for mtn) |
2739 byte_stream_put16(&bs, 0x0000); | 2739 */ |
2740 byte_stream_put16(&bs, 0x0000); | 2740 byte_stream_put16(&bs, channel); |
2741 | |
2742 /* | |
2743 * Type 1 (should be 0x0001 for mtn) | |
2744 */ | |
2745 byte_stream_put16(&bs, type1); | |
2746 | 2741 |
2747 /* | 2742 /* |
2748 * Dest buddy name | 2743 * Dest buddy name |
2749 */ | 2744 */ |
2750 byte_stream_put8(&bs, strlen(bn)); | 2745 byte_stream_put8(&bs, strlen(bn)); |
2751 byte_stream_putstr(&bs, bn); | 2746 byte_stream_putstr(&bs, bn); |
2752 | 2747 |
2753 /* | 2748 /* |
2754 * Type 2 (should be 0x0000, 0x0001, or 0x0002 for mtn) | 2749 * Event (should be 0x0000, 0x0001, or 0x0002 for mtn) |
2755 */ | 2750 */ |
2756 byte_stream_put16(&bs, type2); | 2751 byte_stream_put16(&bs, event); |
2757 | 2752 |
2758 flap_connection_send_snac(od, conn, SNAC_FAMILY_ICBM, 0x0014, 0x0000, snacid, &bs); | 2753 flap_connection_send_snac(od, conn, SNAC_FAMILY_ICBM, 0x0014, 0x0000, snacid, &bs); |
2759 | 2754 |
2760 byte_stream_destroy(&bs); | 2755 byte_stream_destroy(&bs); |
2761 | 2756 |
2773 { | 2768 { |
2774 int ret = 0; | 2769 int ret = 0; |
2775 aim_rxcallback_t userfunc; | 2770 aim_rxcallback_t userfunc; |
2776 char *bn; | 2771 char *bn; |
2777 guint8 bnlen; | 2772 guint8 bnlen; |
2778 guint16 type1, type2; | 2773 guint16 channel, event; |
2779 | 2774 |
2780 byte_stream_advance(bs, 8); /* Unknown - All 0's */ | 2775 byte_stream_advance(bs, 8); /* ICBM cookie */ |
2781 type1 = byte_stream_get16(bs); | 2776 channel = byte_stream_get16(bs); |
2782 bnlen = byte_stream_get8(bs); | 2777 bnlen = byte_stream_get8(bs); |
2783 bn = byte_stream_getstr(bs, bnlen); | 2778 bn = byte_stream_getstr(bs, bnlen); |
2784 type2 = byte_stream_get16(bs); | 2779 event = byte_stream_get16(bs); |
2785 | 2780 |
2786 if ((userfunc = aim_callhandler(od, snac->family, snac->subtype))) | 2781 if ((userfunc = aim_callhandler(od, snac->family, snac->subtype))) |
2787 ret = userfunc(od, conn, frame, type1, bn, type2); | 2782 ret = userfunc(od, conn, frame, channel, bn, event); |
2788 | 2783 |
2789 g_free(bn); | 2784 g_free(bn); |
2790 | 2785 |
2791 return ret; | 2786 return ret; |
2792 } | 2787 } |