]> andersk Git - libfaim.git/commitdiff
- Sat Sep 8 20:18:34 PDT 2001
authormid <mid>
Sun, 9 Sep 2001 03:30:40 +0000 (03:30 +0000)
committermid <mid>
Sun, 9 Sep 2001 03:30:40 +0000 (03:30 +0000)
  - Split up the ICBM Channel 2 handlers a bit more
  - Add a stub parser for recieving buddy lists.  It will stay that way until
      someone decides on a good API for passing lists like this to the client.
      In case someone does, the same standard will be used for setbuddylist and
      the as yet nonexistant support for server-side buddy lists.
  - Make infochange work again. I still don't like it, but I don't want to
      fix it.

CHANGES
src/admin.c
src/im.c
utils/faimtest/faimtest.c

diff --git a/CHANGES b/CHANGES
index 053fd6af41217169443d611955991eb02f3bfb07..7a968be4d70000277b9ce30adfdff797057472c6 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,15 @@
 
 No release numbers
 ------------------
+ - Sat Sep  8 20:18:34 PDT 2001
+  - Split up the ICBM Channel 2 handlers a bit more
+  - Add a stub parser for recieving buddy lists.  It will stay that way until
+      someone decides on a good API for passing lists like this to the client.
+      In case someone does, the same standard will be used for setbuddylist and
+      the as yet nonexistant support for server-side buddy lists.
+  - Make infochange work again. I still don't like it, but I don't want to 
+      fix it.
+
  - Sat Sep  8 19:05:05 PDT 2001
   - Redo ICQ login
   - Fix search by email (oops).
index 260c8fe67a39b567b4a7b710ea78c43fc6efd33c..8fb559ec4b2db76e7f596f86327c4ae9170eb1b8 100644 (file)
@@ -5,8 +5,6 @@
 /* called for both reply and change-reply */
 static int infochange(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
 {
-#ifdef MID_FINALLY_REWROTE_ALL_THE_CRAP
-       int i;
 
        /*
         * struct {
@@ -15,45 +13,39 @@ static int infochange(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, a
         *    aim_tlv_t tlvs[tlvcount];
         *  } admin_info[n];
         */
-       for (i = 0; i < datalen; ) {
-               int perms, tlvcount;
+       while (aim_bstream_empty(bs)) {
+               fu16_t perms, tlvcount;
 
-               perms = aimutil_get16(data+i);
-               i += 2;
+               perms = aimbs_get16(bs);
+               tlvcount = aimbs_get16(bs);
 
-               tlvcount = aimutil_get16(data+i);
-               i += 2;
-
-               while (tlvcount) {
+               while (tlvcount && aim_bstream_empty(bs)) {
                        aim_rxcallback_t userfunc;
-                       aim_tlv_t *tlv;
+                       fu16_t type, len;
+                       fu8_t *val;
                        int str = 0;
 
-                       if ((aimutil_get16(data+i) == 0x0011) ||
-                                       (aimutil_get16(data+i) == 0x0004))
+                       type = aimbs_get16(bs);
+                       len = aimbs_get16(bs);
+
+                       if ((type == 0x0011) || (type == 0x0004))
                                str = 1;
 
                        if (str)
-                               tlv = aim_grabtlvstr(data+i);
+                               val = aimbs_getstr(bs, len);
                        else
-                               tlv = aim_grabtlv(data+i);
+                               val = aimbs_getraw(bs, len);
 
                        /* XXX fix so its only called once for the entire packet */
                        if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype)))
-                               userfunc(sess, rx, perms, tlv->type, tlv->length, tlv->value, str);
+                               userfunc(sess, rx, (snac->subtype == 0x0005) ? 1 : 0, perms, type, len, val, str);
 
-                       if (tlv)
-                               i += 2+2+tlv->length;
-
-                       if (tlv && tlv->value)
-                               free(tlv->value);
-                       if (tlv)
-                               free(tlv);
+                       free(val);
 
                        tlvcount--;
                }
        }
-#endif /* MID_FINALLY_REWROTE_ALL_THE_CRAP */
+
        return 1;
 }
 
