workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_BUD, AIM_CB_BUD_DEFAULT, workingPtr);
}
break;
- case 0x0004: /* Family: Messeging */
+ case 0x0004: /* Family: Messaging */
switch (subtype) {
case 0x0001:
workingPtr->handled = aim_parse_msgerror_middle(sess, workingPtr);
workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_STS, AIM_CB_STS_DEFAULT, workingPtr);
break;
}
+ case 0x0013: {
+ printf("lalala: 0x%04x/0x%04x\n", family, subtype);
+ break;
+ }
case AIM_CB_FAM_SPECIAL:
workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, family, subtype, workingPtr);
break;
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;
+ int ret = 1;
+ int i;
+ unsigned short newevil;
+ struct aim_userinfo_s userinfo;
- if(!(sn = (char *)calloc(1, pos+1)))
- return 1;
+ i = 10;
+ newevil = aimutil_get16(command->data+10);
+ i += 2;
- memcpy(sn, command->data+13, pos);
+ memset(&userinfo, 0, sizeof(struct aim_userinfo_s));
+ if (command->commandlen-i)
+ i += aim_extractuserinfo(command->data+i, &userinfo);
if ((userfunc = aim_callhandler(command->conn, 0x0001, 0x0010)))
- ret = userfunc(sess, command, sn);
+ ret = userfunc(sess, command, newevil, &userinfo);
- free(sn);
-
return ret;
}
faim_internal int aim_parse_generalerrs(struct aim_session_t *sess,
struct command_rx_struct *command, ...)
{
- u_short family;
- u_short subtype;
+ unsigned short family;
+ unsigned short subtype;
+ int ret = 1;
+ int error = 0;
+ rxcallback_t userfunc = NULL;
family = aimutil_get16(command->data+0);
subtype= aimutil_get16(command->data+2);
- switch(family)
- {
- default:
- /* Unknown family */
- return aim_callhandler_noparam(sess, command->conn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_UNKNOWN, command);
- }
+ if (command->commandlen > 10)
+ error = aimutil_get16(command->data+10);
- return 1;
+ if ((userfunc = aim_callhandler(command->conn, family, subtype)))
+ ret = userfunc(sess, command, error);
+
+ return ret;
}