Mercurial > pidgin
comparison src/oscar.c @ 741:58a6e6e26695
[gaim-migrate @ 751]
oscar logins work better (?), aliases in convo windows.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Tue, 22 Aug 2000 23:38:47 +0000 |
parents | d05d746384a7 |
children | f53e8f48628d |
comparison
equal
deleted
inserted
replaced
740:01d3c96867e2 | 741:58a6e6e26695 |
---|---|
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 *, ...); | 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 *, ...); | |
75 static int gaim_server_ready (struct aim_session_t *, struct command_rx_struct *, ...); | 76 static int gaim_server_ready (struct aim_session_t *, struct command_rx_struct *, ...); |
76 static int gaim_handle_redirect (struct aim_session_t *, struct command_rx_struct *, ...); | 77 static int gaim_handle_redirect (struct aim_session_t *, struct command_rx_struct *, ...); |
77 static int gaim_parse_oncoming (struct aim_session_t *, struct command_rx_struct *, ...); | 78 static int gaim_parse_oncoming (struct aim_session_t *, struct command_rx_struct *, ...); |
78 static int gaim_parse_offgoing (struct aim_session_t *, struct command_rx_struct *, ...); | 79 static int gaim_parse_offgoing (struct aim_session_t *, struct command_rx_struct *, ...); |
79 static int gaim_parse_incoming_im(struct aim_session_t *, struct command_rx_struct *, ...); | 80 static int gaim_parse_incoming_im(struct aim_session_t *, struct command_rx_struct *, ...); |
146 } | 147 } |
147 | 148 |
148 int oscar_login(char *username, char *password) { | 149 int oscar_login(char *username, char *password) { |
149 struct aim_session_t *sess; | 150 struct aim_session_t *sess; |
150 struct aim_conn_t *conn; | 151 struct aim_conn_t *conn; |
151 struct client_info_s info = {"AOL Instant Messenger (TM), version 2.1.1187/WIN32", 4, 30, 3141, "us", "en", 0x0004, 0x0001, 0x055}; | 152 /* struct client_info_s info = {"AOL Instant Messenger (TM), version 2.1.1187/WIN32", 4, 30, 3141, "us", "en", 0x0004, 0x0001, 0x055}; */ |
152 struct aim_user *u; | 153 struct aim_user *u; |
153 char buf[256]; | 154 char buf[256]; |
154 | 155 |
155 sprintf(debug_buff, _("Logging in %s\n"), username); | 156 sprintf(debug_buff, _("Logging in %s\n"), username); |
156 debug_print(debug_buff); | 157 debug_print(debug_buff); |
191 return -1; | 192 return -1; |
192 } | 193 } |
193 g_snprintf(buf, sizeof(buf), _("Signon: %s"), username); | 194 g_snprintf(buf, sizeof(buf), _("Signon: %s"), username); |
194 set_login_progress(2, buf); | 195 set_login_progress(2, buf); |
195 | 196 |
197 aim_conn_addhandler(sess, conn, 0x0017, 0x0007, gaim_parse_login, 0); | |
198 aim_conn_addhandler(sess, conn, 0x0017, 0x0003, gaim_parse_auth_resp, 0); | |
199 aim_sendconnack(sess, conn); | |
200 aim_request_login(sess, conn, username); | |
201 /* | |
196 aim_conn_addhandler(sess, conn, AIM_CB_FAM_SPECIAL, | 202 aim_conn_addhandler(sess, conn, AIM_CB_FAM_SPECIAL, |
197 AIM_CB_SPECIAL_AUTHSUCCESS, | 203 AIM_CB_SPECIAL_AUTHSUCCESS, |
198 gaim_parse_auth_resp, 0); | 204 gaim_parse_auth_resp, 0); |
199 aim_conn_addhandler(sess, conn, AIM_CB_FAM_GEN, | 205 aim_conn_addhandler(sess, conn, AIM_CB_FAM_GEN, |
200 AIM_CB_GEN_SERVERREADY, | 206 AIM_CB_GEN_SERVERREADY, |
201 gaim_auth_server_ready, 0); | 207 gaim_auth_server_ready, 0); |
202 aim_send_login(sess, conn, username, password, &info); | 208 aim_send_login(sess, conn, username, password, &info); |
209 */ | |
203 | 210 |
204 inpa = gdk_input_add(conn->fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION, | 211 inpa = gdk_input_add(conn->fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION, |
205 oscar_callback, conn); | 212 oscar_callback, conn); |
206 | 213 |
207 u = find_user(username); | 214 u = find_user(username); |
343 g_free(old_password); | 350 g_free(old_password); |
344 g_free(new_password); | 351 g_free(new_password); |
345 change_password = FALSE; | 352 change_password = FALSE; |
346 } | 353 } |
347 return 1; | 354 return 1; |
355 } | |
356 | |
357 int gaim_parse_login(struct aim_session_t *sess, | |
358 struct command_rx_struct *command, ...) { | |
359 struct client_info_s info = {"AOL Instant Messenger (TM), version 2.1.1187/WIN32", 4, 30, 3141, "us", "en", 0x0004, 0x0001, 0x055}; | |
360 unsigned char *key; | |
361 va_list ap; | |
362 | |
363 va_start(ap, command); | |
364 key = va_arg(ap, char *); | |
365 va_end(ap); | |
366 | |
367 aim_send_login(sess, command->conn, | |
368 current_user->username, current_user->password, &info, key); | |
348 } | 369 } |
349 | 370 |
350 int gaim_server_ready(struct aim_session_t *sess, | 371 int gaim_server_ready(struct aim_session_t *sess, |
351 struct command_rx_struct *command, ...) { | 372 struct command_rx_struct *command, ...) { |
352 static int id = 1; | 373 static int id = 1; |