comparison src/protocols/oscar/oscar.c @ 2647:6781ee2b9db0

[gaim-migrate @ 2660] Please buy the Swordfish DVD, and talk to GabrielShear on AIM. (But SmarterChild is better.) committer: Tailor Script <tailor@pidgin.im>
author Adam Fritzler <mid@auk.cx>
date Thu, 01 Nov 2001 02:25:13 +0000
parents 24664768a739
children c41030cfed76
comparison
equal deleted inserted replaced
2646:2555683e8dc8 2647:6781ee2b9db0
856 856
857 return 1; 857 return 1;
858 } 858 }
859 859
860 static int server_ready_auth(aim_session_t *sess, aim_frame_t *fr, ...) { 860 static int server_ready_auth(aim_session_t *sess, aim_frame_t *fr, ...) {
861 struct gaim_connection *gc = sess->aux_data;
862 struct oscar_data *od = gc->proto_data;
863 861
864 aim_auth_setversions(sess, fr->conn); 862 aim_auth_setversions(sess, fr->conn);
865 aim_bos_reqrate(sess, fr->conn); 863 aim_bos_reqrate(sess, fr->conn);
866 debug_printf("done with AUTH ServerReady\n"); 864 debug_printf("done with AUTH ServerReady\n");
867 if (od->chpass) {
868 debug_printf("changing password\n");
869 aim_auth_changepasswd(sess, fr->conn, od->newp, od->oldp);
870 g_free(od->oldp);
871 g_free(od->newp);
872 od->chpass = FALSE;
873 }
874 if (od->conf) {
875 debug_printf("confirming account\n");
876 aim_auth_reqconfirm(sess, fr->conn);
877 od->conf = FALSE;
878 }
879 if (od->reqemail) {
880 debug_printf("requesting email\n");
881 aim_auth_getinfo(sess, fr->conn, 0x0011);
882 od->reqemail = FALSE;
883 }
884 865
885 return 1; 866 return 1;
886 } 867 }
887 868
888 static int server_ready_bos(aim_session_t *sess, aim_frame_t *fr, ...) { 869 static int server_ready_bos(aim_session_t *sess, aim_frame_t *fr, ...) {
891 debug_printf("done with BOS ServerReady\n"); 872 debug_printf("done with BOS ServerReady\n");
892 873
893 return 1; 874 return 1;
894 } 875 }
895 876
896 static int server_ready_chatnav(aim_session_t *sess, aim_frame_t *fr, ...) { 877 static int rateresp_chat(aim_session_t *sess, aim_frame_t *fr, ...) {
897 debug_printf("chatnav: got server ready\n"); 878 struct gaim_connection *gc = sess->aux_data;
898 aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CTN, AIM_CB_CTN_INFO, gaim_chatnav_info, 0); 879 struct chat_connection *chatcon;
899 aim_bos_reqrate(sess, fr->conn); 880 static int id = 1;
881
882 aim_bos_ackrateresp(sess, fr->conn);
883 aim_chat_clientready(sess, fr->conn);
884 chatcon = find_oscar_chat_by_conn(gc, fr->conn);
885 chatcon->id = id;
886 chatcon->cnv = serv_got_joined_chat(gc, id++, chatcon->show);
887
888 return 1;
889 }
890
891 static int rateresp_chatnav(aim_session_t *sess, aim_frame_t *fr, ...) {
892
900 aim_bos_ackrateresp(sess, fr->conn); 893 aim_bos_ackrateresp(sess, fr->conn);
901 aim_chatnav_clientready(sess, fr->conn); 894 aim_chatnav_clientready(sess, fr->conn);
902 aim_chatnav_reqrights(sess, fr->conn); 895 aim_chatnav_reqrights(sess, fr->conn);
903 896
904 return 1; 897 return 1;
905 } 898 }
906 899
900 static int server_ready_chatnav(aim_session_t *sess, aim_frame_t *fr, ...) {
901 debug_printf("chatnav: got server ready\n");
902 aim_conn_addhandler(sess, fr->conn, 0x0001, 0x0007, rateresp_chatnav, 0);
903 aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CTN, AIM_CB_CTN_INFO, gaim_chatnav_info, 0);
904 aim_bos_reqrate(sess, fr->conn);
905
906 return 1;
907 }
908
907 static int server_ready_chat(aim_session_t *sess, aim_frame_t *fr, ...) { 909 static int server_ready_chat(aim_session_t *sess, aim_frame_t *fr, ...) {
908 struct gaim_connection *gc = sess->aux_data;
909 struct chat_connection *chatcon;
910 static int id = 1;
911 910
912 debug_printf("chat: got server ready\n"); 911 debug_printf("chat: got server ready\n");
912 aim_conn_addhandler(sess, fr->conn, 0x0001, 0x0007, rateresp_chat, 0);
913 aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_USERJOIN, gaim_chat_join, 0); 913 aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_USERJOIN, gaim_chat_join, 0);
914 aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_USERLEAVE, gaim_chat_leave, 0); 914 aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_USERLEAVE, gaim_chat_leave, 0);
915 aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_ROOMINFOUPDATE, gaim_chat_info_update, 0); 915 aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_ROOMINFOUPDATE, gaim_chat_info_update, 0);
916 aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_INCOMINGMSG, gaim_chat_incoming_msg, 0); 916 aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_INCOMINGMSG, gaim_chat_incoming_msg, 0);
917 aim_bos_reqrate(sess, fr->conn); 917 aim_bos_reqrate(sess, fr->conn);
918 aim_bos_ackrateresp(sess, fr->conn);
919 aim_chat_clientready(sess, fr->conn);
920 chatcon = find_oscar_chat_by_conn(gc, fr->conn);
921 chatcon->id = id;
922 chatcon->cnv = serv_got_joined_chat(gc, id++, chatcon->show);
923 918
924 return 1; 919 return 1;
925 } 920 }
926 921
927 static void oscar_chatnav_connect(gpointer data, gint source, GaimInputCondition cond) { 922 static void oscar_chatnav_connect(gpointer data, gint source, GaimInputCondition cond) {
1963 1958
1964 return 1; 1959 return 1;
1965 } 1960 }
1966 1961
1967 static int rateresp_auth(aim_session_t *sess, aim_frame_t *fr, ...) { 1962 static int rateresp_auth(aim_session_t *sess, aim_frame_t *fr, ...) {
1963 struct gaim_connection *gc = sess->aux_data;
1964 struct oscar_data *od = gc->proto_data;
1965
1968 aim_bos_ackrateresp(sess, fr->conn); 1966 aim_bos_ackrateresp(sess, fr->conn);
1969 aim_auth_clientready(sess, fr->conn); 1967 aim_auth_clientready(sess, fr->conn);
1970 debug_printf("connected to auth (admin)\n"); 1968 debug_printf("connected to auth (admin)\n");
1969
1970 if (od->chpass) {
1971 debug_printf("changing password\n");
1972 aim_auth_changepasswd(sess, fr->conn, od->newp, od->oldp);
1973 g_free(od->oldp);
1974 g_free(od->newp);
1975 od->chpass = FALSE;
1976 }
1977 if (od->conf) {
1978 debug_printf("confirming account\n");
1979 aim_auth_reqconfirm(sess, fr->conn);
1980 od->conf = FALSE;
1981 }
1982 if (od->reqemail) {
1983 debug_printf("requesting email\n");
1984 aim_auth_getinfo(sess, fr->conn, 0x0011);
1985 od->reqemail = FALSE;
1986 }
1971 1987
1972 return 1; 1988 return 1;
1973 } 1989 }
1974 1990
1975 static int gaim_icbm_param_info(aim_session_t *sess, aim_frame_t *fr, ...) { 1991 static int gaim_icbm_param_info(aim_session_t *sess, aim_frame_t *fr, ...) {