+faim_internal int aim_parse_accountconfirm(struct aim_session_t *sess,
+ struct command_rx_struct *command)
+{
+ rxcallback_t userfunc = NULL;
+ int ret = 1;
+ int status = -1;
+
+ status = aimutil_get16(command->data+10);
+
+ if ((userfunc = aim_callhandler(command->conn, 0x0007, 0x0007)))
+ ret = userfunc(sess, command, status);
+
+ return ret;
+}
+
+faim_internal int aim_parse_infochange(struct aim_session_t *sess,
+ struct command_rx_struct *command)
+{
+ unsigned short subtype; /* called for both reply and change-reply */
+ int i;
+
+ subtype = aimutil_get16(command->data+2);
+
+ /*
+ * struct {
+ * unsigned short perms;
+ * unsigned short tlvcount;
+ * aim_tlv_t tlvs[tlvcount];
+ * } admin_info[n];
+ */
+ for (i = 10; i < command->commandlen; ) {
+ int perms, tlvcount;
+
+ perms = aimutil_get16(command->data+i);
+ i += 2;
+
+ tlvcount = aimutil_get16(command->data+i);
+ i += 2;
+
+ while (tlvcount) {
+ rxcallback_t userfunc;
+ struct aim_tlv_t *tlv;
+ int str = 0;
+
+ if ((aimutil_get16(command->data+i) == 0x0011) ||
+ (aimutil_get16(command->data+i) == 0x0004))
+ str = 1;
+
+ if (str)
+ tlv = aim_grabtlvstr(command->data+i);
+ else
+ tlv = aim_grabtlv(command->data+i);
+
+ /* XXX fix so its only called once for the entire packet */
+ if ((userfunc = aim_callhandler(command->conn, 0x0007, subtype)))
+ userfunc(sess, command, perms, tlv->type, tlv->length, tlv->value, str);
+
+ if (tlv)
+ i += 2+2+tlv->length;
+
+ if (tlv && tlv->value)
+ free(tlv->value);
+ if (tlv)
+ free(tlv);
+
+ tlvcount--;
+ }
+ }
+
+ return 1;
+}
+