+int aim_negchan_middle(struct aim_session_t *sess,
+ struct command_rx_struct *command)
+{
+ struct aim_tlvlist_t *tlvlist;
+ char *msg = NULL;
+ unsigned short code = 0;
+ struct aim_tlv_t *tmptlv;
+ rxcallback_t userfunc = NULL;
+ int ret = 1;
+
+ tlvlist = aim_readtlvchain(command->data, command->commandlen);
+
+ if ((tmptlv = aim_gettlv(tlvlist, 0x0009, 1)))
+ code = aimutil_get16(tmptlv->value);
+
+ if ((tmptlv = aim_gettlv(tlvlist, 0x000b, 1)))
+ msg = aim_gettlv_str(tlvlist, 0x000b, 1);
+
+ userfunc = aim_callhandler(command->conn,
+ AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNERR);
+ if (userfunc)
+ ret = userfunc(sess, command, code, msg);
+
+ aim_freetlvchain(&tlvlist);
+ free(msg);
+
+ return ret;
+}
+