comparison src/oscar.c @ 503:6e318907bcce

[gaim-migrate @ 513] bringing gaim up to latest libfaim committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Tue, 18 Jul 2000 05:37:39 +0000
parents 64afc8f41bcb
children 3bd51b3f07c3
comparison
equal deleted inserted replaced
502:4d1e39112cbd 503:6e318907bcce
80 static int gaim_chatnav_info (struct aim_session_t *, struct command_rx_struct *, ...); 80 static int gaim_chatnav_info (struct aim_session_t *, struct command_rx_struct *, ...);
81 static int gaim_chat_join (struct aim_session_t *, struct command_rx_struct *, ...); 81 static int gaim_chat_join (struct aim_session_t *, struct command_rx_struct *, ...);
82 static int gaim_chat_leave (struct aim_session_t *, struct command_rx_struct *, ...); 82 static int gaim_chat_leave (struct aim_session_t *, struct command_rx_struct *, ...);
83 static int gaim_chat_info_update (struct aim_session_t *, struct command_rx_struct *, ...); 83 static int gaim_chat_info_update (struct aim_session_t *, struct command_rx_struct *, ...);
84 static int gaim_chat_incoming_msg(struct aim_session_t *, struct command_rx_struct *, ...); 84 static int gaim_chat_incoming_msg(struct aim_session_t *, struct command_rx_struct *, ...);
85 static int gaim_parse_msgack (struct aim_session_t *, struct command_rx_struct *, ...);
86 static int gaim_parse_ratechange (struct aim_session_t *, struct command_rx_struct *, ...);
85 87
86 extern void auth_failed(); 88 extern void auth_failed();
87 89
88 static void oscar_callback(gpointer data, gint source, 90 static void oscar_callback(gpointer data, gint source,
89 GdkInputCondition condition) { 91 GdkInputCondition condition) {
96 gdk_input_remove(inpa); 98 gdk_input_remove(inpa);
97 auth_failed(); 99 auth_failed();
98 return; 100 return;
99 } 101 }
100 if (condition & GDK_INPUT_READ) { 102 if (condition & GDK_INPUT_READ) {
101 if (aim_get_command(gaim_sess, conn) < 0) { 103 if (conn->type == AIM_CONN_TYPE_RENDEZVOUS_OUT) {
102 debug_print(_("connection error!\n")); 104 if (aim_handlerendconnect(gaim_sess, conn) < 0) {
103 signoff(); 105 debug_print(_("connection error (rend)\n"));
104 hide_login_progress(_("Disconnected.")); 106 }
105 aim_logoff(gaim_sess);
106 auth_failed();
107 gdk_input_remove(inpa);
108 } else { 107 } else {
109 aim_rxdispatch(gaim_sess); 108 if (aim_get_command(gaim_sess, conn) >= 0) {
109 aim_rxdispatch(gaim_sess);
110 } else {
111 debug_print(_("connection error!\n"));
112 aim_conn_kill(gaim_sess, &conn);
113 if (!aim_getconn_type(gaim_sess, AIM_CONN_TYPE_BOS)) {
114 debug_print(_("major connection error\n"));
115 signoff();
116 hide_login_progress(_("Disconnected."));
117 aim_logoff(gaim_sess);
118 auth_failed();
119 gdk_input_remove(inpa);
120 }
121 }
110 } 122 }
111 } 123 }
112 } 124 }
113 125
114 int oscar_login(char *username, char *password) { 126 int oscar_login(char *username, char *password) {
275 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_BUD, AIM_CB_BUD_ONCOMING, gaim_parse_oncoming, 0); 287 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_BUD, AIM_CB_BUD_ONCOMING, gaim_parse_oncoming, 0);
276 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_BUD, AIM_CB_BUD_OFFGOING, gaim_parse_offgoing, 0); 288 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_BUD, AIM_CB_BUD_OFFGOING, gaim_parse_offgoing, 0);
277 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_MSG, AIM_CB_MSG_INCOMING, gaim_parse_incoming_im, 0); 289 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_MSG, AIM_CB_MSG_INCOMING, gaim_parse_incoming_im, 0);
278 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_LOC, AIM_CB_LOC_ERROR, gaim_parse_misses, 0); 290 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_LOC, AIM_CB_LOC_ERROR, gaim_parse_misses, 0);
279 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_MSG, AIM_CB_MSG_MISSEDCALL, gaim_parse_misses, 0); 291 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_MSG, AIM_CB_MSG_MISSEDCALL, gaim_parse_misses, 0);
280 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_GEN, AIM_CB_GEN_RATECHANGE, gaim_parse_misses, 0); 292 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_GEN, AIM_CB_GEN_RATECHANGE, gaim_parse_ratechange, 0);
281 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_MSG, AIM_CB_MSG_ERROR, gaim_parse_misses, 0); 293 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_MSG, AIM_CB_MSG_ERROR, gaim_parse_misses, 0);
282 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_LOC, AIM_CB_LOC_USERINFO, gaim_parse_user_info, 0); 294 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_LOC, AIM_CB_LOC_USERINFO, gaim_parse_user_info, 0);
295 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_MSG, AIM_CB_MSG_ACK, gaim_parse_msgack, 0);
283 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_CTN, AIM_CB_CTN_DEFAULT, aim_parse_unknown, 0); 296 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_CTN, AIM_CB_CTN_DEFAULT, aim_parse_unknown, 0);
284 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_DEFAULT, aim_parse_unknown, 0); 297 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_DEFAULT, aim_parse_unknown, 0);
285 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_GEN, AIM_CB_GEN_MOTD, gaim_parse_motd, 0); 298 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_GEN, AIM_CB_GEN_MOTD, gaim_parse_motd, 0);
286 299
287 aim_auth_sendcookie(sess, bosconn, sess->logininfo.cookie); 300 aim_auth_sendcookie(sess, bosconn, sess->logininfo.cookie);
773 return 1; 786 return 1;
774 } 787 }
775 788
776 int gaim_chat_info_update(struct aim_session_t *sess, 789 int gaim_chat_info_update(struct aim_session_t *sess,
777 struct command_rx_struct *command, ...) { 790 struct command_rx_struct *command, ...) {
778 /* FIXME */
779 debug_print("inside chat_info_update\n"); 791 debug_print("inside chat_info_update\n");
780 return 1; 792 return 1;
781 } 793 }
782 794
783 int gaim_chat_incoming_msg(struct aim_session_t *sess, 795 int gaim_chat_incoming_msg(struct aim_session_t *sess,
805 817
806 serv_got_chat_in(b->id, info->sn, 0, msg); 818 serv_got_chat_in(b->id, info->sn, 0, msg);
807 819
808 return 1; 820 return 1;
809 } 821 }
822
823 /*
824 * Recieved in response to an IM sent with the AIM_IMFLAGS_ACK option.
825 */
826 int gaim_parse_msgack(struct aim_session_t *sess, struct command_rx_struct *command, ...) {
827 va_list ap;
828 unsigned short type;
829 char *sn = NULL;
830
831 ap = va_start(ap, command);
832 type = va_arg(ap, unsigned short);
833 sn = va_arg(ap, char *);
834 va_end(ap);
835
836 sprintf(debug_buff, "Sent message to %s.\n", sn);
837 debug_print(debug_buff);
838
839 return 1;
840 }
841
842 int gaim_parse_ratechange(struct aim_session_t *sess, struct command_rx_struct *command, ...) {
843 va_list ap;
844 unsigned long newrate;
845
846 va_start(ap, command);
847 newrate = va_arg(ap, unsigned long);
848 va_end(ap);
849
850 sprintf(debug_buff, "ratechange: %lu\n", newrate);
851 debug_print(debug_buff);
852
853 return 1;
854 };