Mercurial > pidgin.yaz
comparison libpurple/protocols/qq/qq_process.c @ 24071:619ac2303c46
2009.10.02 - ccpaging <ccpaging(at)gmail.com>
* Added 'Captcha Display' function
* Most functions from patch written by Emil Alexiev merged into trunk,
except 'buddy operations'
* 'online buddy status' and 'qun buddies' still have problems
author | SHiNE CsyFeK <csyfek@gmail.com> |
---|---|
date | Wed, 22 Oct 2008 14:43:46 +0000 |
parents | 832178d951ca |
children | df699d739b8f |
comparison
equal
deleted
inserted
replaced
24070:832178d951ca | 24071:619ac2303c46 |
---|---|
587 data = g_newa(guint8, rcved_len); | 587 data = g_newa(guint8, rcved_len); |
588 | 588 |
589 switch (cmd) { | 589 switch (cmd) { |
590 case QQ_CMD_TOKEN: | 590 case QQ_CMD_TOKEN: |
591 if (qq_process_token(gc, rcved, rcved_len) == QQ_LOGIN_REPLY_OK) { | 591 if (qq_process_token(gc, rcved, rcved_len) == QQ_LOGIN_REPLY_OK) { |
592 if (qd->client_version > 2005) { | 592 if (qd->client_version >= 2007) { |
593 qq_request_token_ex(gc); | 593 qq_request_token_ex(gc); |
594 } else { | 594 } else { |
595 qq_request_login(gc); | 595 qq_request_login(gc); |
596 } | 596 } |
597 return QQ_LOGIN_REPLY_OK; | 597 return QQ_LOGIN_REPLY_OK; |
613 } | 613 } |
614 } | 614 } |
615 break; | 615 break; |
616 case QQ_CMD_LOGIN: | 616 case QQ_CMD_LOGIN: |
617 default: | 617 default: |
618 if (qd->client_version > 2005) { | 618 if (qd->client_version >= 2007) { |
619 data_len = qq_decrypt(data, rcved, rcved_len, qd->ld.pwd_twice_md5); | 619 data_len = qq_decrypt(data, rcved, rcved_len, qd->ld.pwd_twice_md5); |
620 if (data_len >= 0) { | 620 if (data_len >= 0) { |
621 purple_debug_warning("QQ", "Decrypt login packet by pwd_twice_md5\n"); | 621 purple_debug_warning("QQ", "Decrypt login packet by pwd_twice_md5\n"); |
622 } else { | 622 } else { |
623 data_len = qq_decrypt(data, rcved, rcved_len, qd->ld.login_key); | 623 data_len = qq_decrypt(data, rcved, rcved_len, qd->ld.login_key); |
694 } | 694 } |
695 if (ret_8 != QQ_LOGIN_REPLY_OK) { | 695 if (ret_8 != QQ_LOGIN_REPLY_OK) { |
696 return ret_8; | 696 return ret_8; |
697 } | 697 } |
698 | 698 |
699 purple_connection_update_progress(gc, _("Logined"), QQ_CONNECT_STEPS - 1, QQ_CONNECT_STEPS); | |
699 purple_debug_info("QQ", "Login repliess OK; everything is fine\n"); | 700 purple_debug_info("QQ", "Login repliess OK; everything is fine\n"); |
700 purple_connection_set_state(gc, PURPLE_CONNECTED); | 701 purple_connection_set_state(gc, PURPLE_CONNECTED); |
701 qd->is_login = TRUE; /* must be defined after sev_finish_login */ | 702 qd->is_login = TRUE; /* must be defined after sev_finish_login */ |
702 | 703 |
703 /* now initiate QQ Qun, do it first as it may take longer to finish */ | 704 /* now initiate QQ Qun, do it first as it may take longer to finish */ |
774 break; | 775 break; |
775 case QQ_CMD_SEND_IM: | 776 case QQ_CMD_SEND_IM: |
776 qq_process_send_im_reply(data, data_len, gc); | 777 qq_process_send_im_reply(data, data_len, gc); |
777 break; | 778 break; |
778 case QQ_CMD_KEEP_ALIVE: | 779 case QQ_CMD_KEEP_ALIVE: |
779 qq_process_keep_alive(data, data_len, gc); | 780 if (qd->client_version >= 2008) { |
781 qq_process_keep_alive_2008(data, data_len, gc); | |
782 } else if (qd->client_version >= 2007) { | |
783 qq_process_keep_alive_2007(data, data_len, gc); | |
784 } else { | |
785 qq_process_keep_alive(data, data_len, gc); | |
786 } | |
780 break; | 787 break; |
781 case QQ_CMD_GET_BUDDIES_ONLINE: | 788 case QQ_CMD_GET_BUDDIES_ONLINE: |
782 ret_8 = qq_process_get_buddies_online_reply(data, data_len, gc); | 789 ret_8 = qq_process_get_buddies_online_reply(data, data_len, gc); |
783 if (ret_8 > 0 && ret_8 < 0xff) { | 790 if (ret_8 > 0 && ret_8 < 0xff) { |
784 purple_debug_info("QQ", "Requesting for more online buddies\n"); | 791 purple_debug_info("QQ", "Requesting for more online buddies\n"); |