index 1c7e795e255e4e0ce29894117dda6deca750b559..a025bc148797fddaa81655f4d932e71f8535e8a7 100644 (file)
--- a/src/im.c
+++ b/src/im.c
@@ -624,6 +624,68 @@ static int incomingim_ch1(aim_session_t *sess, aim_module_t *mod, aim_frame_t *r
        return ret;
 }
 
+static int incomingim_ch2_buddylist(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, struct aim_userinfo_s *userinfo, struct aim_incomingim_ch2_args *args, aim_tlvlist_t *list2)
+{
+       aim_rxcallback_t userfunc;
+       int ret = 0;
+       aim_tlv_t *tse;
+       aim_bstream_t tbs;
+
+       if (args->status != 0x0000)
+               return 1; /* ignore it -- not sure what it means */
+
+       tse = aim_gettlv(list2, 0x2711, 1);
+       aim_bstream_init(&tbs, tse->value, tse->length);
+
+       /*
+        * This goes like this...
+        *
+        *   group name length
+        *   group name
+        *     num of buddies in group
+        *     buddy name length
+        *     buddy name
+        *     buddy name length
+        *     buddy name
+        *     ...
+        *   group name length
+        *   group name
+        *     num of buddies in group
+        *     buddy name length
+        *     buddy name
+        *     ...
+        *   ...
+        */
+       while (aim_bstream_empty(&tbs)) {
+               fu16_t gnlen, numb;
+               int i;
+               char *gn;
+
+               gnlen = aimbs_get16(&tbs);
+               gn = aimbs_getstr(&tbs, gnlen);
+               numb = aimbs_get16(&tbs);
+
+               for (i = 0; i < numb; i++) {
+                       fu16_t bnlen;
+                       char *bn;
+
+                       bnlen = aimbs_get16(&tbs);
+                       bn = aimbs_getstr(&tbs, bnlen);
+
+                       faimdprintf(sess, 0, "got a buddy list from %s: group %s, buddy %s\n", userinfo->sn, gn, bn);
+
+                       free(bn);
+               }
+
+               free(gn);
+       }
+
+       if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype)))
+               ret = userfunc(sess, rx, 0x0002, userinfo, args);
+
+       return ret;
+}
+
 static int incomingim_ch2_buddyicon(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, struct aim_userinfo_s *userinfo, struct aim_incomingim_ch2_args *args, aim_tlvlist_t *list2)
 {
        aim_rxcallback_t userfunc;
@@ -647,6 +709,172 @@ static int incomingim_ch2_buddyicon(aim_session_t *sess, aim_module_t *mod, aim_
        return ret;
 }
 
+static int incomingim_ch2_voice(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, struct aim_userinfo_s *userinfo, struct aim_incomingim_ch2_args *args, aim_tlvlist_t *list2)
+{
+       aim_msgcookie_t *cachedcook;
+       int ret = 0;
+       aim_rxcallback_t userfunc;
+
+       faimdprintf(sess, 1, "rend: voice!\n");
+
+       if (!(cachedcook = (aim_msgcookie_t*)calloc(1, sizeof(aim_msgcookie_t))))
+               return 0;
+
+       memcpy(cachedcook->cookie, args->cookie, 8);
+       cachedcook->type = AIM_COOKIETYPE_OFTVOICE;
+       cachedcook->data = NULL;
+
+       if (aim_cachecookie(sess, cachedcook) == -1)
+               faimdprintf(sess, 0, "ERROR caching message cookie\n");
+
+       /* XXX: implement all this */
+
+       if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) 
+               ret = userfunc(sess, rx, 0x0002, userinfo, &args);
+
+       return ret;
+}
+
+static int incomingim_ch2_chat(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, struct aim_userinfo_s *userinfo, struct aim_incomingim_ch2_args *args, aim_tlvlist_t *list2)
+{
+       aim_tlv_t *miscinfo;
+       aim_bstream_t tbs;
+       aim_rxcallback_t userfunc;
+       int ret = 0;
+
+       miscinfo = aim_gettlv(list2, 0x2711, 1);
+       aim_bstream_init(&tbs, miscinfo->value, miscinfo->length);
+
+       aim_chat_readroominfo(&tbs, &args->info.chat.roominfo);
+                 
+       if (aim_gettlv(list2, 0x000c, 1))
+               args->info.chat.msg = aim_gettlv_str(list2, 0x000c, 1);
+       
+       if (aim_gettlv(list2, 0x000d, 1))
+               args->info.chat.encoding = aim_gettlv_str(list2, 0x000d, 1);
+       
+       if (aim_gettlv(list2, 0x000e, 1))
+               args->info.chat.lang = aim_gettlv_str(list2, 0x000e, 1);
+
+       if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype)))
+               ret = userfunc(sess, rx, 0x0002, userinfo, &args);
+
+       /* XXX free_roominfo */
+       free(args->info.chat.roominfo.name);
+       free(args->info.chat.msg);
+       free(args->info.chat.encoding);
+       free(args->info.chat.lang);
+
+       return ret;
+}
+
+static int incomingim_ch2_getfile(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, struct aim_userinfo_s *userinfo, struct aim_incomingim_ch2_args *args, aim_tlvlist_t *list2)
+{
+       char ip[30];
+       aim_msgcookie_t *cachedcook;
+       aim_tlv_t *miscinfo;
+       aim_tlv_t *iptlv, *porttlv;
+       int ret = 0;
+       aim_rxcallback_t userfunc;
+
+       memset(ip, 0, 30);
+
+       if (!(cachedcook = calloc(1, sizeof(aim_msgcookie_t)))) {
+               aim_freetlvchain(&list2);
+               return 0;
+       }
+
+       if (!(miscinfo = aim_gettlv(list2, 0x2711, 1)) || 
+               !(iptlv = aim_gettlv(list2, 0x0003, 1)) || 
+               !(porttlv = aim_gettlv(list2, 0x0005, 1))) {
+               
+               faimdprintf(sess, 0, "rend: badly damaged file get request from %s...\n", userinfo->sn);
+               aim_cookie_free(sess, cachedcook);
+               aim_freetlvchain(&list2);
+               
+               return 0;
+       }
+
+       snprintf(ip, 30, "%d.%d.%d.%d:%d",
+               aimutil_get8(iptlv->value+0),
+               aimutil_get8(iptlv->value+1),
+               aimutil_get8(iptlv->value+2),
+               aimutil_get8(iptlv->value+3),
+               aimutil_get16(porttlv->value));
+
+       faimdprintf(sess, 0, "rend: file get request from %s (%s)\n", userinfo->sn, ip);
+
+       args->info.getfile.ip = ip;
+       memcpy(args->info.getfile.cookie, args->cookie, 8);
+
+       if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype)))
+               ret = userfunc(sess, rx, 0x0002, userinfo, &args);
+
+       return ret;
+}
+
+static int incomingim_ch2_sendfile(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, struct aim_userinfo_s *userinfo, struct aim_incomingim_ch2_args *args, aim_tlvlist_t *list2)
+{
+#if 0
+       char ip[30];
+       aim_msgcookie_t *cachedcook;
+       aim_tlv_t *miscinfo;
+       aim_tlv_t *iptlv, *porttlv;
+       int ret =0;
+       aim_rxcallback_t userfunc;
+       char *desc = NULL;
+
+       memset(ip, 0, 30);
+
+       if (!(cachedcook = calloc(1, sizeof(aim_msgcookie_t)))) 
+               return 0;
+
+       if (!(miscinfo = aim_gettlv(list2, 0x2711, 1)) || 
+               !(iptlv = aim_gettlv(list2, 0x0003, 1)) || 
+               !(porttlv = aim_gettlv(list2, 0x0005, 1))) {
+       
+               faimdprintf(sess, 0, "rend: badly damaged file get request from %s...\n", userinfo->sn);
+               aim_cookie_free(sess, cachedcook);
+
+               return 0;
+       }
+
+       snprintf(ip, 30, "%d.%d.%d.%d:%d",
+               aimutil_get8(iptlv->value+0),
+               aimutil_get8(iptlv->value+1),
+               aimutil_get8(iptlv->value+2),
+               aimutil_get8(iptlv->value+3),
+               aimutil_get16(porttlv->value));
+
+       if (aim_gettlv(list2, 0x000c, 1))
+               desc = aim_gettlv_str(list2, 0x000c, 1);
+
+       faimdprintf(sess, 0, "rend: file transfer request from %s: %s (%s)\n",
+               userinfo->sn, desc, ip);
+
+       memcpy(cachedcook->cookie, args->cookie, 8);
+
+       ft = malloc(sizeof(struct aim_filetransfer_priv)); /* XXX */
+       strncpy(ft->sn, userinfo.sn, sizeof(ft->sn));
+       strncpy(ft->ip, ip, sizeof(ft->ip));
+       strncpy(ft->fh.name, miscinfo->value+8, sizeof(ft->fh.name));
+       cachedcook->type = AIM_COOKIETYPE_OFTSEND;
+       cachedcook->data = ft;
+
+       if (aim_cachecookie(sess, cachedcook) == -1)
+               faimdprintf(sess, 0, "ERROR caching message cookie\n");
+
+       aim_accepttransfer(sess, rx->conn, ft->sn, cookie, AIM_CAPS_SENDFILE);
+
+       if (desc)
+               free(desc);
+
+       if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype)))
+               ret = userfunc(sess, rx, 0x0002, userinfo, &args);
+#endif
+       return 0;
+}
+
 static int incomingim_ch2_imimage(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, struct aim_userinfo_s *userinfo, struct aim_incomingim_ch2_args *args, aim_tlvlist_t *list2)
 {
        aim_rxcallback_t userfunc;
@@ -708,7 +936,6 @@ static int incomingim_ch2_imimage(aim_session_t *sess, aim_module_t *mod, aim_fr
 /* XXX Ugh.  I think its obvious. */
 static int incomingim_ch2(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, fu16_t channel, struct aim_userinfo_s *userinfo, aim_tlvlist_t *tlvlist, fu8_t *cookie)
 {
-       aim_rxcallback_t userfunc;
        aim_tlv_t *block1;
        aim_tlvlist_t *list2;
        int ret = 0;
@@ -822,162 +1049,21 @@ static int incomingim_ch2(aim_session_t *sess, aim_module_t *mod, aim_frame_t *r
        /*
         * The rest of the handling depends on what type it is.
         */
-       if (args.reqclass & AIM_CAPS_BUDDYICON) {
-
+       if (args.reqclass & AIM_CAPS_BUDDYICON)
                ret = incomingim_ch2_buddyicon(sess, mod, rx, snac, userinfo, &args, list2);
-
-       } else if (args.reqclass & AIM_CAPS_VOICE) {
-               aim_msgcookie_t *cachedcook;
-
-               faimdprintf(sess, 1, "rend: voice!\n");
-
-               if(!(cachedcook = (aim_msgcookie_t*)calloc(1, sizeof(aim_msgcookie_t)))) {
-                       aim_freetlvchain(&list2);
-                       return 0;
-               }
-
-               memcpy(cachedcook->cookie, cookie, 8);
-               cachedcook->type = AIM_COOKIETYPE_OFTVOICE;
-               cachedcook->data = NULL;
-
-               if (aim_cachecookie(sess, cachedcook) == -1)
-                       faimdprintf(sess, 0, "ERROR caching message cookie\n");
-
-               /* XXX: implement all this */
-
-               if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) 
-                       ret = userfunc(sess, rx, channel, userinfo, &args);
-
-       } else if (args.reqclass & AIM_CAPS_IMIMAGE) {
-
+       else if (args.reqclass & AIM_CAPS_SENDBUDDYLIST)
+               ret = incomingim_ch2_buddylist(sess, mod, rx, snac, userinfo, &args, list2);
+       else if (args.reqclass & AIM_CAPS_VOICE)
+               ret = incomingim_ch2_voice(sess, mod, rx, snac, userinfo, &args, list2);
+       else if (args.reqclass & AIM_CAPS_IMIMAGE)
                ret = incomingim_ch2_imimage(sess, mod, rx, snac, userinfo, &args, list2);
-
-       } else if (args.reqclass & AIM_CAPS_CHAT) {
-               aim_tlv_t *miscinfo;
-               aim_bstream_t tbs;
-
-               miscinfo = aim_gettlv(list2, 0x2711, 1);
-
-               aim_bstream_init(&tbs, miscinfo->value, miscinfo->length);
-
-               aim_chat_readroominfo(&tbs, &args.info.chat.roominfo);
-                         
-               if (aim_gettlv(list2, 0x000c, 1))
-                       args.info.chat.msg = aim_gettlv_str(list2, 0x000c, 1);
-               
-               if (aim_gettlv(list2, 0x000d, 1))
-                       args.info.chat.encoding = aim_gettlv_str(list2, 0x000d, 1);
-               
-               if (aim_gettlv(list2, 0x000e, 1))
-                       args.info.chat.lang = aim_gettlv_str(list2, 0x000e, 1);
-
-               if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype)))
-                       ret = userfunc(sess, rx, channel, userinfo, &args);
-
-               free(args.info.chat.roominfo.name);
-               free(args.info.chat.msg);
-               free(args.info.chat.encoding);
-               free(args.info.chat.lang);
-
-       } else if (args.reqclass & AIM_CAPS_GETFILE) {
-               char ip[30];
-               aim_msgcookie_t *cachedcook;
-               aim_tlv_t *miscinfo;
-               aim_tlv_t *iptlv, *porttlv;
-
-               memset(ip, 0, 30);
-
-               if (!(cachedcook = calloc(1, sizeof(aim_msgcookie_t)))) {
-                       aim_freetlvchain(&list2);
-                       return 0;
-               }
-
-               if (!(miscinfo = aim_gettlv(list2, 0x2711, 1)) || 
-                       !(iptlv = aim_gettlv(list2, 0x0003, 1)) || 
-                       !(porttlv = aim_gettlv(list2, 0x0005, 1))) {
-                       
-                       faimdprintf(sess, 0, "rend: badly damaged file get request from %s...\n", userinfo->sn);
-                       aim_cookie_free(sess, cachedcook);
-                       aim_freetlvchain(&list2);
-                       
-                       return 0;
-               }
-
-               snprintf(ip, 30, "%d.%d.%d.%d:%d",
-                       aimutil_get8(iptlv->value+0),
-                       aimutil_get8(iptlv->value+1),
-                       aimutil_get8(iptlv->value+2),
-                       aimutil_get8(iptlv->value+3),
-                       aimutil_get16(porttlv->value));
-
-               faimdprintf(sess, 0, "rend: file get request from %s (%s)\n", userinfo->sn, ip);
-
-               args.info.getfile.ip = ip;
-               args.info.getfile.cookie = cookie;
-
-               if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype)))
-                       ret = userfunc(sess, rx, channel, userinfo, &args);
-
-       } else if (args.reqclass & AIM_CAPS_SENDFILE) {
-#if 0 
-               char ip[30];
-               aim_msgcookie_t *cachedcook;
-               aim_tlv_t *miscinfo;
-               aim_tlv_t *iptlv, *porttlv;
-
-               memset(ip, 0, 30);
-
-               if (!(cachedcook = calloc(1, sizeof(aim_msgcookie_t)))) {
-                       aim_freetlvchain(&list2);
-                       return 0;
-               }
-
-               if (!(miscinfo = aim_gettlv(list2, 0x2711, 1)) || 
-                       !(iptlv = aim_gettlv(list2, 0x0003, 1)) || 
-                       !(porttlv = aim_gettlv(list2, 0x0005, 1))) {
-               
-                       faimdprintf(sess, 0, "rend: badly damaged file get request from %s...\n", userinfo->sn);
-                       aim_cookie_free(sess, cachedcook);
-                       aim_freetlvchain(&list2);
-
-                       return 0;
-               }
-
-               snprintf(ip, 30, "%d.%d.%d.%d:%d",
-                       aimutil_get8(iptlv->value+0),
-                       aimutil_get8(iptlv->value+1),
-                       aimutil_get8(iptlv->value+2),
-                       aimutil_get8(iptlv->value+3),
-                       aimutil_get16(porttlv->value));
-
-               if (aim_gettlv(list2, 0x000c, 1))
-                       desc = aim_gettlv_str(list2, 0x000c, 1);
-
-               faimdprintf(sess, 0, "rend: file transfer request from %s: %s (%s)\n",
-                       userinfo->sn, desc, ip);
-
-               memcpy(cachedcook->cookie, cookie, 8);
-
-               ft = malloc(sizeof(struct aim_filetransfer_priv)); /* XXX */
-               strncpy(ft->sn, userinfo.sn, sizeof(ft->sn));
-               strncpy(ft->ip, ip, sizeof(ft->ip));
-               strncpy(ft->fh.name, miscinfo->value+8, sizeof(ft->fh.name));
-               cachedcook->type = AIM_COOKIETYPE_OFTSEND;
-               cachedcook->data = ft;
-
-               if (aim_cachecookie(sess, cachedcook) == -1)
-                       faimdprintf(sess, 0, "ERROR caching message cookie\n");
-
-               aim_accepttransfer(sess, rx->conn, ft->sn, cookie, AIM_CAPS_SENDFILE);
-
-               if (desc)
-                       free(desc);
-
-               if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype)))
-                       ret = userfunc(sess, rx, channel, userinfo, &args);
-
-#endif 
-       } else
+       else if (args.reqclass & AIM_CAPS_CHAT)
+               ret = incomingim_ch2_chat(sess, mod, rx, snac, userinfo, &args, list2);
+       else if (args.reqclass & AIM_CAPS_GETFILE)
+               ret = incomingim_ch2_getfile(sess, mod, rx, snac, userinfo, &args, list2);
+       else if (args.reqclass & AIM_CAPS_SENDFILE)
+               ret = incomingim_ch2_sendfile(sess, mod, rx, snac, userinfo, &args, list2);
+       else
                faimdprintf(sess, 0, "rend: unknown rendezvous 0x%04x\n", args.reqclass);
 
        aim_freetlvchain(&list2);
