comparison src/oscar.c @ 771:72e556f6b99d

[gaim-migrate @ 781] libfaim gets warnings, and other minor changes committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Mon, 28 Aug 2000 05:07:43 +0000
parents eec93c5929b9
children bddbc51abc43
comparison
equal deleted inserted replaced
770:172c5cf98dfa 771:72e556f6b99d
85 static int gaim_chat_leave (struct aim_session_t *, struct command_rx_struct *, ...); 85 static int gaim_chat_leave (struct aim_session_t *, struct command_rx_struct *, ...);
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 91
91 static int gaim_directim_incoming(struct aim_session_t *, struct command_rx_struct *, ...); 92 static int gaim_directim_incoming(struct aim_session_t *, struct command_rx_struct *, ...);
92 static int gaim_directim_typing (struct aim_session_t *, struct command_rx_struct *, ...); 93 static int gaim_directim_typing (struct aim_session_t *, struct command_rx_struct *, ...);
93 static int gaim_directim_initiate(struct aim_session_t *, struct command_rx_struct *, ...); 94 static int gaim_directim_initiate(struct aim_session_t *, struct command_rx_struct *, ...);
94 95
306 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_BUD, AIM_CB_BUD_OFFGOING, gaim_parse_offgoing, 0); 307 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_BUD, AIM_CB_BUD_OFFGOING, gaim_parse_offgoing, 0);
307 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_MSG, AIM_CB_MSG_INCOMING, gaim_parse_incoming_im, 0); 308 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_MSG, AIM_CB_MSG_INCOMING, gaim_parse_incoming_im, 0);
308 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_LOC, AIM_CB_LOC_ERROR, gaim_parse_misses, 0); 309 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_LOC, AIM_CB_LOC_ERROR, gaim_parse_misses, 0);
309 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_MSG, AIM_CB_MSG_MISSEDCALL, gaim_parse_misses, 0); 310 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_MSG, AIM_CB_MSG_MISSEDCALL, gaim_parse_misses, 0);
310 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_GEN, AIM_CB_GEN_RATECHANGE, gaim_parse_ratechange, 0); 311 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_GEN, AIM_CB_GEN_RATECHANGE, gaim_parse_ratechange, 0);
312 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_GEN, AIM_CB_GEN_EVIL, gaim_parse_evilnotify, 0);
311 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_MSG, AIM_CB_MSG_ERROR, gaim_parse_misses, 0); 313 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_MSG, AIM_CB_MSG_ERROR, gaim_parse_misses, 0);
312 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_LOC, AIM_CB_LOC_USERINFO, gaim_parse_user_info, 0); 314 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_LOC, AIM_CB_LOC_USERINFO, gaim_parse_user_info, 0);
313 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_MSG, AIM_CB_MSG_ACK, gaim_parse_msgack, 0); 315 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_MSG, AIM_CB_MSG_ACK, gaim_parse_msgack, 0);
314 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_CTN, AIM_CB_CTN_DEFAULT, aim_parse_unknown, 0); 316 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_CTN, AIM_CB_CTN_DEFAULT, aim_parse_unknown, 0);
315 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_DEFAULT, aim_parse_unknown, 0); 317 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_DEFAULT, aim_parse_unknown, 0);
343 static int id = 1; 345 static int id = 1;
344 switch (command->conn->type) { 346 switch (command->conn->type) {
345 case AIM_CONN_TYPE_BOS: 347 case AIM_CONN_TYPE_BOS:
346 aim_bos_reqrate(sess, command->conn); 348 aim_bos_reqrate(sess, command->conn);
347 aim_bos_ackrateresp(sess, command->conn); 349 aim_bos_ackrateresp(sess, command->conn);
348 aim_bos_setprivacyflags(sess, command->conn, 0x00000003); 350 aim_bos_setprivacyflags(sess, command->conn, AIM_PRIVFLAGS_ALLOWIDLE | AIM_PRIVFLAGS_ALLOWMEMBERSINCE);
349 aim_bos_reqservice(sess, command->conn, AIM_CONN_TYPE_ADS); 351 aim_bos_reqservice(sess, command->conn, AIM_CONN_TYPE_ADS);
350 aim_bos_setgroupperm(sess, command->conn, 0x1f); 352 aim_bos_setgroupperm(sess, command->conn, AIM_CLASS_ALLUSERS);
351 debug_print("done with BOS ServerReady\n"); 353 debug_print("done with BOS ServerReady\n");
352 break; 354 break;
353 case AIM_CONN_TYPE_CHATNAV: 355 case AIM_CONN_TYPE_CHATNAV:
354 debug_print("chatnav: got server ready\n"); 356 debug_print("chatnav: got server ready\n");
355 aim_conn_addhandler(sess, command->conn, AIM_CB_FAM_CTN, AIM_CB_CTN_INFO, gaim_chatnav_info, 0); 357 aim_conn_addhandler(sess, command->conn, AIM_CB_FAM_CTN, AIM_CB_CTN_INFO, gaim_chatnav_info, 0);
510 info = va_arg(ap, struct aim_userinfo_s *); 512 info = va_arg(ap, struct aim_userinfo_s *);
511 va_end(ap); 513 va_end(ap);
512 514
513 if (info->class & AIM_CLASS_TRIAL) 515 if (info->class & AIM_CLASS_TRIAL)
514 type |= UC_UNCONFIRMED; 516 type |= UC_UNCONFIRMED;
517 else if (info->class & AIM_CLASS_ADMINISTRATOR)
518 type |= UC_ADMIN;
515 else if (info->class & AIM_CLASS_AOL) 519 else if (info->class & AIM_CLASS_AOL)
516 type |= UC_AOL; 520 type |= UC_AOL;
517 else if (info->class & AIM_CLASS_FREE) 521 else if (info->class & AIM_CLASS_FREE)
518 type |= UC_NORMAL; 522 type |= UC_NORMAL;
519 if (info->class & AIM_CLASS_AWAY) 523 if (info->class & AIM_CLASS_AWAY)
785 va_start(ap, command); 789 va_start(ap, command);
786 id = (u_short)va_arg(ap, u_int); 790 id = (u_short)va_arg(ap, u_int);
787 msg = va_arg(ap, char *); 791 msg = va_arg(ap, char *);
788 va_end(ap); 792 va_end(ap);
789 793
790 sprintf(debug_buff, "MOTD: %s\n", msg); 794 sprintf(debug_buff, "MOTD: %s (%d)\n", msg, id);
791 debug_print(debug_buff); 795 debug_print(debug_buff);
792 sprintf(debug_buff, "Gaim %s / Libfaim %s\n", 796 sprintf(debug_buff, "Gaim %s / Libfaim %s\n",
793 VERSION, aim_getbuildstring()); 797 VERSION, aim_getbuildstring());
794 debug_print(debug_buff); 798 debug_print(debug_buff);
799 if (id != 4)
800 do_error_dialog(_("Your connection may be lost."),
801 _("AOL error"));
795 802
796 return 1; 803 return 1;
797 } 804 }
798 805
799 int gaim_chatnav_info(struct aim_session_t *sess, 806 int gaim_chatnav_info(struct aim_session_t *sess,
968 debug_print(debug_buff); 975 debug_print(debug_buff);
969 976
970 return 1; 977 return 1;
971 }; 978 };
972 979
980 int gaim_parse_evilnotify(struct aim_session_t *sess, struct command_rx_struct *command, ...) {
981 va_list ap;
982 char *sn;
983
984 va_start(ap, command);
985 sn = va_arg(ap, char *);
986 va_end(ap);
987
988 serv_got_eviled(sn, 0);
989
990 return 1;
991 }
992
973 int gaim_directim_incoming(struct aim_session_t *sess, struct command_rx_struct *command, ...) { 993 int gaim_directim_incoming(struct aim_session_t *sess, struct command_rx_struct *command, ...) {
974 va_list ap; 994 va_list ap;
975 char *sn = NULL, *msg = NULL; 995 char *sn = NULL, *msg = NULL;
976 struct aim_conn_t *conn; 996 struct aim_conn_t *conn;
977 997