]> andersk Git - libfaim.git/blobdiff - src/im.c
- Wed Aug 29 16:59:24 PDT 2001
[libfaim.git] / src / im.c
index af771faf72564b447293b791ded029e58dc6d39d..143f4d765a04ab32317ec2c11cfcbc24e105bb0e 100644 (file)
--- a/src/im.c
+++ b/src/im.c
@@ -578,6 +578,8 @@ static int incomingim_ch1(struct aim_session_t *sess, aim_module_t *mod,  struct
 
                } else if ((type == 0x0008) && (length == 0x000c)) { /* I-HAVE-A-REALLY-PURTY-ICON Flag */
 
+                       args.iconchecksum = aimutil_get32(data+i);
+                       args.iconlength = aimutil_get32(data+i+4);
                        args.iconstamp = aimutil_get32(data+i+8);
                        args.icbmflags |= AIM_IMFLAGS_HASICON;
 
@@ -655,11 +657,11 @@ static int incomingim_ch2(struct aim_session_t *sess, aim_module_t *mod,  struct
        }
 
        /* 
-       * What follows may be TLVs or nothing, depending on the
-       * purpose of the message.
-       *
-       * Ack packets for instance have nothing more to them.
-       */
+        * What follows may be TLVs or nothing, depending on the
+        * purpose of the message.
+        *
+        * Ack packets for instance have nothing more to them.
+        */
        list2 = aim_readtlvchain(block1->value+2+8+16, block1->length-2-8-16);
 
        if (!list2 || ((args.reqclass != AIM_CAPS_IMIMAGE) && !(aim_gettlv(list2, 0x2711, 1)))) {
@@ -719,7 +721,7 @@ static int incomingim_ch2(struct aim_session_t *sess, aim_module_t *mod,  struct
 
                miscinfo = aim_gettlv(list2, 0x2711, 1);
 
-               /* aimutil_get32(miscinfo->value+curpos); i don't know what this is */
+               args.info.icon.checksum = aimutil_get32(miscinfo->value+curpos);
                curpos += 4;
                args.info.icon.length = aimutil_get32(miscinfo->value+curpos);
                curpos += 4;
@@ -1131,37 +1133,31 @@ static int paraminfo(struct aim_session_t *sess, aim_module_t *mod, struct comma
 
 static int missedcall(struct aim_session_t *sess, aim_module_t *mod, struct command_rx_struct *rx, aim_modsnac_t *snac, unsigned char *data, int datalen)
 {
-       int i = 0;
+       int i, ret = 0;
        aim_rxcallback_t userfunc;
        unsigned short channel, nummissed, reason;
        struct aim_userinfo_s userinfo;
+       
+       for (i = 0; i < datalen; ) {
 
-       /*
-        * XXX: supposedly, this entire packet can repeat as many times
-        * as necessary. Should implement that.
-        */
+               /* Channel ID. */
+               channel = aimutil_get16(data+i);
+               i += 2;
 
-       /*
-        * Channel ID.
-        */
-       channel = aimutil_get16(data+i);
-       i += 2;
+               /* Extract the standard user info block. */
+               i += aim_extractuserinfo(sess, data+i, &userinfo);
 
-       /*
-        * Extract the standard user info block.
-        */
-       i += aim_extractuserinfo(sess, data+i, &userinfo);
-
-       nummissed = aimutil_get16(data+i);
-       i += 2;
+               nummissed = aimutil_get16(data+i);
+               i += 2;
 
-       reason = aimutil_get16(data+i);
-       i += 2;
+               reason = aimutil_get16(data+i);
+               i += 2;
 
-       if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype)))
-               return userfunc(sess, rx, channel, &userinfo, nummissed, reason);
+               if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype)))
+                        ret = userfunc(sess, rx, channel, &userinfo, nummissed, reason);
+       }
 
-       return 0;
+       return ret;
 }
 
 static int msgack(struct aim_session_t *sess, aim_module_t *mod, struct command_rx_struct *rx, aim_modsnac_t *snac, unsigned char *data, int datalen)
This page took 0.53006 seconds and 4 git commands to generate.