+faim_internal int aim_parse_msgack_middle(struct aim_session_t *sess, struct command_rx_struct *command)
+{
+ rxcallback_t userfunc = NULL;
+ char sn[MAXSNLEN];
+ unsigned short type;
+ int i = 10+8; /* skip SNAC and cookie */
+ int ret = 1;
+ unsigned char snlen;
+
+ type = aimutil_get16(command->data+i);
+ i += 2;
+
+ snlen = aimutil_get8(command->data+i);
+ i++;
+
+ memset(sn, 0, sizeof(sn));
+ strncpy(sn, (char *)command->data+i, snlen);
+
+ if ((userfunc = aim_callhandler(command->conn, 0x0004, 0x000c)))
+ ret = userfunc(sess, command, type, sn);
+
+ return ret;
+}
+
+faim_internal int aim_parse_ratechange_middle(struct aim_session_t *sess, struct command_rx_struct *command)
+{
+ rxcallback_t userfunc = NULL;
+ int ret = 1;
+ unsigned long newrate;
+
+ if (command->commandlen != 0x2f) {
+ printf("faim: unknown rate change length 0x%04x\n", command->commandlen);
+ return 1;
+ }
+
+ newrate = aimutil_get32(command->data+34);
+
+ if ((userfunc = aim_callhandler(command->conn, 0x0001, 0x000a)))
+ ret = userfunc(sess, command, newrate);
+
+ return ret;
+}
+
+faim_internal int aim_parse_evilnotify_middle(struct aim_session_t *sess, struct command_rx_struct *command)
+{
+ rxcallback_t userfunc = NULL;
+ int ret = 1, pos;
+ char *sn = NULL;
+
+ if(command->commandlen < 12) /* a warning level dec sends this */
+ return 1;
+
+ if ((pos = aimutil_get8(command->data+ 12)) > MAXSNLEN)
+ return 1;
+
+ if(!(sn = (char *)calloc(1, pos+1)))
+ return 1;
+
+ memcpy(sn, command->data+13, pos);
+
+ if ((userfunc = aim_callhandler(command->conn, 0x0001, 0x0010)))
+ ret = userfunc(sess, command, sn);
+
+ free(sn);
+
+ return ret;
+}
+
+faim_internal int aim_parsemotd_middle(struct aim_session_t *sess,
+ struct command_rx_struct *command, ...)