comparison src/oscar.c @ 829:9a123b171f46

[gaim-migrate @ 839] yay. i have a secret. but basically this should fix most outstanding libfaim issues in gaim. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sat, 02 Sep 2000 02:41:57 +0000
parents 4c71c0e7f04e
children 8d8ef8c3afe2
comparison
equal deleted inserted replaced
828:4c71c0e7f04e 829:9a123b171f46
86 static int gaim_chat_info_update (struct aim_session_t *, struct command_rx_struct *, ...); 86 static int gaim_chat_info_update (struct aim_session_t *, struct command_rx_struct *, ...);
87 static int gaim_chat_incoming_msg(struct aim_session_t *, struct command_rx_struct *, ...); 87 static int gaim_chat_incoming_msg(struct aim_session_t *, struct command_rx_struct *, ...);
88 static int gaim_parse_msgack (struct aim_session_t *, struct command_rx_struct *, ...); 88 static int gaim_parse_msgack (struct aim_session_t *, struct command_rx_struct *, ...);
89 static int gaim_parse_ratechange (struct aim_session_t *, struct command_rx_struct *, ...); 89 static int gaim_parse_ratechange (struct aim_session_t *, struct command_rx_struct *, ...);
90 static int gaim_parse_evilnotify (struct aim_session_t *, struct command_rx_struct *, ...); 90 static int gaim_parse_evilnotify (struct aim_session_t *, struct command_rx_struct *, ...);
91 static int gaim_bosrights (struct aim_session_t *, struct command_rx_struct *, ...);
92 static int gaim_rateresp (struct aim_session_t *, struct command_rx_struct *, ...);
91 93
92 static int gaim_directim_incoming(struct aim_session_t *, struct command_rx_struct *, ...); 94 static int gaim_directim_incoming(struct aim_session_t *, struct command_rx_struct *, ...);
93 static int gaim_directim_typing (struct aim_session_t *, struct command_rx_struct *, ...); 95 static int gaim_directim_typing (struct aim_session_t *, struct command_rx_struct *, ...);
94 static int gaim_directim_initiate(struct aim_session_t *, struct command_rx_struct *, ...); 96 static int gaim_directim_initiate(struct aim_session_t *, struct command_rx_struct *, ...);
95 97
303 hide_login_progress(_("Could Not Connect")); 305 hide_login_progress(_("Could Not Connect"));
304 auth_failed(); 306 auth_failed();
305 return -1; 307 return -1;
306 } 308 }
307 309
310 aim_conn_addhandler(sess, bosconn, 0x0009, 0x0003, gaim_bosrights, 0);
311 aim_conn_addhandler(sess, bosconn, 0x0001, 0x0007, gaim_rateresp, 0); /* rate info */
308 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_ACK, AIM_CB_ACK_ACK, NULL, 0); 312 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_ACK, AIM_CB_ACK_ACK, NULL, 0);
309 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_GEN, AIM_CB_GEN_SERVERREADY, gaim_server_ready, 0); 313 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_GEN, AIM_CB_GEN_SERVERREADY, gaim_server_ready, 0);
310 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_GEN, AIM_CB_GEN_RATEINFO, NULL, 0); 314 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_GEN, AIM_CB_GEN_RATEINFO, NULL, 0);
311 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_GEN, AIM_CB_GEN_REDIRECT, gaim_handle_redirect, 0); 315 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_GEN, AIM_CB_GEN_REDIRECT, gaim_handle_redirect, 0);
312 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_STS, AIM_CB_STS_SETREPORTINTERVAL, NULL, 0); 316 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_STS, AIM_CB_STS_SETREPORTINTERVAL, NULL, 0);
350 int gaim_server_ready(struct aim_session_t *sess, 354 int gaim_server_ready(struct aim_session_t *sess,
351 struct command_rx_struct *command, ...) { 355 struct command_rx_struct *command, ...) {
352 static int id = 1; 356 static int id = 1;
353 switch (command->conn->type) { 357 switch (command->conn->type) {
354 case AIM_CONN_TYPE_BOS: 358 case AIM_CONN_TYPE_BOS:
355 aim_bos_reqrate(sess, command->conn); 359 aim_setversions(sess, command->conn);
356 aim_bos_ackrateresp(sess, command->conn); 360 aim_bos_reqrate(sess, command->conn); /* request rate info */
357 aim_bos_setprivacyflags(sess, command->conn, AIM_PRIVFLAGS_ALLOWIDLE | AIM_PRIVFLAGS_ALLOWMEMBERSINCE);
358 aim_bos_reqservice(sess, command->conn, AIM_CONN_TYPE_ADS);
359 aim_bos_setgroupperm(sess, command->conn, AIM_CLASS_ALLUSERS);
360 debug_print("done with BOS ServerReady\n"); 361 debug_print("done with BOS ServerReady\n");
361 break; 362 break;
362 case AIM_CONN_TYPE_CHATNAV: 363 case AIM_CONN_TYPE_CHATNAV:
363 debug_print("chatnav: got server ready\n"); 364 debug_print("chatnav: got server ready\n");
364 aim_conn_addhandler(sess, command->conn, AIM_CB_FAM_CTN, AIM_CB_CTN_INFO, gaim_chatnav_info, 0); 365 aim_conn_addhandler(sess, command->conn, AIM_CB_FAM_CTN, AIM_CB_CTN_INFO, gaim_chatnav_info, 0);
400 serviceid = va_arg(ap, int); 401 serviceid = va_arg(ap, int);
401 ip = va_arg(ap, char *); 402 ip = va_arg(ap, char *);
402 cookie = va_arg(ap, char *); 403 cookie = va_arg(ap, char *);
403 404
404 switch(serviceid) { 405 switch(serviceid) {
405 case 0x0005: /* Ads */
406 debug_print("Received Ads, finishing login\n");
407 aim_bos_setprofile(sess, command->conn, current_user->user_info,
408 NULL, gaim_caps);
409 aim_seticbmparam(sess, command->conn);
410 aim_conn_setlatency(command->conn, 1);
411
412 gtk_widget_hide(mainwindow);
413 show_buddy_list();
414 #ifdef USE_APPLET
415 if (general_options & OPT_GEN_APP_BUDDY_SHOW) {
416 refresh_buddy_window();
417 createOnlinePopup();
418 applet_buddy_show = TRUE;
419 } else {
420 gtk_widget_hide(blist);
421 applet_buddy_show = FALSE;
422 }
423 set_user_state(online);
424 #else
425 refresh_buddy_window();
426 #endif
427
428 serv_finish_login();
429 gaim_setup();
430
431 /* I'm sufficiently convinced that this is not the problem with
432 * signing on, because it happens no matter where I place it. */
433 if (bud_list_cache_exists())
434 do_import(NULL, 0);
435
436 debug_print("buddy list loaded\n");
437
438 setup_buddy_chats();
439
440 aim_bos_clientready(sess, command->conn);
441 debug_print("Roger that, all systems go\n");
442
443 aim_bos_reqservice(sess, command->conn, AIM_CONN_TYPE_CHATNAV);
444
445 break;
446 case 0x7: /* Authorizer */ 406 case 0x7: /* Authorizer */
447 debug_print("Reconnecting with authorizor...\n"); 407 debug_print("Reconnecting with authorizor...\n");
448 { 408 {
449 struct aim_conn_t *tstconn = aim_newconn(sess, AIM_CONN_TYPE_AUTH, ip); 409 struct aim_conn_t *tstconn = aim_newconn(sess, AIM_CONN_TYPE_AUTH, ip);
450 if (tstconn == NULL || tstconn->status >= AIM_CONN_STATUS_RESOLVERR) 410 if (tstconn == NULL || tstconn->status >= AIM_CONN_STATUS_RESOLVERR)
995 serv_got_eviled(sn, 0); 955 serv_got_eviled(sn, 0);
996 956
997 return 1; 957 return 1;
998 } 958 }
999 959
960 int gaim_rateresp(struct aim_session_t *sess, struct command_rx_struct *command, ...) {
961 switch (command->conn->type) {
962 case AIM_CONN_TYPE_BOS:
963 aim_bos_ackrateresp(sess, command->conn);
964 aim_bos_reqpersonalinfo(sess, command->conn);
965 aim_bos_reqlocaterights(sess, command->conn);
966 aim_bos_setprofile(sess, command->conn, current_user->user_info,
967 NULL, gaim_caps);
968 aim_bos_reqbuddyrights(sess, command->conn);
969
970 gtk_widget_hide(mainwindow);
971 show_buddy_list();
972
973 #ifdef USE_APPLET
974 if (general_options & OPT_GEN_APP_BUDDY_SHOW) {
975 refresh_buddy_window();
976 createOnlinePopup();
977 applet_buddy_show = TRUE;
978 } else {
979 gtk_widget_hide(blist);
980 applet_buddy_show = FALSE;
981 }
982 set_user_state(online);
983 #else
984 refresh_buddy_window();
985 #endif
986
987 serv_finish_login();
988 gaim_setup();
989
990 if (bud_list_cache_exists())
991 do_import(NULL, 0);
992
993 debug_print("buddy list loaded\n");
994
995 setup_buddy_chats();
996
997 aim_addicbmparam(sess, command->conn);
998 aim_bos_reqicbmparaminfo(sess, command->conn);
999
1000 aim_bos_reqrights(sess, command->conn);
1001 aim_bos_setgroupperm(sess, command->conn, AIM_CLASS_ALLUSERS);
1002 aim_bos_setprivacyflags(sess, command->conn, AIM_PRIVFLAGS_ALLOWIDLE |
1003 AIM_PRIVFLAGS_ALLOWMEMBERSINCE);
1004
1005 break;
1006 default:
1007 sprintf(debug_buff, "got rate response for unhandled connection type %04x\n",
1008 command->conn->type);
1009 debug_print(debug_buff);
1010 break;
1011 }
1012
1013 return 1;
1014 }
1015
1016 int gaim_bosrights(struct aim_session_t *sess, struct command_rx_struct *command, ...) {
1017 aim_bos_clientready(sess, command->conn);
1018
1019 aim_bos_reqservice(sess, command->conn, AIM_CONN_TYPE_CHATNAV);
1020
1021 return 1;
1022 }
1023
1000 int gaim_directim_incoming(struct aim_session_t *sess, struct command_rx_struct *command, ...) { 1024 int gaim_directim_incoming(struct aim_session_t *sess, struct command_rx_struct *command, ...) {
1001 va_list ap; 1025 va_list ap;
1002 char *sn = NULL, *msg = NULL; 1026 char *sn = NULL, *msg = NULL;
1003 struct aim_conn_t *conn; 1027 struct aim_conn_t *conn;
1004 1028