annotate src/oscar.c @ 247:f6e8ea29b24f

[gaim-migrate @ 257] OSCAR: getting a user's info now displays in the dialog window as opposed to the debug window you can add people to your permit/deny list (but be warned - you will get a lot of noise if you do) committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sat, 20 May 2000 23:00:20 +0000
parents 3414ff74cb0f
children cfc73b8501a7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1 /*
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2 * gaim
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
4 * Some code copyright (C) 1998-1999, Mark Spencer <markster@marko.net>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
5 * libfaim code copyright 1998, 1999 Adam Fritzler <afritz@auk.cx>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
6 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
7 * This program is free software; you can redistribute it and/or modify
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
8 * it under the terms of the GNU General Public License as published by
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
9 * the Free Software Foundation; either version 2 of the License, or
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
10 * (at your option) any later version.
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
11 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
15 * GNU General Public License for more details.
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
16 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
17 * You should have received a copy of the GNU General Public License
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
18 * along with this program; if not, write to the Free Software
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
20 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
21 */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
22
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
23 #ifdef USE_OSCAR
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
24
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
25 #include <netdb.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
26 #include <gtk/gtk.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
27 #include <unistd.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
28 #include <errno.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
29 #include <netinet/in.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
30 #include <arpa/inet.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
31 #include <string.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
32 #include <stdlib.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
33 #include <stdio.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
34 #include <time.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
35 #include <sys/socket.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
36 #include <sys/stat.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
37 #include "gaim.h"
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
38 #include "aim.h"
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
39 #include "gnome_applet_mgr.h"
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
40
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
41 static int inpa = -1;
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
42 struct aim_session_t *gaim_sess;
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
43 struct aim_conn_t *gaim_conn;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
44
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
45 static int gaim_parse_auth_resp (struct aim_session_t *, struct command_rx_struct *, ...);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
46 static int gaim_auth_server_ready(struct aim_session_t *, struct command_rx_struct *, ...);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
47 static int gaim_server_ready (struct aim_session_t *, struct command_rx_struct *, ...);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
48 static int gaim_handle_redirect (struct aim_session_t *, struct command_rx_struct *, ...);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
49 static int gaim_parse_oncoming (struct aim_session_t *, struct command_rx_struct *, ...);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
50 static int gaim_parse_offgoing (struct aim_session_t *, struct command_rx_struct *, ...);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
51 static int gaim_parse_incoming_im(struct aim_session_t *, struct command_rx_struct *, ...);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
52 static int gaim_parse_misses (struct aim_session_t *, struct command_rx_struct *, ...);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
53 static int gaim_parse_user_info (struct aim_session_t *, struct command_rx_struct *, ...);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
54 static int gaim_parse_motd (struct aim_session_t *, struct command_rx_struct *, ...);
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
55 static int gaim_chatnav_info (struct aim_session_t *, struct command_rx_struct *, ...);
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
56 static int gaim_chat_join (struct aim_session_t *, struct command_rx_struct *, ...);
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
57 static int gaim_chat_leave (struct aim_session_t *, struct command_rx_struct *, ...);
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
58 static int gaim_chat_info_update (struct aim_session_t *, struct command_rx_struct *, ...);
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
59 static int gaim_chat_incoming_msg(struct aim_session_t *, struct command_rx_struct *, ...);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
60
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
61 static void oscar_callback(gpointer data, gint source,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
62 GdkInputCondition condition) {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
63 struct aim_session_t *sess = (struct aim_session_t *)data;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
64 struct aim_conn_t *conn = NULL;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
65 struct timeval tv;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
66 int selstat;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
67
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
68 tv.tv_sec = 0; tv.tv_usec = 0;
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
69 conn = aim_select(sess, &tv, &selstat);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
70
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
71 switch(selstat) {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
72 case -1: /* error */
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
73 signoff();
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
74 hide_login_progress("Disconnected.");
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
75 aim_logoff(sess);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
76 gdk_input_remove(inpa);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
77 break;
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
78 case 0:
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
79 gdk_input_remove(inpa);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
80 while (gtk_events_pending())
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
81 gtk_main_iteration();
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
82 inpa = gdk_input_add(gaim_conn->fd,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
83 GDK_INPUT_READ | GDK_INPUT_WRITE |
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
84 GDK_INPUT_EXCEPTION,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
85 oscar_callback, sess);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
86 break;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
87 case 1: /* outgoing data pending */
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
88 aim_tx_flushqueue(sess);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
89 break;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
90 case 2: /* incoming data pending */
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
91 if (aim_get_command(sess, conn) < 0) {
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
92 debug_print("connection error!\n");
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
93 signoff();
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
94 hide_login_progress("Disconnected.");
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
95 aim_logoff(sess);
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
96 gdk_input_remove(inpa);
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
97 } else
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
98 aim_rxdispatch(sess);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
99 break;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
100 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
101 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
102
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
103 int oscar_login(char *username, char *password) {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
104 struct aim_session_t *sess;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
105 struct aim_conn_t *conn;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
106 struct client_info_s info = {"Gaim/Faim", 3, 5, 1670, "us", "en"};
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
107 char buf[256];
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
108
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
109 sess = g_new0(struct aim_session_t, 1);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
110 aim_session_init(sess);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
111
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
112 sprintf(buf, "Looking up %s", FAIM_LOGIN_SERVER);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
113 set_login_progress(1, buf);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
114 conn = aim_newconn(sess, AIM_CONN_TYPE_AUTH, FAIM_LOGIN_SERVER);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
115
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
116 if (conn == NULL) {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
117 debug_print("internal connection error\n");
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
118 #ifdef USE_APPLET
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
119 setUserState(offline);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
120 #endif
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
121 set_state(STATE_OFFLINE);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
122 hide_login_progress("Unable to login to AIM");
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
123 return -1;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
124 } else if (conn->fd == -1) {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
125 #ifdef USE_APPLET
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
126 setUserState(offline);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
127 #endif
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
128 set_state(STATE_OFFLINE);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
129 if (conn->status & AIM_CONN_STATUS_RESOLVERR) {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
130 sprintf(debug_buff, "couldn't resolve host\n");
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
131 debug_print(debug_buff);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
132 hide_login_progress(debug_buff);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
133 } else if (conn->status & AIM_CONN_STATUS_CONNERR) {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
134 sprintf(debug_buff, "couldn't connect to host\n");
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
135 debug_print(debug_buff);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
136 hide_login_progress(debug_buff);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
137 }
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
138 return -1;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
139 }
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
140 g_snprintf(buf, sizeof(buf), "Signon: %s", username);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
141 set_login_progress(2, buf);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
142
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
143 aim_conn_addhandler(sess, conn, AIM_CB_FAM_SPECIAL,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
144 AIM_CB_SPECIAL_AUTHSUCCESS,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
145 gaim_parse_auth_resp, 0);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
146 aim_conn_addhandler(sess, conn, AIM_CB_FAM_GEN,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
147 AIM_CB_GEN_SERVERREADY,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
148 gaim_auth_server_ready, 0);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
149 aim_send_login(sess, conn, username, password, &info);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
150
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
151 gaim_conn = conn;
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
152 inpa = gdk_input_add(conn->fd,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
153 GDK_INPUT_READ | GDK_INPUT_EXCEPTION,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
154 oscar_callback, sess);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
155
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
156 if (!current_user) {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
157 current_user = g_new0(struct aim_user, 1);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
158 g_snprintf(current_user->username, sizeof(current_user->username),
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
159 DEFAULT_INFO);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
160 aim_users = g_list_append(aim_users, current_user);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
161 }
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
162 g_snprintf(current_user->username, sizeof(current_user->username),
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
163 "%s", username);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
164 g_snprintf(current_user->password, sizeof(current_user->password),
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
165 "%s", password);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
166 save_prefs();
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
167
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
168 return 0;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
169 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
170
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
171 int oscar_send_im(char *name, char *msg, int away) {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
172 if (away)
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
173 aim_send_im(gaim_sess, gaim_conn, name, AIM_IMFLAGS_AWAY, msg);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
174 else
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
175 aim_send_im(gaim_sess, gaim_conn, name, 0, msg);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
176 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
177
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
178 void oscar_close() {
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
179 #ifdef USE_APPLET
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
180 setUserState(offline);
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
181 #endif
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
182 set_state(STATE_OFFLINE);
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
183 if (inpa > 0)
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
184 gdk_input_remove(inpa);
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
185 inpa = -1;
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
186 aim_logoff(gaim_sess);
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
187 }
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
188
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
189 int gaim_parse_auth_resp(struct aim_session_t *sess,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
190 struct command_rx_struct *command, ...) {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
191 struct aim_conn_t *bosconn = NULL;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
192 sprintf(debug_buff, "inside auth_resp (Screen name: %s)\n",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
193 sess->logininfo.screen_name);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
194 debug_print(debug_buff);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
195
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
196 if (sess->logininfo.errorcode) {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
197 sprintf(debug_buff, "Login Error Code 0x%04x\n",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
198 sess->logininfo.errorcode);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
199 debug_print(debug_buff);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
200 sprintf(debug_buff, "Error URL: %s\n",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
201 sess->logininfo.errorurl);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
202 debug_print(debug_buff);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
203 #ifdef USE_APPLET
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
204 setUserState(offline);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
205 #endif
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
206 set_state(STATE_OFFLINE);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
207 hide_login_progress("Authentication Failed");
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
208 gdk_input_remove(inpa);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
209 aim_conn_close(command->conn);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
210 return 0;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
211 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
212
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
213
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
214 sprintf(debug_buff, "Email: %s\n", sess->logininfo.email);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
215 debug_print(debug_buff);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
216 sprintf(debug_buff, "Closing auth connection...\n");
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
217 debug_print(debug_buff);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
218 gdk_input_remove(inpa);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
219 aim_conn_close(command->conn);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
220
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
221 bosconn = aim_newconn(sess, AIM_CONN_TYPE_BOS, sess->logininfo.BOSIP);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
222 if (bosconn == NULL) {
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
223 #ifdef USE_APPLET
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
224 setUserState(offline);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
225 #endif
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
226 set_state(STATE_OFFLINE);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
227 hide_login_progress("Internal Error");
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
228 return -1;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
229 } else if (bosconn->status != 0) {
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
230 #ifdef USE_APPLET
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
231 setUserState(offline);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
232 #endif
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
233 set_state(STATE_OFFLINE);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
234 hide_login_progress("Could Not Connect");
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
235 return -1;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
236 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
237
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
238 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_ACK, AIM_CB_ACK_ACK, NULL, 0);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
239 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_GEN, AIM_CB_GEN_SERVERREADY, gaim_server_ready, 0);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
240 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_GEN, AIM_CB_GEN_RATEINFO, NULL, 0);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
241 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_GEN, AIM_CB_GEN_REDIRECT, gaim_handle_redirect, 0);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
242 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_STS, AIM_CB_STS_SETREPORTINTERVAL, NULL, 0);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
243 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_BUD, AIM_CB_BUD_ONCOMING, gaim_parse_oncoming, 0);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
244 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_BUD, AIM_CB_BUD_OFFGOING, gaim_parse_offgoing, 0);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
245 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_MSG, AIM_CB_MSG_INCOMING, gaim_parse_incoming_im, 0);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
246 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_LOC, AIM_CB_LOC_ERROR, gaim_parse_misses, 0);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
247 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_MSG, AIM_CB_MSG_MISSEDCALL, gaim_parse_misses, 0);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
248 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_GEN, AIM_CB_GEN_RATECHANGE, gaim_parse_misses, 0);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
249 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_MSG, AIM_CB_MSG_ERROR, gaim_parse_misses, 0);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
250 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_LOC, AIM_CB_LOC_USERINFO, gaim_parse_user_info, 0);
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
251 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_CTN, AIM_CB_CTN_DEFAULT, aim_parse_unknown, 0);
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
252 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_DEFAULT, aim_parse_unknown, 0);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
253 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_GEN, AIM_CB_GEN_MOTD, gaim_parse_motd, 0);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
254
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
255 aim_auth_sendcookie(sess, bosconn, sess->logininfo.cookie);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
256 inpa = gdk_input_add(bosconn->fd,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
257 GDK_INPUT_READ | GDK_INPUT_WRITE | GDK_INPUT_EXCEPTION,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
258 oscar_callback, sess);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
259 set_login_progress(4, "Connection established, cookie sent");
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
260 return 1;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
261 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
262
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
263 int gaim_auth_server_ready(struct aim_session_t *sess,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
264 struct command_rx_struct *command, ...) {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
265 aim_auth_clientready(sess, command->conn);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
266 return 1;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
267 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
268
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
269 int gaim_server_ready(struct aim_session_t *sess,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
270 struct command_rx_struct *command, ...) {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
271 switch (command->conn->type) {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
272 case AIM_CONN_TYPE_BOS:
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
273 aim_bos_reqrate(sess, command->conn);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
274 aim_bos_ackrateresp(sess, command->conn);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
275 aim_bos_setprivacyflags(sess, command->conn, 0x00000003);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
276 aim_bos_reqservice(sess, command->conn, AIM_CONN_TYPE_ADS);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
277 aim_setversions(sess, command->conn);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
278 aim_bos_setgroupperm(sess, command->conn, 0x1f);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
279 debug_print("done with BOS ServerReady\n");
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
280 break;
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
281 case AIM_CONN_TYPE_CHATNAV:
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
282 aim_conn_addhandler(sess, command->conn, AIM_CB_FAM_CTN, AIM_CB_CTN_INFO, gaim_chatnav_info, 0);
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
283 aim_bos_reqrate(sess, command->conn);
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
284 aim_bos_ackrateresp(sess, command->conn);
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
285 aim_chatnav_clientready(sess, command->conn);
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
286 aim_chatnav_reqrights(sess, command->conn);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
287 break;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
288 case AIM_CONN_TYPE_CHAT:
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
289 aim_conn_addhandler(sess, command->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_USERJOIN, gaim_chat_join, 0);
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
290 aim_conn_addhandler(sess, command->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_USERLEAVE, gaim_chat_leave, 0);
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
291 aim_conn_addhandler(sess, command->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_ROOMINFOUPDATE, gaim_chat_info_update, 0);
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
292 aim_conn_addhandler(sess, command->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_INCOMINGMSG, gaim_chat_incoming_msg, 0);
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
293 aim_bos_reqrate(sess, command->conn);
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
294 aim_bos_ackrateresp(sess, command->conn);
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
295 aim_chat_clientready(sess, command->conn);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
296 break;
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
297 default: /* huh? */
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
298 break;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
299 }
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
300 return 1;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
301 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
302
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
303 int gaim_handle_redirect(struct aim_session_t *sess,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
304 struct command_rx_struct *command, ...) {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
305 va_list ap;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
306 int serviceid;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
307 char *ip;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
308 char *cookie;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
309
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
310 char buddies[] = "EWarmenhoven&";
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
311 char profile[] = "Hello";
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
312
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
313 va_start(ap, command);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
314 serviceid = va_arg(ap, int);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
315 ip = va_arg(ap, char *);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
316 cookie = va_arg(ap, char *);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
317
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
318 switch(serviceid) {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
319 case 0x0005: /* Ads */
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
320 aim_bos_setbuddylist(sess, command->conn, buddies);
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
321 aim_bos_setprofile(sess, command->conn, profile,
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
322 NULL, AIM_CAPS_CHAT);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
323
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
324 aim_bos_clientready(sess, command->conn);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
325
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
326 gaim_sess = sess;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
327 gaim_conn = command->conn;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
328
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
329 debug_print("Roger that, all systems go\n");
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
330 #ifdef USE_APPLET
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
331 make_buddy();
74
e16ad7d73cd6 [gaim-migrate @ 84]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 10
diff changeset
332 if (general_options & OPT_GEN_APP_BUDDY_SHOW) {
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
333 gnome_buddy_show();
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
334 createOnlinePopup();
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
335 set_applet_draw_open();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
336 } else {
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
337 gnome_buddy_hide();
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
338 set_applet_draw_closed();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
339 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
340 setUserState(online);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
341 gtk_widget_hide(mainwindow);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
342 #else
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
343 gtk_widget_hide(mainwindow);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
344 show_buddy_list();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
345 refresh_buddy_window();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
346 #endif
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
347 serv_finish_login();
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
348 if (bud_list_cache_exists())
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
349 do_import(NULL, 0);
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
350
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
351 break;
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
352 case 0x7: /* Authorizer */
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
353 {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
354 struct aim_conn_t *tstconn = aim_newconn(sess, AIM_CONN_TYPE_AUTH, ip);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
355 if (tstconn == NULL || tstconn->status >= AIM_CONN_STATUS_RESOLVERR)
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
356 debug_print("unable to reconnect with authorizer\n");
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
357 else
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
358 aim_auth_sendcookie(sess, tstconn, cookie);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
359 }
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
360 break;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
361 case 0xd: /* ChatNav */
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
362 {
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
363 struct aim_conn_t *tstconn = aim_newconn(sess, AIM_CONN_TYPE_CHATNAV, ip);
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
364 if (tstconn == NULL || tstconn->status >= AIM_CONN_STATUS_RESOLVERR) {
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
365 debug_print("unable to connect to chatnav server\n");
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
366 return 1;
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
367 }
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
368 aim_conn_addhandler(sess, tstconn, 0x0001, 0x0003, gaim_server_ready, 0);
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
369 aim_auth_sendcookie(sess, tstconn, cookie);
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
370 }
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
371 debug_print("chatnav: connected\n");
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
372 break;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
373 case 0xe: /* Chat */
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
374 {
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
375 struct aim_conn_t *tstconn = aim_newconn(sess, AIM_CONN_TYPE_CHAT, ip);
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
376 char *roomname = va_arg(ap, char *);
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
377 if (tstconn == NULL || tstconn->status >= AIM_CONN_STATUS_RESOLVERR) {
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
378 debug_print("unable to connect to chat server\n");
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
379 return 1;
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
380 }
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
381 aim_chat_attachname(tstconn, roomname);
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
382 aim_conn_addhandler(sess, tstconn, 0x0001, 0x0003, gaim_server_ready, 0);
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
383 aim_auth_sendcookie(sess, tstconn, cookie);
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
384 }
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
385 break;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
386 default: /* huh? */
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
387 sprintf(debug_buff, "got redirect for unknown service 0x%04x\n",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
388 serviceid);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
389 debug_print(debug_buff);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
390 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
391 }
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
392
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
393 va_end(ap);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
394
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
395 return 1;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
396 }
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
397
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
398 int gaim_parse_oncoming(struct aim_session_t *sess,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
399 struct command_rx_struct *command, ...) {
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
400 struct aim_userinfo_s *info;
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
401 time_t time_idle;
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
402 int type = 0;
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
403
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
404 va_list ap;
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
405 va_start(ap, command);
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
406 info = va_arg(ap, struct aim_userinfo_s *);
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
407 va_end(ap);
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
408
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
409 if (info->class & AIM_CLASS_TRIAL)
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
410 type |= UC_UNCONFIRMED;
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
411 if (info->class & AIM_CLASS_AOL)
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
412 type |= UC_AOL;
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
413 if (info->class & AIM_CLASS_FREE)
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
414 type |= UC_NORMAL;
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
415 if (info->class & AIM_CLASS_AWAY)
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
416 type |= UC_UNAVAILABLE;
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
417
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
418 if (info->idletime) {
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
419 time(&time_idle);
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
420 time_idle -= info->idletime*60;
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
421 } else
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
422 time_idle = 0;
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
423
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
424 serv_got_update(info->sn, 1, info->warnlevel, info->onlinesince,
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
425 time_idle, type);
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
426
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
427 return 1;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
428 }
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
429
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
430 int gaim_parse_offgoing(struct aim_session_t *sess,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
431 struct command_rx_struct *command, ...) {
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
432 char *sn;
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
433 va_list ap;
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
434
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
435 va_start(ap, command);
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
436 sn = va_arg(ap, char *);
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
437 va_end(ap);
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
438
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
439 serv_got_update(sn, 0, 0, 0, 0, 0);
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
440
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
441 return 1;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
442 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
443
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
444 int gaim_parse_incoming_im(struct aim_session_t *sess,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
445 struct command_rx_struct *command, ...) {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
446 int channel;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
447 va_list ap;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
448
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
449 va_start(ap, command);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
450 channel = va_arg(ap, int);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
451
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
452 /* channel 1: standard message */
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
453 if (channel == 1) {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
454 struct aim_userinfo_s *userinfo;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
455 char *msg = NULL;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
456 u_int icbmflags = 0;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
457 char *tmpstr = NULL;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
458 u_short flag1, flag2;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
459
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
460 userinfo = va_arg(ap, struct aim_userinfo_s *);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
461 msg = va_arg(ap, char *);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
462 icbmflags = va_arg(ap, u_int);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
463 flag1 = va_arg(ap, u_short);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
464 flag2 = va_arg(ap, u_short);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
465 va_end(ap);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
466
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
467 serv_got_im(userinfo->sn, msg, icbmflags & AIM_IMFLAGS_AWAY);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
468 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
469
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
470 return 1;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
471 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
472
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
473 int gaim_parse_misses(struct aim_session_t *sess,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
474 struct command_rx_struct *command, ...) {
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
475 u_short family;
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
476 u_short subtype;
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
477
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
478 char buf[2048], buf2[256];
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
479 sprintf(buf2, "Gaim - Error");
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
480 buf[0] = 0;
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
481
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
482 family = aimutil_get16(command->data+0);
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
483 subtype = aimutil_get16(command->data+2);
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
484
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
485 switch (family) {
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
486 /* case 0x0001:
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
487 if (subtype == 0x000a)
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
488 sprintf(buf, "You are sending messages too fast.");
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
489 break;
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
490 */ case 0x0002:
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
491 if (subtype == 0x0001)
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
492 sprintf(buf, "Unknown SNAC error (I'm hungry)");
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
493 break;
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
494 case 0x0004:
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
495 if (subtype == 0x0001)
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
496 sprintf(buf, "User is not online.");
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
497 else if (subtype == 0x000a)
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
498 sprintf(buf, "A message has been dropped.");
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
499 break;
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
500 }
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
501
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
502 if (buf[0] != 0)
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
503 do_error_dialog(buf, buf2);
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
504
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
505 return 1;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
506 }
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
507
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
508 int gaim_parse_user_info(struct aim_session_t *sess,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
509 struct command_rx_struct *command, ...) {
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
510 struct aim_userinfo_s *info;
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
511 char *prof_enc = NULL, *prof = NULL;
247
f6e8ea29b24f [gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 243
diff changeset
512 char buf[BUF_LONG];
f6e8ea29b24f [gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 243
diff changeset
513 va_list ap;
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
514
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
515 va_start(ap, command);
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
516 info = va_arg(ap, struct aim_userinfo_s *);
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
517 prof_enc = va_arg(ap, char *);
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
518 prof = va_arg(ap, char *);
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
519 va_end(ap);
247
f6e8ea29b24f [gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 243
diff changeset
520
f6e8ea29b24f [gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 243
diff changeset
521 snprintf(buf, sizeof buf, "Username : <B>%s</B>\n<BR>"
f6e8ea29b24f [gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 243
diff changeset
522 "Warning Level : <B>%d %%</B>\n<BR>"
f6e8ea29b24f [gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 243
diff changeset
523 "Online Since : <B>%s</B><BR>"
f6e8ea29b24f [gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 243
diff changeset
524 "Idle Minutes : <B>%d</B>\n<BR><HR><BR>"
f6e8ea29b24f [gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 243
diff changeset
525 "%s\n",
f6e8ea29b24f [gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 243
diff changeset
526 info->sn,
f6e8ea29b24f [gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 243
diff changeset
527 info->warnlevel,
f6e8ea29b24f [gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 243
diff changeset
528 asctime(localtime(&info->onlinesince)),
f6e8ea29b24f [gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 243
diff changeset
529 info->idletime,
f6e8ea29b24f [gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 243
diff changeset
530 prof);
f6e8ea29b24f [gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 243
diff changeset
531 g_show_info_text(buf);
f6e8ea29b24f [gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 243
diff changeset
532
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
533 return 1;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
534 }
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
535
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
536 int gaim_parse_motd(struct aim_session_t *sess,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
537 struct command_rx_struct *command, ...) {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
538 char *msg;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
539 u_short id;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
540 va_list ap;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
541
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
542 va_start(ap, command);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
543 id = va_arg(ap, u_short);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
544 msg = va_arg(ap, char *);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
545 va_end(ap);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
546
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
547 sprintf(debug_buff, "MOTD: %s\n", msg);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
548 debug_print(debug_buff);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
549
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
550 return 1;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
551 }
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
552
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
553 int gaim_chatnav_info(struct aim_session_t *sess,
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
554 struct command_rx_struct *command, ...) {
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
555 /* FIXME */
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
556 return 1;
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
557 }
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
558
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
559 int gaim_chat_join(struct aim_session_t *sess,
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
560 struct command_rx_struct *command, ...) {
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
561 /* FIXME */
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
562 return 1;
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
563 }
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
564
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
565 int gaim_chat_leave(struct aim_session_t *sess,
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
566 struct command_rx_struct *command, ...) {
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
567 /* FIXME */
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
568 return 1;
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
569 }
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
570
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
571 int gaim_chat_info_update(struct aim_session_t *sess,
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
572 struct command_rx_struct *command, ...) {
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
573 /* FIXME */
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
574 return 1;
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
575 }
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
576
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
577 int gaim_chat_incoming_msg(struct aim_session_t *sess,
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
578 struct command_rx_struct *command, ...) {
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
579 /* FIXME */
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
580 return 1;
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
581 }
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
582
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
583 #endif /* USE_OSCAR */