Mercurial > pidgin
comparison libpurple/protocols/qq/qq_process.c @ 24137:87e61a85f5dd
2008.09.28 - ccpaging <ccpaging(at)gmail.com>
* The source is only for debug, not for user:
1. Implement new QQ protocol 2007/2008, include login and change status
2. Check 2005's login reply packet, get last 3 login time.
3. Server's notice and news is displayed in self buddy (The new buddy
created in buddy list).
4. The notice messages when adding/removing QQ Qun's buddy displayed
in char conversation. They are displayed as purple notify windows in the past.
5. The notice messages when adding/removing buddy displayed in self
buddy's conversation. They are displayed as purple notify windows in the past.
6. Client version can be selected in account option. Now only qq2005 is
working, other new version is only for debug.
author | SHiNE CsyFeK <csyfek@gmail.com> |
---|---|
date | Wed, 22 Oct 2008 14:40:04 +0000 |
parents | dbc7a9742f8d |
children | dc112387190f |
comparison
equal
deleted
inserted
replaced
24136:fc546485fae7 | 24137:87e61a85f5dd |
---|---|
611 if (data_len >= 0) { | 611 if (data_len >= 0) { |
612 purple_debug_warning("QQ", "Decrypt login packet by pwd_4th_md5, %d bytes\n", data_len); | 612 purple_debug_warning("QQ", "Decrypt login packet by pwd_4th_md5, %d bytes\n", data_len); |
613 } | 613 } |
614 } | 614 } |
615 break; | 615 break; |
616 default: | 616 case QQ_CMD_LOGIN: |
617 /* May use password_twice_md5 in the past version like QQ2005 */ | 617 default: |
618 data_len = qq_decrypt(data, rcved, rcved_len, qd->ld.random_key); | 618 if (qd->client_version > 2005) { |
619 if (data_len >= 0) { | 619 data_len = qq_decrypt(data, rcved, rcved_len, qd->ld.pwd_4th_md5); |
620 purple_debug_warning("QQ", "Decrypt login packet by random_key, %d bytes\n", data_len); | 620 if (data_len >= 0) { |
621 purple_debug_warning("QQ", "Decrypt login packet by pwd_4th_md5\n"); | |
622 } else { | |
623 data_len = qq_decrypt(data, rcved, rcved_len, qd->ld.login_key); | |
624 if (data_len >= 0) { | |
625 purple_debug_warning("QQ", "Decrypt login packet by login_key\n"); | |
626 } | |
627 } | |
621 } else { | 628 } else { |
622 data_len = qq_decrypt(data, rcved, rcved_len, qd->ld.pwd_2nd_md5); | 629 /* May use password_twice_md5 in the past version like QQ2005 */ |
630 data_len = qq_decrypt(data, rcved, rcved_len, qd->ld.random_key); | |
623 if (data_len >= 0) { | 631 if (data_len >= 0) { |
624 purple_debug_warning("QQ", "Decrypt login packet by pwd_2nd_md5, %d bytes\n", data_len); | 632 purple_debug_warning("QQ", "Decrypt login packet by random_key\n"); |
633 } else { | |
634 data_len = qq_decrypt(data, rcved, rcved_len, qd->ld.pwd_2nd_md5); | |
635 if (data_len >= 0) { | |
636 purple_debug_warning("QQ", "Decrypt login packet by pwd_2nd_md5\n"); | |
637 } | |
625 } | 638 } |
626 } | 639 } |
627 break; | 640 break; |
628 } | 641 } |
629 | 642 |
678 } else { | 691 } else { |
679 qq_request_login_2007(gc); | 692 qq_request_login_2007(gc); |
680 } | 693 } |
681 break; | 694 break; |
682 case QQ_CMD_LOGIN: | 695 case QQ_CMD_LOGIN: |
683 ret_8 = qq_process_login(gc, data, data_len); | 696 if (qd->client_version == 2008) { |
697 ret_8 = qq_process_login_2008(gc, data, data_len); | |
698 } else if (qd->client_version == 2007) { | |
699 ret_8 = qq_process_login_2007(gc, data, data_len); | |
700 } else { | |
701 ret_8 = qq_process_login(gc, data, data_len); | |
702 } | |
684 if (ret_8 != QQ_LOGIN_REPLY_OK) { | 703 if (ret_8 != QQ_LOGIN_REPLY_OK) { |
685 return ret_8; | 704 return ret_8; |
686 } | 705 } |
687 | 706 |
688 purple_debug_info("QQ", "Login repliess OK; everything is fine\n"); | 707 purple_debug_info("QQ", "Login repliess OK; everything is fine\n"); |