comparison libpurple/protocols/oscar/family_icbm.c @ 22856:ab2322195dab

Minor changes... mostly whitespace related. Also changed some functions in family_admin.c to be void instead of returning the same int every time, and fixed a tiny memleak in family_admin.c. Oh, I think there was a variable in family_icbm.c that was being redeclared inside of a block--functionally it was fine, but it could have led to confusion.
author Mark Doliner <mark@kingant.net>
date Mon, 05 May 2008 09:22:46 +0000
parents 6f5f0a4de7f4
children 9c0ee2491ed1
comparison
equal deleted inserted replaced
22845:61e0bcbf31ab 22856:ab2322195dab
182 byte_stream_put16(&bs, params->maxrecverwarn); 182 byte_stream_put16(&bs, params->maxrecverwarn);
183 byte_stream_put32(&bs, params->minmsginterval); 183 byte_stream_put32(&bs, params->minmsginterval);
184 184
185 snacid = aim_cachesnac(od, 0x0004, 0x0002, 0x0000, NULL, 0); 185 snacid = aim_cachesnac(od, 0x0004, 0x0002, 0x0000, NULL, 0);
186 flap_connection_send_snac(od, conn, 0x0004, 0x0002, 0x0000, snacid, &bs); 186 flap_connection_send_snac(od, conn, 0x0004, 0x0002, 0x0000, snacid, &bs);
187 187
188 byte_stream_destroy(&bs); 188 byte_stream_destroy(&bs);
189 189
190 return 0; 190 return 0;
191 } 191 }
192 192
193 /** 193 /**
194 * Subtype 0x0004 - Request ICBM parameter information. 194 * Subtype 0x0004 - Request ICBM parameter information.
518 518
519 aim_tlvlist_free(inner_tlvlist); 519 aim_tlvlist_free(inner_tlvlist);
520 aim_tlvlist_free(outer_tlvlist); 520 aim_tlvlist_free(outer_tlvlist);
521 521
522 flap_connection_send_snac(od, conn, 0x0004, 0x0006, 0x0000, snacid, &bs); 522 flap_connection_send_snac(od, conn, 0x0004, 0x0006, 0x0000, snacid, &bs);
523 523
524 byte_stream_destroy(&bs); 524 byte_stream_destroy(&bs);
525 525
526 return 0; 526 return 0;
527 } 527 }
528 528
590 byte_stream_put16(&bs, 0x0000); 590 byte_stream_put16(&bs, 0x0000);
591 591
592 flap_connection_send_snac(od, conn, 0x0004, 0x0006, 0x0000, snacid, &bs); 592 flap_connection_send_snac(od, conn, 0x0004, 0x0006, 0x0000, snacid, &bs);
593 593
594 byte_stream_destroy(&bs); 594 byte_stream_destroy(&bs);
595 595
596 return 0; 596 return 0;
597 } 597 }
598 598
599 /* 599 /*
600 * Subtype 0x0006 - Send a rich text message. 600 * Subtype 0x0006 - Send a rich text message.
683 byte_stream_putraw(&bs, (const guint8 *)rtfcap, strlen(rtfcap)+1); 683 byte_stream_putraw(&bs, (const guint8 *)rtfcap, strlen(rtfcap)+1);
684 684
685 flap_connection_send_snac(od, conn, 0x0004, 0x0006, 0x0000, snacid, &bs); 685 flap_connection_send_snac(od, conn, 0x0004, 0x0006, 0x0000, snacid, &bs);
686 686
687 byte_stream_destroy(&bs); 687 byte_stream_destroy(&bs);
688 688
689 return 0; 689 return 0;
690 } 690 }
691 691
692 /** 692 /**
693 * Cancel a rendezvous invitation. It could be an invitation to 693 * Cancel a rendezvous invitation. It could be an invitation to
726 /* This TLV means "cancel!" */ 726 /* This TLV means "cancel!" */
727 aim_tlvlist_add_16(&inner_tlvlist, 0x000b, 0x0001); 727 aim_tlvlist_add_16(&inner_tlvlist, 0x000b, 0x0001);
728 aim_tlvlist_write(&hdrbs, &inner_tlvlist); 728 aim_tlvlist_write(&hdrbs, &inner_tlvlist);
729 729
730 aim_tlvlist_add_raw(&outer_tlvlist, 0x0005, byte_stream_curpos(&hdrbs), hdrbs.data); 730 aim_tlvlist_add_raw(&outer_tlvlist, 0x0005, byte_stream_curpos(&hdrbs), hdrbs.data);
731 g_free(hdrbs.data); 731 byte_stream_destroy(&hdrbs);
732 732
733 aim_tlvlist_write(&bs, &outer_tlvlist); 733 aim_tlvlist_write(&bs, &outer_tlvlist);
734 734
735 aim_tlvlist_free(inner_tlvlist); 735 aim_tlvlist_free(inner_tlvlist);
736 aim_tlvlist_free(outer_tlvlist); 736 aim_tlvlist_free(outer_tlvlist);
770 byte_stream_putraw(&bs, peer_conn->cookie, 8); 770 byte_stream_putraw(&bs, peer_conn->cookie, 8);
771 byte_stream_putcaps(&bs, peer_conn->type); 771 byte_stream_putcaps(&bs, peer_conn->type);
772 772
773 flap_connection_send_snac(od, conn, 0x0004, 0x0006, 0x0000, snacid, &bs); 773 flap_connection_send_snac(od, conn, 0x0004, 0x0006, 0x0000, snacid, &bs);
774 774
775 byte_stream_destroy(&bs); 775 byte_stream_destroy(&bs);
776 } 776 }
777 777
778 /** 778 /**
779 * Subtype 0x0006 - Send a direct connect rendezvous ICBM. This 779 * Subtype 0x0006 - Send a direct connect rendezvous ICBM. This
780 * could have a number of meanings, depending on the content: 780 * could have a number of meanings, depending on the content:
943 aim_tlvlist_add_raw(&inner_tlvlist, 0x000c, 24, "Please accept this file."); 943 aim_tlvlist_add_raw(&inner_tlvlist, 0x000c, 24, "Please accept this file.");
944 #endif 944 #endif
945 945
946 if (filename != NULL) 946 if (filename != NULL)
947 { 947 {
948 ByteStream bs; 948 ByteStream inner_bs;
949 949
950 /* Begin TLV t(2711) */ 950 /* Begin TLV t(2711) */
951 byte_stream_new(&bs, 2+2+4+strlen(filename)+1); 951 byte_stream_new(&inner_bs, 2+2+4+strlen(filename)+1);
952 byte_stream_put16(&bs, (numfiles > 1) ? 0x0002 : 0x0001); 952 byte_stream_put16(&inner_bs, (numfiles > 1) ? 0x0002 : 0x0001);
953 byte_stream_put16(&bs, numfiles); 953 byte_stream_put16(&inner_bs, numfiles);
954 byte_stream_put32(&bs, size); 954 byte_stream_put32(&inner_bs, size);
955 955
956 /* Filename - NULL terminated, for some odd reason */ 956 /* Filename - NULL terminated, for some odd reason */
957 byte_stream_putstr(&bs, filename); 957 byte_stream_putstr(&inner_bs, filename);
958 byte_stream_put8(&bs, 0x00); 958 byte_stream_put8(&inner_bs, 0x00);
959 959
960 aim_tlvlist_add_raw(&inner_tlvlist, 0x2711, bs.len, bs.data); 960 aim_tlvlist_add_raw(&inner_tlvlist, 0x2711, inner_bs.len, inner_bs.data);
961 byte_stream_destroy(&bs); 961 byte_stream_destroy(&inner_bs);
962 /* End TLV t(2711) */ 962 /* End TLV t(2711) */
963 } 963 }
964 964
965 aim_tlvlist_write(&hdrbs, &inner_tlvlist); 965 aim_tlvlist_write(&hdrbs, &inner_tlvlist);
966 aim_tlvlist_add_raw(&outer_tlvlist, 0x0005, byte_stream_curpos(&hdrbs), hdrbs.data); 966 aim_tlvlist_add_raw(&outer_tlvlist, 0x0005, byte_stream_curpos(&hdrbs), hdrbs.data);
1161 byte_stream_put16(&bs, 0x0000); 1161 byte_stream_put16(&bs, 0x0000);
1162 1162
1163 flap_connection_send_snac(od, conn, 0x0004, 0x0006, 0x0000, snacid, &bs); 1163 flap_connection_send_snac(od, conn, 0x0004, 0x0006, 0x0000, snacid, &bs);
1164 1164
1165 byte_stream_destroy(&bs); 1165 byte_stream_destroy(&bs);
1166 1166
1167 return 0; 1167 return 0;
1168 } 1168 }
1169 1169
1170 /** 1170 /**
1171 * Subtype 0x0006 - Send an ICQ-esque ICBM. 1171 * Subtype 0x0006 - Send an ICQ-esque ICBM.
1230 byte_stream_put16(&bs, 0x0000); 1230 byte_stream_put16(&bs, 0x0000);
1231 1231
1232 flap_connection_send_snac(od, conn, 0x0004, 0x0006, 0x0000, snacid, &bs); 1232 flap_connection_send_snac(od, conn, 0x0004, 0x0006, 0x0000, snacid, &bs);
1233 1233
1234 byte_stream_destroy(&bs); 1234 byte_stream_destroy(&bs);
1235 1235
1236 return 0; 1236 return 0;
1237 } 1237 }
1238 1238
1239 /* 1239 /*
1240 * XXX - I don't see when this would ever get called... 1240 * XXX - I don't see when this would ever get called...
2337 aim_tlvlist_add_16(&tlvlist, 0x0003, code); 2337 aim_tlvlist_add_16(&tlvlist, 0x0003, code);
2338 aim_tlvlist_write(&bs, &tlvlist); 2338 aim_tlvlist_write(&bs, &tlvlist);
2339 aim_tlvlist_free(tlvlist); 2339 aim_tlvlist_free(tlvlist);
2340 2340
2341 flap_connection_send_snac(od, conn, 0x0004, 0x000b, 0x0000, snacid, &bs); 2341 flap_connection_send_snac(od, conn, 0x0004, 0x000b, 0x0000, snacid, &bs);
2342 2342
2343 byte_stream_destroy(&bs); 2343 byte_stream_destroy(&bs);
2344 2344
2345 return 0; 2345 return 0;
2346 } 2346 }
2347 2347
2714 byte_stream_put16(&bs, type2); 2714 byte_stream_put16(&bs, type2);
2715 2715
2716 flap_connection_send_snac(od, conn, 0x0004, 0x0014, 0x0000, snacid, &bs); 2716 flap_connection_send_snac(od, conn, 0x0004, 0x0014, 0x0000, snacid, &bs);
2717 2717
2718 byte_stream_destroy(&bs); 2718 byte_stream_destroy(&bs);
2719 2719
2720 return 0; 2720 return 0;
2721 } 2721 }
2722 2722
2723 /* 2723 /*
2724 * Subtype 0x0014 - Receive a mini typing notification (mtn) packet. 2724 * Subtype 0x0014 - Receive a mini typing notification (mtn) packet.