index b18a7127da6bcdcd2b349e87809e84f655f7bbd6..041b08f8329bd412720377970e5cdb5cb35d0b73 100644 (file)
@@ -401,7 +401,6 @@ int faimtest_parse_connerr(aim_session_t *sess, aim_frame_t *fr, ...)
        return 1;
 }
 
-#if 0
 static int faimtest_rateresp_auth(aim_session_t *sess, aim_frame_t *fr, ...)
 {
 
@@ -427,9 +426,6 @@ int faimtest_accountconfirm(aim_session_t *sess, aim_frame_t *fr, ...)
        return 1;
 }
 
-
-#endif
-
 #if 0
 /* 
  * This kind of function is really not legal in the new bstream way...
@@ -456,6 +452,28 @@ int faimtest_parse_unknown(aim_session_t *sess, aim_frame_t *fr, ...)
 }
 #endif
 
+static int faimtest_infochange(aim_session_t *sess, aim_frame_t *fr, ...)
+{
+       fu16_t change = 0, perms, type;
+       int length, str;
+       char *val;
+       va_list ap;
+
+       va_start(ap, fr);
+       change = va_arg(ap, int);
+       perms = va_arg(ap, fu16_t);
+       type = va_arg(ap, fu16_t);
+       length = va_arg(ap, int);
+       val = va_arg(ap, char *);
+       str = va_arg(ap, int);
+       va_end(ap);
+
+       dvprintf("info%s: perms = %d, type = %x, length = %d, val = %s\n", change?" change":"", perms, type, length, str?val:"(not string)");
+
+       return 1;
+}
+
+
 int faimtest_handleredirect(aim_session_t *sess, aim_frame_t *fr, ...)
 {
        va_list ap;
@@ -486,7 +504,6 @@ int faimtest_handleredirect(aim_session_t *sess, aim_frame_t *fr, ...)
                }
 #endif
        } else if (serviceid == 0x0007) {  /* Authorizer */
