Mercurial > pidgin.yaz
annotate src/oscar.c @ 283:0f14e6d8a51b
[gaim-migrate @ 293]
- Good fun things here. Sometimes I think Adam does things just to make
it difficult for me, I swear (j/k :) ).
- I moved all the .h files into the faim/ directory because I'm tired
of changing faim/aim.h to just aim.h every time Adam makes an update.
- libfaim can now send messages much longer than WinAIM or TOC can. But,
the length checking code is still in conversation.c, and I haven't
changed it yet, mostly because I'm lazy.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Wed, 31 May 2000 03:20:11 +0000 |
parents | 918db59d3814 |
children | 6e609d42f767 |
rev | line source |
---|---|
1 | 1 /* |
2 * gaim | |
3 * | |
4 * Some code copyright (C) 1998-1999, Mark Spencer <markster@marko.net> | |
5 * libfaim code copyright 1998, 1999 Adam Fritzler <afritz@auk.cx> | |
6 * | |
7 * This program is free software; you can redistribute it and/or modify | |
8 * it under the terms of the GNU General Public License as published by | |
9 * the Free Software Foundation; either version 2 of the License, or | |
10 * (at your option) any later version. | |
11 * | |
12 * This program is distributed in the hope that it will be useful, | |
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 * GNU General Public License for more details. | |
16 * | |
17 * You should have received a copy of the GNU General Public License | |
18 * along with this program; if not, write to the Free Software | |
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
20 * | |
21 */ | |
22 | |
23 #ifdef USE_OSCAR | |
24 | |
25 #include <netdb.h> | |
26 #include <gtk/gtk.h> | |
27 #include <unistd.h> | |
28 #include <errno.h> | |
29 #include <netinet/in.h> | |
30 #include <arpa/inet.h> | |
31 #include <string.h> | |
32 #include <stdlib.h> | |
33 #include <stdio.h> | |
34 #include <time.h> | |
35 #include <sys/socket.h> | |
36 #include <sys/stat.h> | |
37 #include "gaim.h" | |
283
0f14e6d8a51b
[gaim-migrate @ 293]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
282
diff
changeset
|
38 #include <aim.h> |
1 | 39 #include "gnome_applet_mgr.h" |
40 | |
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; |
276
9e6fc62490cd
[gaim-migrate @ 286]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
274
diff
changeset
|
44 int gaim_caps = AIM_CAPS_CHAT | AIM_CAPS_SENDFILE | AIM_CAPS_GETFILE; |
1 | 45 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
46 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
|
47 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
|
48 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
|
49 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
|
50 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
|
51 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
|
52 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
|
53 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
|
54 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
|
55 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
|
56 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
|
57 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
|
58 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
|
59 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
|
60 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
|
61 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
62 static void oscar_callback(gpointer data, gint source, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
63 GdkInputCondition condition) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
64 struct aim_session_t *sess = (struct aim_session_t *)data; |
1 | 65 |
259
e159ba2486fc
[gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
66 if (condition & GDK_INPUT_EXCEPTION) { |
e159ba2486fc
[gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
67 signoff(); |
e159ba2486fc
[gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
68 hide_login_progress("Disconnected."); |
e159ba2486fc
[gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
69 aim_logoff(sess); |
e159ba2486fc
[gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
70 gdk_input_remove(inpa); |
e159ba2486fc
[gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
71 return; |
e159ba2486fc
[gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
72 } |
e159ba2486fc
[gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
73 if (condition & GDK_INPUT_READ) { |
e159ba2486fc
[gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
74 if (aim_get_command(sess, gaim_conn) < 0) { |
e159ba2486fc
[gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
75 debug_print("connection error!\n"); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
76 signoff(); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
77 hide_login_progress("Disconnected."); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
78 aim_logoff(sess); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
79 gdk_input_remove(inpa); |
259
e159ba2486fc
[gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
80 } else { |
267
5c19f91e7ce4
[gaim-migrate @ 277]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
265
diff
changeset
|
81 aim_rxdispatch(sess); |
259
e159ba2486fc
[gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
82 } |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
83 } |
1 | 84 } |
85 | |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
86 int oscar_login(char *username, char *password) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
87 struct aim_session_t *sess; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
88 struct aim_conn_t *conn; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
89 struct client_info_s info = {"Gaim/Faim", 3, 5, 1670, "us", "en"}; |
253
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
252
diff
changeset
|
90 struct aim_user *u; |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
91 char buf[256]; |
1 | 92 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
93 sess = g_new0(struct aim_session_t, 1); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
94 aim_session_init(sess); |
279
501e09c51cbc
[gaim-migrate @ 289]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
277
diff
changeset
|
95 /* we need an immediate queue because we don't use a while-loop to |
501e09c51cbc
[gaim-migrate @ 289]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
277
diff
changeset
|
96 * see if things need to be sent. */ |
501e09c51cbc
[gaim-migrate @ 289]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
277
diff
changeset
|
97 sess->tx_enqueue = &aim_tx_enqueue__immediate; |
501e09c51cbc
[gaim-migrate @ 289]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
277
diff
changeset
|
98 gaim_sess = sess; |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
99 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
100 sprintf(buf, "Looking up %s", FAIM_LOGIN_SERVER); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
101 set_login_progress(1, buf); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
102 conn = aim_newconn(sess, AIM_CONN_TYPE_AUTH, FAIM_LOGIN_SERVER); |
1 | 103 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
104 if (conn == NULL) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
105 debug_print("internal connection error\n"); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
106 #ifdef USE_APPLET |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
107 setUserState(offline); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
108 #endif |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
109 set_state(STATE_OFFLINE); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
110 hide_login_progress("Unable to login to AIM"); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
111 return -1; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
112 } else if (conn->fd == -1) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
113 #ifdef USE_APPLET |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
114 setUserState(offline); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
115 #endif |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
116 set_state(STATE_OFFLINE); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
117 if (conn->status & AIM_CONN_STATUS_RESOLVERR) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
118 sprintf(debug_buff, "couldn't resolve host\n"); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
119 debug_print(debug_buff); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
120 hide_login_progress(debug_buff); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
121 } else if (conn->status & AIM_CONN_STATUS_CONNERR) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
122 sprintf(debug_buff, "couldn't connect to host\n"); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
123 debug_print(debug_buff); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
124 hide_login_progress(debug_buff); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
125 } |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
126 return -1; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
127 } |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
128 g_snprintf(buf, sizeof(buf), "Signon: %s", username); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
129 set_login_progress(2, buf); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
130 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
131 aim_conn_addhandler(sess, conn, AIM_CB_FAM_SPECIAL, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
132 AIM_CB_SPECIAL_AUTHSUCCESS, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
133 gaim_parse_auth_resp, 0); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
134 aim_conn_addhandler(sess, conn, AIM_CB_FAM_GEN, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
135 AIM_CB_GEN_SERVERREADY, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
136 gaim_auth_server_ready, 0); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
137 aim_send_login(sess, conn, username, password, &info); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
138 |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
139 gaim_conn = conn; |
270
cfa39d39dec6
[gaim-migrate @ 280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
267
diff
changeset
|
140 inpa = gdk_input_add(conn->fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION, |
259
e159ba2486fc
[gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
141 oscar_callback, sess); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
142 |
253
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
252
diff
changeset
|
143 u = find_user(username); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
252
diff
changeset
|
144 |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
252
diff
changeset
|
145 if (!u) { |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
252
diff
changeset
|
146 u = g_new0(struct aim_user, 1); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
252
diff
changeset
|
147 g_snprintf(u->username, sizeof(u->username), DEFAULT_INFO); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
252
diff
changeset
|
148 aim_users = g_list_append(aim_users, u); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
149 } |
253
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
252
diff
changeset
|
150 current_user = u; |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
151 g_snprintf(current_user->username, sizeof(current_user->username), |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
152 "%s", username); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
153 g_snprintf(current_user->password, sizeof(current_user->password), |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
154 "%s", password); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
155 save_prefs(); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
156 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
157 return 0; |
1 | 158 } |
159 | |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
160 int oscar_send_im(char *name, char *msg, int away) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
161 if (away) |
270
cfa39d39dec6
[gaim-migrate @ 280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
267
diff
changeset
|
162 return aim_send_im(gaim_sess, gaim_conn, name, AIM_IMFLAGS_AWAY, msg); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
163 else |
270
cfa39d39dec6
[gaim-migrate @ 280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
267
diff
changeset
|
164 return aim_send_im(gaim_sess, gaim_conn, name, 0, msg); |
1 | 165 } |
166 | |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
167 void oscar_close() { |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
168 #ifdef USE_APPLET |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
169 setUserState(offline); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
170 #endif |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
171 set_state(STATE_OFFLINE); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
172 if (inpa > 0) |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
173 gdk_input_remove(inpa); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
174 inpa = -1; |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
175 aim_logoff(gaim_sess); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
176 } |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
177 |
270
cfa39d39dec6
[gaim-migrate @ 280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
267
diff
changeset
|
178 extern void auth_failed(); |
cfa39d39dec6
[gaim-migrate @ 280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
267
diff
changeset
|
179 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
180 int gaim_parse_auth_resp(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
181 struct command_rx_struct *command, ...) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
182 struct aim_conn_t *bosconn = NULL; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
183 sprintf(debug_buff, "inside auth_resp (Screen name: %s)\n", |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
184 sess->logininfo.screen_name); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
185 debug_print(debug_buff); |
1 | 186 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
187 if (sess->logininfo.errorcode) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
188 sprintf(debug_buff, "Login Error Code 0x%04x\n", |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
189 sess->logininfo.errorcode); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
190 debug_print(debug_buff); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
191 sprintf(debug_buff, "Error URL: %s\n", |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
192 sess->logininfo.errorurl); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
193 debug_print(debug_buff); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
194 #ifdef USE_APPLET |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
195 setUserState(offline); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
196 #endif |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
197 set_state(STATE_OFFLINE); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
198 hide_login_progress("Authentication Failed"); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
199 gdk_input_remove(inpa); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
200 aim_conn_close(command->conn); |
270
cfa39d39dec6
[gaim-migrate @ 280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
267
diff
changeset
|
201 auth_failed(); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
202 return 0; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
203 } |
1 | 204 |
205 | |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
206 sprintf(debug_buff, "Email: %s\n", sess->logininfo.email); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
207 debug_print(debug_buff); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
208 sprintf(debug_buff, "Closing auth connection...\n"); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
209 debug_print(debug_buff); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
210 gdk_input_remove(inpa); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
211 aim_conn_close(command->conn); |
1 | 212 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
213 bosconn = aim_newconn(sess, AIM_CONN_TYPE_BOS, sess->logininfo.BOSIP); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
214 if (bosconn == NULL) { |
1 | 215 #ifdef USE_APPLET |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
216 setUserState(offline); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
217 #endif |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
218 set_state(STATE_OFFLINE); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
219 hide_login_progress("Internal Error"); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
220 return -1; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
221 } else if (bosconn->status != 0) { |
1 | 222 #ifdef USE_APPLET |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
223 setUserState(offline); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
224 #endif |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
225 set_state(STATE_OFFLINE); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
226 hide_login_progress("Could Not Connect"); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
227 return -1; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
228 } |
279
501e09c51cbc
[gaim-migrate @ 289]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
277
diff
changeset
|
229 gaim_conn = bosconn; |
1 | 230 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
231 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
|
232 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
|
233 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
|
234 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
|
235 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
|
236 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
|
237 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
|
238 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
|
239 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
|
240 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
|
241 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
|
242 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
|
243 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
|
244 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
|
245 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
|
246 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
|
247 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
248 aim_auth_sendcookie(sess, bosconn, sess->logininfo.cookie); |
270
cfa39d39dec6
[gaim-migrate @ 280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
267
diff
changeset
|
249 inpa = gdk_input_add(bosconn->fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION, |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
250 oscar_callback, sess); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
251 set_login_progress(4, "Connection established, cookie sent"); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
252 return 1; |
1 | 253 } |
254 | |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
255 int gaim_auth_server_ready(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
256 struct command_rx_struct *command, ...) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
257 aim_auth_clientready(sess, command->conn); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
258 return 1; |
1 | 259 } |
260 | |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
261 int gaim_server_ready(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
262 struct command_rx_struct *command, ...) { |
276
9e6fc62490cd
[gaim-migrate @ 286]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
274
diff
changeset
|
263 static int id = 1; |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
264 switch (command->conn->type) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
265 case AIM_CONN_TYPE_BOS: |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
266 aim_bos_reqrate(sess, command->conn); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
267 aim_bos_ackrateresp(sess, command->conn); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
268 aim_bos_setprivacyflags(sess, command->conn, 0x00000003); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
269 aim_bos_reqservice(sess, command->conn, AIM_CONN_TYPE_ADS); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
270 aim_setversions(sess, command->conn); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
271 aim_bos_setgroupperm(sess, command->conn, 0x1f); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
272 debug_print("done with BOS ServerReady\n"); |
1 | 273 break; |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
274 case AIM_CONN_TYPE_CHATNAV: |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
275 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
|
276 aim_bos_reqrate(sess, command->conn); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
277 aim_bos_ackrateresp(sess, command->conn); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
278 aim_chatnav_clientready(sess, command->conn); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
279 aim_chatnav_reqrights(sess, command->conn); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
280 break; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
281 case AIM_CONN_TYPE_CHAT: |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
282 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
|
283 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
|
284 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
|
285 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
|
286 aim_bos_reqrate(sess, command->conn); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
287 aim_bos_ackrateresp(sess, command->conn); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
288 aim_chat_clientready(sess, command->conn); |
276
9e6fc62490cd
[gaim-migrate @ 286]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
274
diff
changeset
|
289 serv_got_joined_chat(id++, aim_chat_getname(command->conn)); |
1 | 290 break; |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
291 default: /* huh? */ |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
292 break; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
293 } |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
294 return 1; |
1 | 295 } |
296 | |
270
cfa39d39dec6
[gaim-migrate @ 280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
267
diff
changeset
|
297 extern void gaim_setup(); |
cfa39d39dec6
[gaim-migrate @ 280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
267
diff
changeset
|
298 extern int bud_list_cache_exists(); |
cfa39d39dec6
[gaim-migrate @ 280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
267
diff
changeset
|
299 extern void do_import(GtkWidget *w, void *dummy); |
cfa39d39dec6
[gaim-migrate @ 280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
267
diff
changeset
|
300 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
301 int gaim_handle_redirect(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
302 struct command_rx_struct *command, ...) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
303 va_list ap; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
304 int serviceid; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
305 char *ip; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
306 char *cookie; |
1 | 307 |
277
bba300ed4fab
[gaim-migrate @ 287]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
276
diff
changeset
|
308 char buddies[BUF_LONG]; |
1 | 309 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
310 va_start(ap, command); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
311 serviceid = va_arg(ap, int); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
312 ip = va_arg(ap, char *); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
313 cookie = va_arg(ap, char *); |
1 | 314 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
315 switch(serviceid) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
316 case 0x0005: /* Ads */ |
277
bba300ed4fab
[gaim-migrate @ 287]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
276
diff
changeset
|
317 sprintf(buddies, "%s&", current_user->username); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
318 aim_bos_setbuddylist(sess, command->conn, buddies); |
277
bba300ed4fab
[gaim-migrate @ 287]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
276
diff
changeset
|
319 aim_bos_setprofile(sess, command->conn, current_user->user_info, |
bba300ed4fab
[gaim-migrate @ 287]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
276
diff
changeset
|
320 NULL, gaim_caps); |
276
9e6fc62490cd
[gaim-migrate @ 286]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
274
diff
changeset
|
321 |
9e6fc62490cd
[gaim-migrate @ 286]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
274
diff
changeset
|
322 aim_seticbmparam(sess, command->conn); |
1 | 323 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
324 aim_bos_clientready(sess, command->conn); |
1 | 325 |
270
cfa39d39dec6
[gaim-migrate @ 280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
267
diff
changeset
|
326 aim_bos_reqservice(sess, command->conn, AIM_CONN_TYPE_CHATNAV); |
cfa39d39dec6
[gaim-migrate @ 280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
267
diff
changeset
|
327 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
328 debug_print("Roger that, all systems go\n"); |
1 | 329 #ifdef USE_APPLET |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
330 make_buddy(); |
74 | 331 if (general_options & OPT_GEN_APP_BUDDY_SHOW) { |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
332 gnome_buddy_show(); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
333 createOnlinePopup(); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
334 set_applet_draw_open(); |
1 | 335 } else { |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
336 gnome_buddy_hide(); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
337 set_applet_draw_closed(); |
1 | 338 } |
339 setUserState(online); | |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
340 gtk_widget_hide(mainwindow); |
1 | 341 #else |
342 gtk_widget_hide(mainwindow); | |
343 show_buddy_list(); | |
344 refresh_buddy_window(); | |
345 #endif | |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
346 serv_finish_login(); |
265
59f1748b09a6
[gaim-migrate @ 275]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
259
diff
changeset
|
347 gaim_setup(); |
242
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 |
276
9e6fc62490cd
[gaim-migrate @ 286]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
274
diff
changeset
|
351 aim_conn_setlatency(command->conn, 1); |
9e6fc62490cd
[gaim-migrate @ 286]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
274
diff
changeset
|
352 |
1 | 353 break; |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
354 case 0x7: /* Authorizer */ |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
355 { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
356 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
|
357 if (tstconn == NULL || tstconn->status >= AIM_CONN_STATUS_RESOLVERR) |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
358 debug_print("unable to reconnect with authorizer\n"); |
1 | 359 else |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
360 aim_auth_sendcookie(sess, tstconn, cookie); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
361 } |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
362 break; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
363 case 0xd: /* ChatNav */ |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
364 { |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
365 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
|
366 if (tstconn == NULL || tstconn->status >= AIM_CONN_STATUS_RESOLVERR) { |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
367 debug_print("unable to connect to chatnav server\n"); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
368 return 1; |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
369 } |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
370 aim_conn_addhandler(sess, tstconn, 0x0001, 0x0003, gaim_server_ready, 0); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
371 aim_auth_sendcookie(sess, tstconn, cookie); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
372 } |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
373 debug_print("chatnav: connected\n"); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
374 break; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
375 case 0xe: /* Chat */ |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
376 { |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
377 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
|
378 char *roomname = va_arg(ap, char *); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
379 if (tstconn == NULL || tstconn->status >= AIM_CONN_STATUS_RESOLVERR) { |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
380 debug_print("unable to connect to chat server\n"); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
381 return 1; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
382 } |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
383 aim_chat_attachname(tstconn, roomname); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
384 aim_conn_addhandler(sess, tstconn, 0x0001, 0x0003, gaim_server_ready, 0); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
385 aim_auth_sendcookie(sess, tstconn, cookie); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
386 } |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
387 break; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
388 default: /* huh? */ |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
389 sprintf(debug_buff, "got redirect for unknown service 0x%04x\n", |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
390 serviceid); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
391 debug_print(debug_buff); |
1 | 392 break; |
393 } | |
237
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 va_end(ap); |
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 return 1; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
398 } |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
399 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
400 int gaim_parse_oncoming(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
401 struct command_rx_struct *command, ...) { |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
402 struct aim_userinfo_s *info; |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
403 time_t time_idle; |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
404 int type = 0; |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
405 |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
406 va_list ap; |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
407 va_start(ap, command); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
408 info = va_arg(ap, struct aim_userinfo_s *); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
409 va_end(ap); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
410 |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
411 if (info->class & AIM_CLASS_TRIAL) |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
412 type |= UC_UNCONFIRMED; |
253
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
252
diff
changeset
|
413 else if (info->class & AIM_CLASS_AOL) |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
414 type |= UC_AOL; |
253
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
252
diff
changeset
|
415 else if (info->class & AIM_CLASS_FREE) |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
416 type |= UC_NORMAL; |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
417 if (info->class & AIM_CLASS_AWAY) |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
418 type |= UC_UNAVAILABLE; |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
419 |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
420 if (info->idletime) { |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
421 time(&time_idle); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
422 time_idle -= info->idletime*60; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
423 } else |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
424 time_idle = 0; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
425 |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
426 serv_got_update(info->sn, 1, info->warnlevel, info->onlinesince, |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
427 time_idle, type); |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
428 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
429 return 1; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
430 } |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
431 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
432 int gaim_parse_offgoing(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
433 struct command_rx_struct *command, ...) { |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
434 char *sn; |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
435 va_list ap; |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
436 |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
437 va_start(ap, command); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
438 sn = va_arg(ap, char *); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
439 va_end(ap); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
440 |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
441 serv_got_update(sn, 0, 0, 0, 0, 0); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
442 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
443 return 1; |
1 | 444 } |
445 | |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
446 int gaim_parse_incoming_im(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
447 struct command_rx_struct *command, ...) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
448 int channel; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
449 va_list ap; |
1 | 450 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
451 va_start(ap, command); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
452 channel = va_arg(ap, int); |
1 | 453 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
454 /* channel 1: standard message */ |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
455 if (channel == 1) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
456 struct aim_userinfo_s *userinfo; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
457 char *msg = NULL; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
458 u_int icbmflags = 0; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
459 u_short flag1, flag2; |
1 | 460 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
461 userinfo = va_arg(ap, struct aim_userinfo_s *); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
462 msg = va_arg(ap, char *); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
463 icbmflags = va_arg(ap, u_int); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
464 flag1 = va_arg(ap, u_short); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
465 flag2 = va_arg(ap, u_short); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
466 va_end(ap); |
1 | 467 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
468 serv_got_im(userinfo->sn, msg, icbmflags & AIM_IMFLAGS_AWAY); |
252
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
469 } else if (channel == 2) { |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
470 struct aim_userinfo_s *userinfo; |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
471 int rendtype = va_arg(ap, int); |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
472 if (rendtype == 0) { |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
473 char *msg, *encoding, *lang; |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
474 struct aim_chat_roominfo *roominfo; |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
475 |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
476 userinfo = va_arg(ap, struct aim_userinfo_s *); |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
477 roominfo = va_arg(ap, struct aim_chat_roominfo *); |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
478 msg = va_arg(ap, char *); |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
479 encoding = va_arg(ap, char *); |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
480 lang = va_arg(ap, char *); |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
481 va_end(ap); |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
482 |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
483 serv_got_chat_invite(roominfo->name, |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
484 roominfo->instance, |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
485 userinfo->sn, |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
486 msg); |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
487 } else if (rendtype == 1) { |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
488 /* FIXME : voice chat */ |
283
0f14e6d8a51b
[gaim-migrate @ 293]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
282
diff
changeset
|
489 } else { |
0f14e6d8a51b
[gaim-migrate @ 293]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
282
diff
changeset
|
490 sprintf(debug_buff, "Unknown rendtype %d\n", rendtype); |
0f14e6d8a51b
[gaim-migrate @ 293]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
282
diff
changeset
|
491 debug_print(debug_buff); |
252
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
492 } |
253
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
252
diff
changeset
|
493 /* libfaim doesn't do file transfer yet, from what i can tell */ |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
494 } |
1 | 495 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
496 return 1; |
1 | 497 } |
498 | |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
499 int gaim_parse_misses(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
500 struct command_rx_struct *command, ...) { |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
501 u_short family; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
502 u_short subtype; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
503 |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
504 char buf[2048], buf2[256]; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
505 sprintf(buf2, "Gaim - Error"); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
506 buf[0] = 0; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
507 |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
508 family = aimutil_get16(command->data+0); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
509 subtype = aimutil_get16(command->data+2); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
510 |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
511 switch (family) { |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
512 /* case 0x0001: |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
513 if (subtype == 0x000a) |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
514 sprintf(buf, "You are sending messages too fast."); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
515 break; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
516 */ case 0x0002: |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
517 if (subtype == 0x0001) |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
518 sprintf(buf, "Unknown SNAC error (I'm hungry)"); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
519 break; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
520 case 0x0004: |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
521 if (subtype == 0x0001) |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
522 sprintf(buf, "User is not online."); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
523 else if (subtype == 0x000a) |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
524 sprintf(buf, "A message has been dropped."); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
525 break; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
526 } |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
527 |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
528 if (buf[0] != 0) |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
529 do_error_dialog(buf, buf2); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
530 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
531 return 1; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
532 } |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
533 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
534 int gaim_parse_user_info(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
535 struct command_rx_struct *command, ...) { |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
536 struct aim_userinfo_s *info; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
537 char *prof_enc = NULL, *prof = NULL; |
249
810c595258c8
[gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
248
diff
changeset
|
538 u_short infotype; |
247
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
539 char buf[BUF_LONG]; |
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
540 va_list ap; |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
541 |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
542 va_start(ap, command); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
543 info = va_arg(ap, struct aim_userinfo_s *); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
544 prof_enc = va_arg(ap, char *); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
545 prof = va_arg(ap, char *); |
249
810c595258c8
[gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
248
diff
changeset
|
546 infotype = va_arg(ap, u_short); |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
547 va_end(ap); |
247
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
548 |
249
810c595258c8
[gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
248
diff
changeset
|
549 if (prof == NULL || !strlen(prof)) { |
252
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
550 do_error_dialog("User has no info/away message.", |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
551 "Gaim - User Info"); |
249
810c595258c8
[gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
248
diff
changeset
|
552 return 1; |
810c595258c8
[gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
248
diff
changeset
|
553 } |
810c595258c8
[gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
248
diff
changeset
|
554 |
247
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
555 snprintf(buf, sizeof buf, "Username : <B>%s</B>\n<BR>" |
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
556 "Warning Level : <B>%d %%</B>\n<BR>" |
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
557 "Online Since : <B>%s</B><BR>" |
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
558 "Idle Minutes : <B>%d</B>\n<BR><HR><BR>" |
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
559 "%s\n", |
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
560 info->sn, |
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
561 info->warnlevel, |
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
562 asctime(localtime(&info->onlinesince)), |
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
563 info->idletime, |
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
564 prof); |
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
565 g_show_info_text(buf); |
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
566 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
567 return 1; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
568 } |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
569 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
570 int gaim_parse_motd(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
571 struct command_rx_struct *command, ...) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
572 char *msg; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
573 u_short id; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
574 va_list ap; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
575 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
576 va_start(ap, command); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
577 id = va_arg(ap, u_short); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
578 msg = va_arg(ap, char *); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
579 va_end(ap); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
580 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
581 sprintf(debug_buff, "MOTD: %s\n", msg); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
582 debug_print(debug_buff); |
282
918db59d3814
[gaim-migrate @ 292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
279
diff
changeset
|
583 sprintf(debug_buff, "Gaim %s / Libfaim %s\n", |
918db59d3814
[gaim-migrate @ 292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
279
diff
changeset
|
584 VERSION, aim_getbuildstring()); |
918db59d3814
[gaim-migrate @ 292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
279
diff
changeset
|
585 debug_print(debug_buff); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
586 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
587 return 1; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
588 } |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
589 |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
590 int gaim_chatnav_info(struct aim_session_t *sess, |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
591 struct command_rx_struct *command, ...) { |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
592 /* FIXME */ |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
593 debug_print("inside chatnav_info\n"); |
276
9e6fc62490cd
[gaim-migrate @ 286]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
274
diff
changeset
|
594 aim_conn_close(command->conn); |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
595 return 1; |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
596 } |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
597 |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
598 int gaim_chat_join(struct aim_session_t *sess, |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
599 struct command_rx_struct *command, ...) { |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
600 va_list ap; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
601 int count, i = 0; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
602 struct aim_userinfo_s *info; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
603 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
604 GList *bcs = buddy_chats; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
605 struct buddy_chat *b = NULL; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
606 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
607 va_start(ap, command); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
608 count = va_arg(ap, int); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
609 info = va_arg(ap, struct aim_userinfo_s *); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
610 va_end(ap); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
611 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
612 while(bcs) { |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
613 b = (struct buddy_chat *)bcs->data; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
614 if (!strcasecmp(b->name, (char *)command->conn->priv)) |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
615 break; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
616 bcs = bcs->next; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
617 b = NULL; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
618 } |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
619 if (!b) |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
620 return 1; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
621 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
622 while (i < count) |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
623 add_chat_buddy(b, info[i++].sn); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
624 |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
625 return 1; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
626 } |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
627 |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
628 int gaim_chat_leave(struct aim_session_t *sess, |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
629 struct command_rx_struct *command, ...) { |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
630 va_list ap; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
631 int count, i = 0; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
632 struct aim_userinfo_s *info; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
633 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
634 GList *bcs = buddy_chats; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
635 struct buddy_chat *b = NULL; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
636 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
637 va_start(ap, command); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
638 count = va_arg(ap, int); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
639 info = va_arg(ap, struct aim_userinfo_s *); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
640 va_end(ap); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
641 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
642 while(bcs) { |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
643 b = (struct buddy_chat *)bcs->data; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
644 if (!strcasecmp(b->name, (char *)command->conn->priv)) |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
645 break; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
646 bcs = bcs->next; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
647 b = NULL; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
648 } |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
649 if (!b) |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
650 return 1; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
651 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
652 while (i < count) |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
653 remove_chat_buddy(b, info[i++].sn); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
654 |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
655 return 1; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
656 } |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
657 |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
658 int gaim_chat_info_update(struct aim_session_t *sess, |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
659 struct command_rx_struct *command, ...) { |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
660 /* FIXME */ |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
661 debug_print("inside chat_info_update\n"); |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
662 return 1; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
663 } |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
664 |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
665 int gaim_chat_incoming_msg(struct aim_session_t *sess, |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
666 struct command_rx_struct *command, ...) { |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
667 va_list ap; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
668 struct aim_userinfo_s *info; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
669 char *msg; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
670 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
671 GList *bcs = buddy_chats; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
672 struct buddy_chat *b = NULL; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
673 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
674 va_start(ap, command); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
675 info = va_arg(ap, struct aim_userinfo_s *); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
676 msg = va_arg(ap, char *); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
677 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
678 while(bcs) { |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
679 b = (struct buddy_chat *)bcs->data; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
680 if (!strcasecmp(b->name, (char *)command->conn->priv)) |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
681 break; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
682 bcs = bcs->next; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
683 b = NULL; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
684 } |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
685 if (!b) |
270
cfa39d39dec6
[gaim-migrate @ 280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
267
diff
changeset
|
686 return 0; |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
687 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
688 serv_got_chat_in(b->id, info->sn, 0, msg); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
689 |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
690 return 1; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
691 } |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
692 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
693 #endif /* USE_OSCAR */ |