int process_packet( qqclient* qq, qqpacket* p, bytebuffer* buf ) { if( !decrypt_packet( qq, p, buf ) ) return -1; if( qq->log_packet ){ DBG("[%d] recv packet ver:%x cmd: %x seqno: %x", qq->number, p->version, p->command, p->seqno ); hex_dump( p->buf->data, p->buf->len ); } switch( p->command ){ case QQ_CMD_TOUCH: prot_login_touch_reply( qq, p ); break; case QQ_CMD_LOGIN_REQUEST: prot_login_request_reply( qq, p ); break; case QQ_CMD_LOGIN_VERIFY: prot_login_verify_reply( qq, p ); break; case QQ_CMD_LOGIN_GET_INFO: prot_login_get_info_reply( qq, p ); break; case QQ_CMD_LOGIN_A4: prot_login_a4_reply( qq, p ); break; case QQ_CMD_LOGIN_GET_LIST: prot_login_get_list_reply( qq, p ); break; case QQ_CMD_LOGIN_SEND_INFO: prot_login_send_info_reply( qq, p ); break; case QQ_CMD_E9: prot_login_e9_reply( qq, p ); break; case QQ_CMD_EA: prot_login_ea_reply( qq, p ); break; case QQ_CMD_EC: prot_login_ec_reply( qq, p ); break; case QQ_CMD_ED: prot_login_ed_reply( qq, p ); break; case QQ_CMD_KEEP_ALIVE: prot_user_keep_alive_reply( qq, p ); break; case QQ_CMD_RECV_IM_09: case QQ_CMD_RECV_IM: prot_im_recv_msg( qq, p ); break; case QQ_CMD_CHANGE_STATUS: prot_user_change_status_reply( qq, p ); break; #ifndef NO_BUDDY_INFO case QQ_CMD_GET_BUDDY_LIST: prot_buddy_update_list_reply( qq, p ); break; case QQ_CMD_GET_BUDDY_ONLINE: prot_buddy_update_online_reply( qq, p ); break; case QQ_CMD_BUDDY_STATUS: prot_buddy_status( qq, p ); break; #endif #ifndef NO_QUN_INFO case QQ_CMD_QUN_CMD: prot_qun_cmd_reply( qq, p ); break; #endif case QQ_CMD_GET_KEY: prot_user_get_key_reply( qq, p ); break; case QQ_CMD_GET_NOTICE: prot_user_get_notice_reply( qq, p ); break; case QQ_CMD_CHECK_IP: prot_user_check_ip_reply( qq, p ); break; #ifndef NO_BUDDY_DETAIL_INFO case QQ_CMD_GET_BUDDY_SIGN: prot_buddy_update_signiture_reply( qq, p ); break; case QQ_CMD_ACCOUNT: prot_buddy_update_account_reply( qq, p ); break; case QQ_CMD_BUDDY_ALIAS: prot_buddy_update_alias_reply( qq, p ); break; case QQ_CMD_GET_BUDDY_EXTRA_INFO: prot_buddy_get_extra_info_reply( qq, p ); break; case QQ_CMD_BUDDY_INFO: prot_buddy_get_info_reply( qq, p ); break; #endif #ifndef NO_GROUP_INFO case QQ_CMD_GROUP_LABEL: prot_group_download_labels_reply( qq, p ); break; #endif case QQ_CMD_SEND_IM: break; case QQ_CMD_BROADCAST: prot_misc_broadcast( qq, p ); break; case QQ_CMD_GET_LEVEL: prot_user_get_level_reply( qq, p ); break; case QQ_CMD_ADDBUDDY_REQUEST: prot_buddy_request_addbuddy_reply( qq, p ); break; case QQ_CMD_ADDBUDDY_VERIFY: prot_buddy_verify_addbuddy_reply( qq, p ); break; case QQ_CMD_REQUEST_TOKEN: prot_user_request_token_reply( qq, p ); break; case QQ_CMD_DEL_BUDDY: prot_buddy_del_buddy_reply( qq, p ); break; default: DBG("unknown cmd: %x", p->command ); hex_dump( p->buf->data, p->buf->len ); break; } return 0; }
int process_packet( qqclient* qq, qqpacket* p, bytebuffer* buf ) { if( !decrypt_packet( qq, p, buf ) ) return -1; if( qq->log_packet ){ DBG("[%d] recv packet ver:%x cmd: %x seqno: %x", qq->number, p->version, p->command, p->seqno ); hex_dump( p->buf->data, p->buf->len ); } // memcpy(qq->mimnetwork->m_libevabuffer,p->buf->data,p->buf->len); qq->mimnetwork->m_packet=p; switch( p->command ){ case QQ_CMD_TOUCH: prot_login_touch_reply( qq, p ); break; case QQ_CMD_LOGIN_REQUEST: prot_login_request_reply( qq, p ); break; case QQ_CMD_LOGIN_VERIFY: prot_login_verify_reply( qq, p ); break; case QQ_CMD_LOGIN_GET_INFO: prot_login_get_info_reply( qq, p ); break; case QQ_CMD_LOGIN_A4: prot_login_a4_reply( qq, p ); break; case QQ_CMD_LOGIN_GET_LIST: prot_login_get_list_reply( qq, p ); break; case QQ_CMD_LOGIN_SEND_INFO: prot_login_send_info_reply( qq, p ); break; case QQ_CMD_E9: prot_login_e9_reply( qq, p ); break; case QQ_CMD_EA: prot_login_ea_reply( qq, p ); break; case QQ_CMD_EC: prot_login_ec_reply( qq, p ); break; case QQ_CMD_ED: prot_login_ed_reply( qq, p ); break; case QQ_CMD_KEEP_ALIVE: prot_user_keep_alive_reply( qq, p ); break; case QQ_CMD_RECV_IM_09: case QQ_CMD_RECV_IM: // MirandaQQ handles message by itself due to userhead/emoticon stuff // however ack is better handled by myqq3 in case of proto change prot_im_recv_msg( qq, p ); //prot_im_ack_recv( qq, p ); break; case QQ_CMD_CHANGE_STATUS: prot_user_change_status_reply( qq, p ); break; #ifndef NO_BUDDY_INFO case QQ_CMD_GET_BUDDY_LIST: prot_buddy_update_list_reply( qq, p ); break; case QQ_CMD_GET_BUDDY_ONLINE: prot_buddy_update_online_reply( qq, p ); break; case QQ_CMD_BUDDY_STATUS: prot_buddy_status( qq, p ); break; #endif #ifndef NO_QUN_INFO case QQ_CMD_QUN_CMD: prot_qun_cmd_reply( qq, p ); break; #endif case QQ_CMD_GET_KEY: prot_user_get_key_reply( qq, p ); break; case QQ_CMD_GET_NOTICE: prot_user_get_notice_reply( qq, p ); break; case QQ_CMD_CHECK_IP: prot_user_check_ip_reply( qq, p ); break; #ifndef NO_BUDDY_DETAIL_INFO case QQ_CMD_GET_BUDDY_SIGN: prot_buddy_update_signiture_reply( qq, p ); break; case QQ_CMD_ACCOUNT: prot_buddy_update_account_reply( qq, p ); break; case QQ_CMD_BUDDY_ALIAS: prot_buddy_update_alias_reply( qq, p ); break; case QQ_CMD_GET_BUDDY_EXTRA_INFO: prot_buddy_get_extra_info_reply( qq, p ); break; case QQ_CMD_BUDDY_INFO: prot_buddy_get_info_reply( qq, p ); break; #endif #ifndef NO_GROUP_INFO case QQ_CMD_GROUP_LABEL: prot_group_download_labels_reply( qq, p ); break; #endif case QQ_CMD_SEND_IM: break; case QQ_CMD_BROADCAST: prot_misc_broadcast( qq, p ); break; case QQ_CMD_GET_LEVEL: prot_user_get_level_reply( qq, p ); break; case QQ_CMD_ADDBUDDY_REQUEST: prot_buddy_request_addbuddy_reply( qq, p ); break; case QQ_CMD_ADDBUDDY_VERIFY: prot_buddy_verify_addbuddy_reply( qq, p ); break; case QQ_CMD_REQUEST_TOKEN: prot_user_request_token_reply( qq, p ); break; case QQ_CMD_DEL_BUDDY: prot_buddy_del_buddy_reply( qq, p ); break; case QQ_CMD_SEARCH_UID: prot_buddy_search_uid_reply( qq, p ); break; case 0xa6: // Weather prot_weather_reply( qq, p ); break; default: DBG("unknown cmd: %x", p->command ); hex_dump( p->buf->data, p->buf->len ); break; } /* qq->mimnetwork->m_packet=p; qq->mimnetwork->processPacket(qq->mimnetwork->m_libevabuffer,p->buf->len); */ return 0; }