-#if 0
                aim_conn_t *tstconn;
                
                tstconn = aim_newconn(sess, AIM_CONN_TYPE_AUTH, ip);
@@ -496,8 +513,8 @@ int faimtest_handleredirect(aim_session_t *sess, aim_frame_t *fr, ...)
                        aim_conn_addhandler(sess, tstconn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_FLAPVER, faimtest_flapversion, 0);
                        aim_conn_addhandler(sess, tstconn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNCOMPLETE, faimtest_conncomplete, 0);
                        aim_conn_addhandler(sess, tstconn, 0x0001, 0x0003, faimtest_serverready, 0);
-                       aim_conn_addhandler(sess, tstconn, 0x0001, 0x0007, faimtest_rateresp, 0); /* rate info */
-                       aim_conn_addhandler(sess, tstconn, AIM_CB_FAM_GEN, 0x0018, faimtest_hostversions, 0);
+                       aim_conn_addhandler(sess, tstconn, 0x0001, 0x0007, faimtest_rateresp_auth, 0); /* rate info */
+                       //aim_conn_addhandler(sess, tstconn, AIM_CB_FAM_GEN, 0x0018, faimtest_hostversions, 0);
                        aim_conn_addhandler(sess, tstconn, 0x0007, 0x0007, faimtest_accountconfirm, 0);
                        aim_conn_addhandler(sess, tstconn, 0x0007, 0x0003, faimtest_infochange, 0);
                        aim_conn_addhandler(sess, tstconn, 0x0007, 0x0005, faimtest_infochange, 0);
