comparison src/oscar.c @ 747:eec93c5929b9

[gaim-migrate @ 757] minor changes committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 23 Aug 2000 05:43:46 +0000
parents 5a908dd5cfc4
children 72e556f6b99d
comparison
equal deleted inserted replaced
746:5a908dd5cfc4 747:eec93c5929b9
69 69
70 return c; 70 return c;
71 } 71 }
72 72
73 static int gaim_parse_auth_resp (struct aim_session_t *, struct command_rx_struct *, ...); 73 static int gaim_parse_auth_resp (struct aim_session_t *, struct command_rx_struct *, ...);
74 static int gaim_auth_server_ready(struct aim_session_t *, struct command_rx_struct *, ...);
75 static int gaim_parse_login (struct aim_session_t *, struct command_rx_struct *, ...); 74 static int gaim_parse_login (struct aim_session_t *, struct command_rx_struct *, ...);
76 static int gaim_server_ready (struct aim_session_t *, struct command_rx_struct *, ...); 75 static int gaim_server_ready (struct aim_session_t *, struct command_rx_struct *, ...);
77 static int gaim_handle_redirect (struct aim_session_t *, struct command_rx_struct *, ...); 76 static int gaim_handle_redirect (struct aim_session_t *, struct command_rx_struct *, ...);
78 static int gaim_parse_oncoming (struct aim_session_t *, struct command_rx_struct *, ...); 77 static int gaim_parse_oncoming (struct aim_session_t *, struct command_rx_struct *, ...);
79 static int gaim_parse_offgoing (struct aim_session_t *, struct command_rx_struct *, ...); 78 static int gaim_parse_offgoing (struct aim_session_t *, struct command_rx_struct *, ...);
128 !(aim_getconn_type(gaim_sess, AIM_CONN_TYPE_BOS))) { 127 !(aim_getconn_type(gaim_sess, AIM_CONN_TYPE_BOS))) {
129 debug_print(_("major connection error\n")); 128 debug_print(_("major connection error\n"));
130 signoff(); 129 signoff();
131 hide_login_progress(_("Disconnected.")); 130 hide_login_progress(_("Disconnected."));
132 auth_failed(); 131 auth_failed();
133 } else if (conn->type = AIM_CONN_TYPE_CHAT) { 132 } else if (conn->type == AIM_CONN_TYPE_CHAT) {
134 /* FIXME: we got disconnected from a chat room, but 133 /* FIXME: we got disconnected from a chat room, but
135 * libfaim won't tell us which room */ 134 * libfaim won't tell us which room */
136 debug_print("connection error for chat...\n"); 135 debug_print("connection error for chat...\n");
137 aim_conn_kill(gaim_sess, &conn); 136 aim_conn_kill(gaim_sess, &conn);
138 } else { 137 } else {
194 193
195 aim_conn_addhandler(sess, conn, 0x0017, 0x0007, gaim_parse_login, 0); 194 aim_conn_addhandler(sess, conn, 0x0017, 0x0007, gaim_parse_login, 0);
196 aim_conn_addhandler(sess, conn, 0x0017, 0x0003, gaim_parse_auth_resp, 0); 195 aim_conn_addhandler(sess, conn, 0x0017, 0x0003, gaim_parse_auth_resp, 0);
197 aim_sendconnack(sess, conn); 196 aim_sendconnack(sess, conn);
198 aim_request_login(sess, conn, username); 197 aim_request_login(sess, conn, username);
199 /*
200 aim_conn_addhandler(sess, conn, AIM_CB_FAM_SPECIAL,
201 AIM_CB_SPECIAL_AUTHSUCCESS,
202 gaim_parse_auth_resp, 0);
203 aim_conn_addhandler(sess, conn, AIM_CB_FAM_GEN,
204 AIM_CB_GEN_SERVERREADY,
205 gaim_auth_server_ready, 0);
206 aim_send_login(sess, conn, username, password, &info);
207 */
208 198
209 inpa = gdk_input_add(conn->fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION, 199 inpa = gdk_input_add(conn->fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION,
210 oscar_callback, conn); 200 oscar_callback, conn);
211 201
212 u = find_user(username); 202 u = find_user(username);
331 oscar_callback, bosconn); 321 oscar_callback, bosconn);
332 set_login_progress(4, _("Connection established, cookie sent")); 322 set_login_progress(4, _("Connection established, cookie sent"));
333 return 1; 323 return 1;
334 } 324 }
335 325
336 gboolean change_password = FALSE;
337 char *old_password;
338 char *new_password;
339
340 int gaim_auth_server_ready(struct aim_session_t *sess,
341 struct command_rx_struct *command, ...) {
342 debug_print("Authorization server is ready.\n");
343 aim_auth_clientready(sess, command->conn);
344 if (change_password) {
345 debug_print("Changing passwords...\n");
346 aim_auth_changepasswd(sess, command->conn, old_password,
347 new_password);
348 g_free(old_password);
349 g_free(new_password);
350 change_password = FALSE;
351 }
352 return 1;
353 }
354
355 int gaim_parse_login(struct aim_session_t *sess, 326 int gaim_parse_login(struct aim_session_t *sess,
356 struct command_rx_struct *command, ...) { 327 struct command_rx_struct *command, ...) {
357 struct client_info_s info = {"AOL Instant Messenger (TM), version 2.1.1187/WIN32", 4, 30, 3141, "us", "en", 0x0004, 0x0001, 0x055}; 328 struct client_info_s info = {"AOL Instant Messenger (TM), version 2.1.1187/WIN32", 4, 30, 3141, "us", "en", 0x0004, 0x0001, 0x055};
358 unsigned char *key; 329 unsigned char *key;
359 va_list ap; 330 va_list ap;
362 key = va_arg(ap, char *); 333 key = va_arg(ap, char *);
363 va_end(ap); 334 va_end(ap);
364 335
365 aim_send_login(sess, command->conn, 336 aim_send_login(sess, command->conn,
366 current_user->username, current_user->password, &info, key); 337 current_user->username, current_user->password, &info, key);
338 return 1;
367 } 339 }
368 340
369 int gaim_server_ready(struct aim_session_t *sess, 341 int gaim_server_ready(struct aim_session_t *sess,
370 struct command_rx_struct *command, ...) { 342 struct command_rx_struct *command, ...) {
371 static int id = 1; 343 static int id = 1;