+ if (channel == 1) {
+ struct aim_userinfo_s *userinfo;
+ char *msg = NULL;
+ u_int icbmflags = 0;
+ char *tmpstr = NULL;
+ u_short flag1, flag2;
+
+ userinfo = va_arg(ap, struct aim_userinfo_s *);
+ msg = va_arg(ap, char *);
+ icbmflags = va_arg(ap, u_int);
+ flag1 = va_arg(ap, u_short);
+ flag2 = va_arg(ap, u_short);
+ va_end(ap);
+
+ printf("faimtest: icbm: sn = \"%s\"\n", userinfo->sn);
+ printf("faimtest: icbm: warnlevel = 0x%04x\n", userinfo->warnlevel);
+ printf("faimtest: icbm: class = 0x%04x ", userinfo->class);
+ if (userinfo->class & 0x0010)
+ printf("(FREE) ");
+ if (userinfo->class & 0x0001)
+ printf("(TRIAL) ");
+ if (userinfo->class & 0x0004)
+ printf("(AOL) ");
+ printf("\n");
+ printf("faimtest: icbm: membersince = %lu\n", userinfo->membersince);
+ printf("faimtest: icbm: onlinesince = %lu\n", userinfo->onlinesince);
+ printf("faimtest: icbm: idletime = 0x%04x\n", userinfo->idletime);
+ printf("faimtest: icbm: capabilities = 0x%04x\n", userinfo->capabilities);
+
+ printf("faimtest: icbm: icbmflags = ");
+ if (icbmflags & AIM_IMFLAGS_AWAY)
+ printf("away ");
+ if (icbmflags & AIM_IMFLAGS_ACK)
+ printf("ackrequest ");
+ printf("\n");
+
+ printf("faimtest: icbm: encoding flags = {%04x, %04x}\n", flag1, flag2);
+
+ printf("faimtest: icbm: message: %s\n", msg);
+
+ if (msg) {
+ int i = 0;
+
+ while (msg[i] == '<') {
+ if (msg[i] == '<') {
+ while (msg[i] != '>')
+ i++;
+ i++;
+ }
+ }
+ tmpstr = msg+i;
+
+ printf("tmpstr = %s\n", tmpstr);
+
+ if ( (strlen(tmpstr) >= 10) &&
+ (!strncmp(tmpstr, "disconnect", 10)) ) {
+ aim_send_im(sess, command->conn, "midendian", 0, "ta ta...");
+ aim_logoff(sess);
+ } else if (strstr(tmpstr, "goodday")) {
+ printf("faimtest: icbm: sending response\n");
+ aim_send_im(sess, command->conn, userinfo->sn, AIM_IMFLAGS_ACK, "Good day to you too.");
+ } else if (strstr(tmpstr, "warnme")) {
+ printf("faimtest: icbm: sending non-anon warning\n");
+ aim_send_warning(sess, command->conn, userinfo->sn, 0);
+ } else if (strstr(tmpstr, "anonwarn")) {
+ printf("faimtest: icbm: sending anon warning\n");
+ aim_send_warning(sess, command->conn, userinfo->sn, AIM_WARN_ANON);
+ } else if (!strncmp(tmpstr, "open chatnav", 12)) {
+ aim_bos_reqservice(sess, command->conn, AIM_CONN_TYPE_CHATNAV);
+ //aim_chat_join(sess, command->conn, "thishereisaname2_chat85");
+ } else if (!strncmp(tmpstr, "create", 6)) {
+ aim_chatnav_createroom(sess,aim_getconn_type(sess, AIM_CONN_TYPE_CHATNAV), (strlen(tmpstr) < 7)?"WorldDomination":tmpstr+7, 0x0004);
+ } else if (!strncmp(tmpstr, "close chatnav", 13)) {
+ struct aim_conn_t *chatnavconn;
+ chatnavconn = aim_getconn_type(sess, AIM_CONN_TYPE_CHATNAV);
+ aim_conn_kill(sess, &chatnavconn);
+ } else if (!strncmp(tmpstr, "join", 4)) {
+ aim_chat_join(sess, command->conn, 0x0004, "worlddomination");
+ } else if (!strncmp(tmpstr, "leave", 5))
+ aim_chat_leaveroom(sess, "worlddomination");
+ else if (!strncmp(tmpstr, "getinfo", 7)) {
+ aim_getinfo(sess, command->conn, "75784102", AIM_GETINFO_GENERALINFO);
+ aim_getinfo(sess, command->conn, "15853637", AIM_GETINFO_AWAYMESSAGE);
+ } else if (!strncmp(tmpstr, "open directim", 13)) {
+ struct aim_conn_t *newconn;
+ newconn = aim_directim_initiate(sess, command->conn, NULL, userinfo->sn);
+ //aim_conn_addhandler(sess, newconn, AIM_CB_FAM_OFT, AIM_CB_OFT_DIRECTIMINITIATE, faimtest_directim_initiate, 0);
+ } else if (!strncmp(tmpstr, "reqsendmsg", 10)) {
+ aim_send_im(sess, command->conn, "vaxherder", 0, "sendmsg 7900");
+ } else if (!strncmp(tmpstr, "sendmsg", 7)) {
+ int i;
+ i = atoi(tmpstr+8);
+ if (i < 10000) {
+ char *newbuf;
+ int z;
+
+ newbuf = malloc(i+1);
+ for (z = 0; z < i; z++) {
+ newbuf[z] = (z % 10)+0x30;
+ }
+ newbuf[i] = '\0';
+ aim_send_im(sess, command->conn, userinfo->sn, 0, newbuf);
+ free(newbuf);
+ }
+ } else {
+ printf("unknown command.\n");
+ aim_add_buddy(sess, command->conn, userinfo->sn);
+ }
+
+ }
+ }
+ /*
+ * Channel 2: Rendevous Request
+ */
+ else if (channel == 2) {
+ struct aim_userinfo_s *userinfo;
+ unsigned short reqclass;
+
+ reqclass = va_arg(ap, unsigned short);
+ switch (reqclass) {
+ case AIM_CAPS_VOICE: {