@@ -505,7 +522,6 @@ int faimtest_handleredirect(aim_session_t *sess, aim_frame_t *fr, ...)
                        aim_auth_sendcookie(sess, tstconn, cookie);
                        dprintf("sent cookie to authorizer host\n");
                }
-#endif
        } else if (serviceid == 0x000d) {  /* ChatNav */
 
                chatnav_redirect(sess, ip, cookie);
@@ -542,7 +558,7 @@ static int faimtest_rateresp_bos(aim_session_t *sess, aim_frame_t *fr, ...)
        aim_bos_ackrateresp(sess, fr->conn);  /* ack rate info response */
        aim_bos_reqpersonalinfo(sess, fr->conn);
        aim_bos_reqlocaterights(sess, fr->conn);
-       aim_bos_setprofile(sess, fr->conn, profile, awaymsg, AIM_CAPS_BUDDYICON | AIM_CAPS_CHAT | AIM_CAPS_GETFILE | AIM_CAPS_SENDFILE | AIM_CAPS_IMIMAGE /*| AIM_CAPS_GAMES | AIM_CAPS_SAVESTOCKS*/);
+       aim_bos_setprofile(sess, fr->conn, profile, awaymsg, AIM_CAPS_BUDDYICON | AIM_CAPS_CHAT | AIM_CAPS_GETFILE | AIM_CAPS_SENDFILE | AIM_CAPS_IMIMAGE | AIM_CAPS_GAMES | AIM_CAPS_SAVESTOCKS | AIM_CAPS_SENDBUDDYLIST);
        aim_bos_reqbuddyrights(sess, fr->conn);
 
        /* send the buddy list and profile (required, even if empty) */
@@ -1322,31 +1338,6 @@ static int faimtest_parse_incoming_im(aim_session_t *sess, aim_frame_t *fr, ...)
        return 1;
 }
 
-#ifdef MID_REWROTE_ALL_THE_CRAP
-static int faimtest_infochange(aim_session_t *sess, aim_frame_t *fr, ...)
-{
-       fu16_t change = 0, perms, type;
-       int length, str;
-       char *val;
-       va_list ap;
-
-       va_start(ap, fr);
-       perms = va_arg(ap, fu16_t);
-       type = va_arg(ap, fu16_t);
-       length = va_arg(ap, int);
-       val = va_arg(ap, char *);
-       str = va_arg(ap, int);
-       va_end(ap);
-
-       if (aimutil_get16(command->data+2) == 0x0005)
-               change = 1;
-
-       dvprintf("info%s: perms = %d, type = %x, length = %d, val = %s\n", change?" change":"", perms, type, length, str?val:"(not string)");
-
-       return 1;
-}
-#endif
-
 static int faimtest_parse_oncoming(aim_session_t *sess, aim_frame_t *fr, ...)
 {
        struct aim_userinfo_s *userinfo;
This page took 0.116044 seconds and 5 git commands to generate.