5 * TODO: Seperate a lot of this into an aim_bos.c.
19 * Should set your current idle time in seconds. Idealy, OSCAR should
20 * do this for us. But, it doesn't. The client must call this to set idle
24 faim_export unsigned long aim_bos_setidle(struct aim_session_t *sess,
25 struct aim_conn_t *conn,
28 return aim_genericreq_l(sess, conn, 0x0001, 0x0011, &idletime);
33 * aim_bos_changevisibility(conn, changtype, namelist)
35 * Changes your visibility depending on changetype:
37 * AIM_VISIBILITYCHANGE_PERMITADD: Lets provided list of names see you
38 * AIM_VISIBILITYCHANGE_PERMIDREMOVE: Removes listed names from permit list
39 * AIM_VISIBILITYCHANGE_DENYADD: Hides you from provided list of names
40 * AIM_VISIBILITYCHANGE_DENYREMOVE: Lets list see you again
42 * list should be a list of
43 * screen names in the form "Screen Name One&ScreenNameTwo&" etc.
45 * Equivelents to options in WinAIM:
46 * - Allow all users to contact me: Send an AIM_VISIBILITYCHANGE_DENYADD
47 * with only your name on it.
48 * - Allow only users on my Buddy List: Send an
49 * AIM_VISIBILITYCHANGE_PERMITADD with the list the same as your
51 * - Allow only the uesrs below: Send an AIM_VISIBILITYCHANGE_PERMITADD
52 * with everyone listed that you want to see you.
53 * - Block all users: Send an AIM_VISIBILITYCHANGE_PERMITADD with only
54 * yourself in the list
55 * - Block the users below: Send an AIM_VISIBILITYCHANGE_DENYADD with
56 * the list of users to be blocked
60 faim_export unsigned long aim_bos_changevisibility(struct aim_session_t *sess,
61 struct aim_conn_t *conn,
65 struct command_tx_struct *newpacket;
69 char *localcpy = NULL;
77 localcpy = (char *) malloc(strlen(denylist)+1);
78 memcpy(localcpy, denylist, strlen(denylist)+1);
80 listcount = aimutil_itemcnt(localcpy, '&');
81 packlen = aimutil_tokslen(localcpy, 99, '&') + listcount + 9;
83 if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, packlen)))
90 case AIM_VISIBILITYCHANGE_PERMITADD: subtype = 0x05; break;
91 case AIM_VISIBILITYCHANGE_PERMITREMOVE: subtype = 0x06; break;
92 case AIM_VISIBILITYCHANGE_DENYADD: subtype = 0x07; break;
93 case AIM_VISIBILITYCHANGE_DENYREMOVE: subtype = 0x08; break;
95 free(newpacket->data);
100 /* We actually DO NOT send a SNAC ID with this one! */
101 aim_putsnac(newpacket->data, 0x0009, subtype, 0x00, 0);
103 j = 10; /* the next byte */
105 for (i=0; (i < (listcount - 1)) && (i < 99); i++)
107 tmpptr = aimutil_itemidx(localcpy, i, '&');
109 newpacket->data[j] = strlen(tmpptr);
110 memcpy(&(newpacket->data[j+1]), tmpptr, strlen(tmpptr));
111 j += strlen(tmpptr)+1;
118 aim_tx_enqueue(sess, newpacket);
120 return (sess->snac_nextid); /* dont increment */
127 * aim_bos_setbuddylist(buddylist)
129 * This just builds the "set buddy list" command then queues it.
131 * buddy_list = "Screen Name One&ScreenNameTwo&";
133 * TODO: Clean this up.
135 * XXX: I can't stress the TODO enough.
138 faim_export unsigned long aim_bos_setbuddylist(struct aim_session_t *sess,
139 struct aim_conn_t *conn,
144 struct command_tx_struct *newpacket;
148 char *localcpy = NULL;
151 len = 10; /* 10B SNAC headers */
153 if (!buddy_list || !(localcpy = (char *) malloc(strlen(buddy_list)+1)))
155 strncpy(localcpy, buddy_list, strlen(buddy_list)+1);
158 tmpptr = strtok(localcpy, "&");
159 while ((tmpptr != NULL) && (i < 150)) {
161 printf("---adding %d: %s (%d)\n", i, tmpptr, strlen(tmpptr));
163 len += 1+strlen(tmpptr);
165 tmpptr = strtok(NULL, "&");
168 printf("*** send buddy list len: %d (%x)\n", len, len);
171 if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, len)))
176 aim_putsnac(newpacket->data, 0x0003, 0x0004, 0x0000, 0);
178 j = 10; /* the next byte */
180 strncpy(localcpy, buddy_list, strlen(buddy_list)+1);
182 tmpptr = strtok(localcpy, "&");
183 while ((tmpptr != NULL) & (i < 150)) {
185 printf("---adding %d: %s (%d)\n", i, tmpptr, strlen(tmpptr));
187 newpacket->data[j] = strlen(tmpptr);
188 memcpy(&(newpacket->data[j+1]), tmpptr, strlen(tmpptr));
189 j += 1+strlen(tmpptr);
191 tmpptr = strtok(NULL, "&");
196 aim_tx_enqueue(sess, newpacket);
200 return (sess->snac_nextid);
204 * aim_bos_setprofile(profile)
206 * Gives BOS your profile.
210 faim_export unsigned long aim_bos_setprofile(struct aim_session_t *sess,
211 struct aim_conn_t *conn,
216 struct command_tx_struct *newpacket;
217 int i = 0, tmp, caplen;
219 if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, 1152+strlen(profile)+1+(awaymsg?strlen(awaymsg):0))))
222 i += aim_putsnac(newpacket->data, 0x0002, 0x004, 0x0000, sess->snac_nextid);
223 i += aim_puttlv_str(newpacket->data+i, 0x0001, strlen("text/x-aolrtf; charset=\"us-ascii\""), "text/x-aolrtf; charset=\"us-ascii\"");
224 i += aim_puttlv_str(newpacket->data+i, 0x0002, strlen(profile), profile);
225 /* why do we send this twice? */
226 i += aim_puttlv_str(newpacket->data+i, 0x0003, strlen("text/x-aolrtf; charset=\"us-ascii\""), "text/x-aolrtf; charset=\"us-ascii\"");
228 /* Away message -- we send this no matter what, even if its blank */
230 i += aim_puttlv_str(newpacket->data+i, 0x0004, strlen(awaymsg), awaymsg);
232 i += aim_puttlv_str(newpacket->data+i, 0x0004, 0x0000, NULL);
234 /* Capability information. */
236 tmp = (i += aimutil_put16(newpacket->data+i, 0x0005));
237 i += aimutil_put16(newpacket->data+i, 0x0000); /* rewritten later */
238 i += (caplen = aim_putcap(newpacket->data+i, 512, caps));
239 aimutil_put16(newpacket->data+tmp, caplen); /* rewrite TLV size */
241 newpacket->commandlen = i;
242 aim_tx_enqueue(sess, newpacket);
244 return (sess->snac_nextid++);
248 * aim_bos_setgroupperm(mask)
250 * Set group permisson mask. Normally 0x1f (all classes).
252 * The group permission mask allows you to keep users of a certain
253 * class or classes from talking to you. The mask should be
254 * a bitwise OR of all the user classes you want to see you.
257 faim_export unsigned long aim_bos_setgroupperm(struct aim_session_t *sess,
258 struct aim_conn_t *conn,
261 return aim_genericreq_l(sess, conn, 0x0009, 0x0004, &mask);
264 faim_internal int aim_parse_bosrights(struct aim_session_t *sess,
265 struct command_rx_struct *command, ...)
267 rxcallback_t userfunc = NULL;
269 struct aim_tlvlist_t *tlvlist;
270 unsigned short maxpermits = 0, maxdenies = 0;
275 if (!(tlvlist = aim_readtlvchain(command->data+10, command->commandlen-10)))
279 * TLV type 0x0001: Maximum number of buddies on permit list.
281 if (aim_gettlv(tlvlist, 0x0001, 1))
282 maxpermits = aim_gettlv16(tlvlist, 0x0001, 1);
285 * TLV type 0x0002: Maximum number of buddies on deny list.
288 if (aim_gettlv(tlvlist, 0x0002, 1))
289 maxdenies = aim_gettlv16(tlvlist, 0x0002, 1);
291 if ((userfunc = aim_callhandler(command->conn, 0x0009, 0x0003)))
292 ret = userfunc(sess, command, maxpermits, maxdenies);
294 aim_freetlvchain(&tlvlist);
300 * aim_bos_clientready()
307 faim_export unsigned long aim_bos_clientready(struct aim_session_t *sess,
308 struct aim_conn_t *conn)
310 u_char command_2[] = {
311 /* placeholders for dynamic data */
312 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
318 0x06, 0x86, /* the good ones */
320 0x07, 0xda, /* DUPLE OF DEATH! */
361 int command_2_len = 0x52;
362 struct command_tx_struct *newpacket;
364 if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, command_2_len)))
369 memcpy(newpacket->data, command_2, command_2_len);
371 /* This write over the dynamic parts of the byte block */
372 aim_putsnac(newpacket->data, 0x0001, 0x0002, 0x0000, sess->snac_nextid);
374 aim_tx_enqueue(sess, newpacket);
376 return (sess->snac_nextid++);
380 * Request Rate Information.
383 faim_export unsigned long aim_bos_reqrate(struct aim_session_t *sess,
384 struct aim_conn_t *conn)
386 return aim_genericreq_n(sess, conn, 0x0001, 0x0006);
390 * Rate Information Response Acknowledge.
393 faim_export unsigned long aim_bos_ackrateresp(struct aim_session_t *sess,
394 struct aim_conn_t *conn)
396 struct command_tx_struct *newpacket;
397 int packlen = 20, i=0;
399 if(!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, packlen)))
400 return (sess->snac_nextid);
404 i = aim_putsnac(newpacket->data, 0x0001, 0x0008, 0x0000, 0);
405 i += aimutil_put16(newpacket->data+i, 0x0001);
406 i += aimutil_put16(newpacket->data+i, 0x0002);
407 i += aimutil_put16(newpacket->data+i, 0x0003);
408 i += aimutil_put16(newpacket->data+i, 0x0004);
409 i += aimutil_put16(newpacket->data+i, 0x0005);
411 newpacket->commandlen = i;
414 aim_tx_enqueue(sess, newpacket);
416 return (sess->snac_nextid);
420 * aim_bos_setprivacyflags()
422 * Sets privacy flags. Normally 0x03.
424 * Bit 1: Allows other AIM users to see how long you've been idle.
425 * Bit 2: Allows other AIM users to see how long you've been a member.
428 faim_export unsigned long aim_bos_setprivacyflags(struct aim_session_t *sess,
429 struct aim_conn_t *conn,
432 return aim_genericreq_l(sess, conn, 0x0001, 0x0014, &flags);
436 * aim_bos_reqpersonalinfo()
438 * Requests the current user's information. Can't go generic on this one
439 * because aparently it uses SNAC flags.
442 faim_export unsigned long aim_bos_reqpersonalinfo(struct aim_session_t *sess,
443 struct aim_conn_t *conn)
445 return aim_genericreq_n(sess, conn, 0x0001, 0x000e);
448 faim_export unsigned long aim_setversions(struct aim_session_t *sess,
449 struct aim_conn_t *conn)
451 struct command_tx_struct *newpacket;
454 if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, 10 + (4*12))))
459 i = aim_putsnac(newpacket->data, 0x0001, 0x0017, 0x0000, sess->snac_nextid);
460 aim_cachesnac(sess, 0x0001, 0x0017, 0x0000, NULL, 0);
462 i += aimutil_put16(newpacket->data+i, 0x0001);
463 i += aimutil_put16(newpacket->data+i, 0x0003);
465 i += aimutil_put16(newpacket->data+i, 0x0013);
466 i += aimutil_put16(newpacket->data+i, 0x0001);
468 i += aimutil_put16(newpacket->data+i, 0x0002);
469 i += aimutil_put16(newpacket->data+i, 0x0001);
471 i += aimutil_put16(newpacket->data+i, 0x0003);
472 i += aimutil_put16(newpacket->data+i, 0x0001);
474 i += aimutil_put16(newpacket->data+i, 0x0004);
475 i += aimutil_put16(newpacket->data+i, 0x0001);
477 i += aimutil_put16(newpacket->data+i, 0x0006);
478 i += aimutil_put16(newpacket->data+i, 0x0001);
480 i += aimutil_put16(newpacket->data+i, 0x0008);
481 i += aimutil_put16(newpacket->data+i, 0x0001);
483 i += aimutil_put16(newpacket->data+i, 0x0009);
484 i += aimutil_put16(newpacket->data+i, 0x0001);
486 i += aimutil_put16(newpacket->data+i, 0x000a);
487 i += aimutil_put16(newpacket->data+i, 0x0001);
489 i += aimutil_put16(newpacket->data+i, 0x000b);
490 i += aimutil_put16(newpacket->data+i, 0x0001);
492 i += aimutil_put16(newpacket->data+i, 0x000c);
493 i += aimutil_put16(newpacket->data+i, 0x0001);
495 newpacket->commandlen = i;
497 aim_tx_enqueue(sess, newpacket);
499 return sess->snac_nextid;
504 * aim_bos_reqservice(serviceid)
509 faim_export unsigned long aim_bos_reqservice(struct aim_session_t *sess,
510 struct aim_conn_t *conn,
513 return aim_genericreq_s(sess, conn, 0x0001, 0x0004, &serviceid);
519 * No-op. WinAIM sends these every 4min or so to keep
520 * the connection alive. Its not real necessary.
523 faim_export unsigned long aim_bos_nop(struct aim_session_t *sess,
524 struct aim_conn_t *conn)
526 return aim_genericreq_n(sess, conn, 0x0001, 0x0016);
532 * No-op. WinAIM 4.x sends these _every minute_ to keep
533 * the connection alive.
535 faim_export unsigned long aim_flap_nop(struct aim_session_t *sess,
536 struct aim_conn_t *conn)
538 struct command_tx_struct *newpacket;
540 if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0005, conn, 0)))
541 return sess->snac_nextid;
544 newpacket->commandlen = 0;
547 aim_tx_enqueue(sess, newpacket);
549 return (sess->snac_nextid);
553 * aim_bos_reqrights()
555 * Request BOS rights.
558 faim_export unsigned long aim_bos_reqrights(struct aim_session_t *sess,
559 struct aim_conn_t *conn)
561 return aim_genericreq_n(sess, conn, 0x0009, 0x0002);
565 * aim_bos_reqbuddyrights()
567 * Request Buddy List rights.
570 faim_export unsigned long aim_bos_reqbuddyrights(struct aim_session_t *sess,
571 struct aim_conn_t *conn)
573 return aim_genericreq_n(sess, conn, 0x0003, 0x0002);
577 * aim_send_warning(struct aim_session_t *sess,
578 * struct aim_conn_t *conn, char *destsn, int anon)
579 * send a warning to destsn.
580 * anon is anonymous or not;
581 * AIM_WARN_ANON anonymous
583 * returns -1 on error (couldn't alloc packet), next snacid on success.
586 faim_export int aim_send_warning(struct aim_session_t *sess, struct aim_conn_t *conn, char *destsn, int anon)
588 struct command_tx_struct *newpacket;
591 if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, strlen(destsn)+13)))
597 curbyte += aim_putsnac(newpacket->data+curbyte,
598 0x0004, 0x0008, 0x0000, sess->snac_nextid);
600 curbyte += aimutil_put16(newpacket->data+curbyte, (anon & AIM_WARN_ANON)?1:0);
602 curbyte += aimutil_put8(newpacket->data+curbyte, strlen(destsn));
604 curbyte += aimutil_putstr(newpacket->data+curbyte, destsn, strlen(destsn));
606 newpacket->commandlen = curbyte;
609 aim_tx_enqueue(sess, newpacket);
611 return (sess->snac_nextid++);
615 * aim_debugconn_sendconnect()
617 * For aimdebugd. If you don't know what it is, you don't want to.
619 faim_export unsigned long aim_debugconn_sendconnect(struct aim_session_t *sess,
620 struct aim_conn_t *conn)
622 return aim_genericreq_n(sess, conn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_DEBUGCONN_CONNECT);
626 * Generic routine for sending commands.
629 * I know I can do this in a smarter way...but I'm not thinking straight
632 * I had one big function that handled all three cases, but then it broke
633 * and I split it up into three. But then I fixed it. I just never went
634 * back to the single. I don't see any advantage to doing it either way.
637 faim_internal unsigned long aim_genericreq_n(struct aim_session_t *sess,
638 struct aim_conn_t *conn,
639 u_short family, u_short subtype)
641 struct command_tx_struct *newpacket;
643 if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, 10)))
648 aim_putsnac(newpacket->data, family, subtype, 0x0000, sess->snac_nextid);
650 aim_cachesnac(sess, family, subtype, 0x0000, NULL, 0);
652 aim_tx_enqueue(sess, newpacket);
653 return sess->snac_nextid;
660 faim_internal unsigned long aim_genericreq_l(struct aim_session_t *sess,
661 struct aim_conn_t *conn,
662 u_short family, u_short subtype,
665 struct command_tx_struct *newpacket;
668 /* If we don't have data, there's no reason to use this function */
670 return aim_genericreq_n(sess, conn, family, subtype);
672 if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, 10+sizeof(u_long))))
677 aim_putsnac(newpacket->data, family, subtype, 0x0000, sess->snac_nextid);
678 aim_cachesnac(sess, family, subtype, 0x0000, NULL, 0);
681 newlong = htonl(*longdata);
682 memcpy(&(newpacket->data[10]), &newlong, sizeof(u_long));
684 aim_tx_enqueue(sess, newpacket);
685 return sess->snac_nextid;
688 faim_internal unsigned long aim_genericreq_s(struct aim_session_t *sess,
689 struct aim_conn_t *conn,
690 u_short family, u_short subtype,
693 struct command_tx_struct *newpacket;
696 /* If we don't have data, there's no reason to use this function */
698 return aim_genericreq_n(sess, conn, family, subtype);
700 if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, 10+sizeof(u_short))))
705 aim_putsnac(newpacket->data, family, subtype, 0x0000, sess->snac_nextid);
706 aim_cachesnac(sess, family, subtype, 0x0000, NULL, 0);
709 newshort = htons(*shortdata);
710 memcpy(&(newpacket->data[10]), &newshort, sizeof(u_short));
712 aim_tx_enqueue(sess, newpacket);
713 return sess->snac_nextid;
717 * aim_bos_reqlocaterights()
719 * Request Location services rights.
722 faim_export unsigned long aim_bos_reqlocaterights(struct aim_session_t *sess,
723 struct aim_conn_t *conn)
725 return aim_genericreq_n(sess, conn, 0x0002, 0x0002);
729 * aim_bos_reqicbmparaminfo()
731 * Request ICBM parameter information.
734 faim_export unsigned long aim_bos_reqicbmparaminfo(struct aim_session_t *sess,
735 struct aim_conn_t *conn)
737 return aim_genericreq_n(sess, conn, 0x0004, 0x0004);
741 * Add ICBM parameter? Huh?
743 faim_export unsigned long aim_addicbmparam(struct aim_session_t *sess,
744 struct aim_conn_t *conn)
746 struct command_tx_struct *newpacket;
747 int packlen = 10+16, i=0;
749 if(!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, packlen)))
750 return (sess->snac_nextid);
754 i = aim_putsnac(newpacket->data, 0x0004, 0x0002, 0x0000, sess->snac_nextid);
755 aim_cachesnac(sess, 0x0004, 0x0002, 0x0000, NULL, 0);
757 i += aimutil_put16(newpacket->data+i, 0x0000);
758 i += aimutil_put16(newpacket->data+i, 0x0000);
759 i += aimutil_put16(newpacket->data+i, 0x0003);
760 i += aimutil_put16(newpacket->data+i, 0x1f40);
761 i += aimutil_put16(newpacket->data+i, 0x03e7);
762 i += aimutil_put16(newpacket->data+i, 0x03e7);
763 i += aimutil_put16(newpacket->data+i, 0x0000);
764 i += aimutil_put16(newpacket->data+i, 0x0000);
766 aim_tx_enqueue(sess, newpacket);
768 return sess->snac_nextid;
772 * Set directory profile data (not the same as aim_bos_setprofile!)
774 faim_export unsigned long aim_setdirectoryinfo(struct aim_session_t *sess, struct aim_conn_t *conn, char *first, char *middle, char *last, char *maiden, char *nickname, char *street, char *city, char *state, char *zip, int country, unsigned short privacy)
776 struct command_tx_struct *newpacket;
777 int packlen = 0, i = 0;
781 if(first) /* TLV 0001 */
782 packlen += (strlen(first) + 4);
784 packlen += (strlen(middle) + 4);
786 packlen += (strlen(last) + 4);
788 packlen += (strlen(maiden) + 4);
790 packlen += (strlen(nickname) + 4);
792 packlen += (strlen(street) + 4);
794 packlen += (strlen(state) + 4);
796 packlen += (strlen(city) + 4);
798 packlen += (strlen(zip) + 4);
800 if(!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, packlen+10)))
805 i = aim_putsnac(newpacket->data, 0x0002, 0x0009, 0x0000, 0);
807 /* 000a/0002: privacy: 1 to allow search/disp, 0 to disallow */
808 i += aim_puttlv_16(newpacket->data+i, 0x000a, privacy);
812 i += aim_puttlv_str(newpacket->data+i, 0x0001, strlen(first), first);
814 i += aim_puttlv_str(newpacket->data+i, 0x0003, strlen(middle), middle);
816 i += aim_puttlv_str(newpacket->data+i, 0x0002, strlen(last), last);
818 i += aim_puttlv_str(newpacket->data+i, 0x0004, strlen(maiden), maiden);
820 i += aim_puttlv_str(newpacket->data+i, 0x000c, strlen(nickname), nickname);
822 i += aim_puttlv_str(newpacket->data+i, 0x0021, strlen(street), street);
824 i += aim_puttlv_str(newpacket->data+i, 0x0008, strlen(city), city);
826 i += aim_puttlv_str(newpacket->data+i, 0x0007, strlen(state), state);
828 i += aim_puttlv_str(newpacket->data+i, 0x000d, strlen(zip), zip);
830 newpacket->commandlen = i;
833 aim_tx_enqueue(sess, newpacket);
835 return(sess->snac_nextid);
838 faim_export unsigned long aim_setuserinterests(struct aim_session_t *sess, struct aim_conn_t *conn, char *interest1, char *interest2, char *interest3, char *interest4, char *interest5, unsigned short privacy)
840 struct command_tx_struct *newpacket;
841 int packlen = 0, i = 0;
846 packlen += (strlen(interest1) + 4);
848 packlen += (strlen(interest2) + 4);
850 packlen += (strlen(interest3) + 4);
852 packlen += (strlen(interest4) + 4);
854 packlen += (strlen(interest5) + 4) ;
857 if(!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, packlen+10)))
862 i = aim_putsnac(newpacket->data, 0x0002, 0x000f, 0x0000, 0);
864 /* 000a/0002: 0000 ?? ?privacy? */
865 i += aim_puttlv_16(newpacket->data+i, 0x000a, privacy);
868 i += aim_puttlv_str(newpacket->data+i, 0x000b, strlen(interest1), interest1);
870 i += aim_puttlv_str(newpacket->data+i, 0x000b, strlen(interest2), interest2);
872 i += aim_puttlv_str(newpacket->data+i, 0x000b, strlen(interest3), interest3);
874 i += aim_puttlv_str(newpacket->data+i, 0x000b, strlen(interest4), interest4);
876 i += aim_puttlv_str(newpacket->data+i, 0x000b, strlen(interest1), interest5);
878 newpacket->commandlen = i;
881 aim_tx_enqueue(sess, newpacket);
883 return(sess->snac_nextid);
886 faim_export unsigned long aim_icq_setstatus(struct aim_session_t *sess,
887 struct aim_conn_t *conn,
888 unsigned long status)
890 struct command_tx_struct *newpacket;
894 data = 0x00030000 | status; /* yay for error checking ;^) */
896 if(!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, 10 + 4)))
901 i = aim_putsnac(newpacket->data, 0x0001, 0x001e, 0x0000, 0x0000001e);
902 i += aim_puttlv_32(newpacket->data+i, 0x0006, data);
904 newpacket->commandlen = i;
907 aim_tx_enqueue(sess, newpacket);
909 return(sess->snac_nextid);