comparison libpurple/protocols/oscar/family_oservice.c @ 30831:be056399ae5f

Fixes #12044. We send a dummy packet with DC version = 8 to make Miranda and QIP think we come from a respectable family and deserve being sent channel 2 messages (which we now treat as plain text). Also, we now send HTML_MSGS capability to convince Trillian to not strip HTML before sending us messages.
author ivan.komarov@soc.pidgin.im
date Thu, 05 Aug 2010 21:19:47 +0000
parents bbb27d65681f
children 11c54d781835
comparison
equal deleted inserted replaced
30830:1f3ef11a9690 30831:be056399ae5f
838 flap_connection_send_snac(od, conn, SNAC_FAMILY_OSERVICE, 0x001e, 0x0000, snacid, &bs); 838 flap_connection_send_snac(od, conn, SNAC_FAMILY_OSERVICE, 0x001e, 0x0000, snacid, &bs);
839 839
840 byte_stream_destroy(&bs); 840 byte_stream_destroy(&bs);
841 841
842 return 0; 842 return 0;
843 }
844
845 /* Send dummy DC (direct connect) information to the server.
846 * Direct connect is ICQ's counterpart for AIM's DirectIM,
847 * as far as I can tell. Anyway, we don't support it;
848 * the reason to send this packet is that some clients
849 * (Miranda, QIP) won't send us channel 2 ICBM messages
850 * unless we specify DC version >= 8.
851 *
852 * See #12044 for more information.
853 */
854 void
855 aim_srv_set_dc_info(OscarData *od)
856 {
857 ByteStream bs, tlv0c;
858 aim_snacid_t snacid;
859 GSList *tlvlist = NULL;
860
861 /* http://iserverd.khstu.ru/oscar/snac_01_1e.html has a nice analysis of what goes in 0xc tlv.
862 * Kopete sends a dummy DC info, too, so I just copied the values from them.
863 */
864 byte_stream_new(&tlv0c, 4*2 + 1 + 2 + 4*6 + 2);
865 byte_stream_put32(&tlv0c, 0x0);
866 byte_stream_put32(&tlv0c, 0x0);
867 byte_stream_put8(&tlv0c, 0x0); /* We don't support DC */
868 byte_stream_put16(&tlv0c, 8); /* DC version */
869 byte_stream_put32(&tlv0c, 0x0);
870 byte_stream_put32(&tlv0c, 0x50);
871 byte_stream_put32(&tlv0c, 0x3);
872 byte_stream_put32(&tlv0c, 0x0);
873 byte_stream_put32(&tlv0c, 0x0);
874 byte_stream_put32(&tlv0c, 0x0);
875 byte_stream_put16(&tlv0c, 0x0);
876 aim_tlvlist_add_raw(&tlvlist, 0x000c, byte_stream_curpos(&tlv0c), tlv0c.data);
877 byte_stream_destroy(&tlv0c);
878
879 byte_stream_new(&bs, aim_tlvlist_size(tlvlist));
880 aim_tlvlist_write(&bs, &tlvlist);
881 aim_tlvlist_free(tlvlist);
882
883 snacid = aim_cachesnac(od, SNAC_FAMILY_OSERVICE, 0x001e, 0x0000, NULL, 0);
884 flap_connection_send_snac(od, flap_connection_findbygroup(od, SNAC_FAMILY_ICBM), SNAC_FAMILY_OSERVICE, 0x001e, 0x0000, snacid, &bs);
885
886 byte_stream_destroy(&bs);
843 } 887 }
844 888
845 /** 889 /**
846 * Starting this past week (26 Mar 2001, say), AOL has started sending 890 * Starting this past week (26 Mar 2001, say), AOL has started sending
847 * this nice little extra SNAC. AFAIK, it has never been used until now. 891 * this nice little extra SNAC. AFAIK, it has never been used until now.