Mercurial > pidgin
annotate src/oscar.c @ 540:f586c3819574
[gaim-migrate @ 550]
smileys don't get overwritten
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Thu, 27 Jul 2000 19:33:18 +0000 |
parents | f03f041c1aa9 |
children | 7c75d69a1129 |
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 | |
349
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
23 #ifdef HAVE_CONFIG_H |
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
24 #include "../config.h" |
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
25 #endif |
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
26 |
1 | 27 |
28 #include <netdb.h> | |
29 #include <gtk/gtk.h> | |
30 #include <unistd.h> | |
31 #include <errno.h> | |
32 #include <netinet/in.h> | |
33 #include <arpa/inet.h> | |
34 #include <string.h> | |
35 #include <stdlib.h> | |
36 #include <stdio.h> | |
37 #include <time.h> | |
38 #include <sys/socket.h> | |
39 #include <sys/stat.h> | |
40 #include "gaim.h" | |
338
9d258a0aa560
[gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
335
diff
changeset
|
41 #include <aim.h> |
1 | 42 #include "gnome_applet_mgr.h" |
43 | |
526
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
44 #include "pixmaps/cancel.xpm" |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
45 #include "pixmaps/ok.xpm" |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
46 |
1 | 47 static int inpa = -1; |
331
f3c8d79688db
[gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
319
diff
changeset
|
48 static int paspa = -1; |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
49 static int cnpa = -1; |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
50 struct aim_session_t *gaim_sess; |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
51 struct aim_conn_t *gaim_conn; |
369
cf895313fc50
[gaim-migrate @ 379]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
52 int gaim_caps = AIM_CAPS_CHAT | AIM_CAPS_SENDFILE | AIM_CAPS_GETFILE | |
cf895313fc50
[gaim-migrate @ 379]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
53 AIM_CAPS_VOICE | AIM_CAPS_IMIMAGE | AIM_CAPS_BUDDYICON; |
423
0d4e80bdb96b
[gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
412
diff
changeset
|
54 int USE_OSCAR = 0; |
1 | 55 |
312
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
56 GList *oscar_chats = NULL; |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
57 |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
58 struct chat_connection *find_oscar_chat(char *name) { |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
59 GList *g = oscar_chats; |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
60 struct chat_connection *c = NULL; |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
61 |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
62 while (g) { |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
63 c = (struct chat_connection *)g->data; |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
64 if (!strcmp(name, c->name)) |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
65 break; |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
66 g = g->next; |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
67 c = NULL; |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
68 } |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
69 |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
70 return c; |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
71 } |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
72 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
73 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
|
74 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
|
75 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
|
76 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
|
77 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
|
78 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
|
79 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
|
80 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
|
81 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
|
82 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
|
83 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
|
84 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
|
85 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
|
86 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
|
87 static int gaim_chat_incoming_msg(struct aim_session_t *, struct command_rx_struct *, ...); |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
88 static int gaim_parse_msgack (struct aim_session_t *, struct command_rx_struct *, ...); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
89 static int gaim_parse_ratechange (struct aim_session_t *, struct command_rx_struct *, ...); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
90 |
515
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
91 static int gaim_directim_incoming(struct aim_session_t *, struct command_rx_struct *, ...); |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
92 static int gaim_directim_typing (struct aim_session_t *, struct command_rx_struct *, ...); |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
93 static int gaim_directim_initiate(struct aim_session_t *, struct command_rx_struct *, ...); |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
94 |
338
9d258a0aa560
[gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
335
diff
changeset
|
95 extern void auth_failed(); |
9d258a0aa560
[gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
335
diff
changeset
|
96 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
97 static void oscar_callback(gpointer data, gint source, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
98 GdkInputCondition condition) { |
288
6e609d42f767
[gaim-migrate @ 298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
99 struct aim_conn_t *conn = (struct aim_conn_t *)data; |
1 | 100 |
259
e159ba2486fc
[gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
101 if (condition & GDK_INPUT_EXCEPTION) { |
e159ba2486fc
[gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
102 signoff(); |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
103 hide_login_progress(_("Disconnected.")); |
288
6e609d42f767
[gaim-migrate @ 298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
104 aim_logoff(gaim_sess); |
259
e159ba2486fc
[gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
105 gdk_input_remove(inpa); |
338
9d258a0aa560
[gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
335
diff
changeset
|
106 auth_failed(); |
259
e159ba2486fc
[gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
107 return; |
e159ba2486fc
[gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
108 } |
e159ba2486fc
[gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
109 if (condition & GDK_INPUT_READ) { |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
110 if (conn->type == AIM_CONN_TYPE_RENDEZVOUS_OUT) { |
515
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
111 debug_print("got information on rendezvous\n"); |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
112 if (aim_handlerendconnect(gaim_sess, conn) < 0) { |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
113 debug_print(_("connection error (rend)\n")); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
114 } |
259
e159ba2486fc
[gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
115 } else { |
515
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
116 char *direct = NULL; |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
117 if (conn->type == AIM_CONN_TYPE_RENDEZVOUS && |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
118 conn->subtype == AIM_CONN_SUBTYPE_OFT_DIRECTIM) |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
119 direct = g_strdup(((struct aim_directim_priv *)conn->priv)->sn); |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
120 if (aim_get_command(gaim_sess, conn) >= 0) { |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
121 aim_rxdispatch(gaim_sess); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
122 } else { |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
123 debug_print(_("connection error!\n")); |
515
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
124 if (direct) { |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
125 struct conversation *cnv = find_conversation(direct); |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
126 debug_print("connection error for directim\n"); |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
127 if (cnv) { |
516
ee4e18868584
[gaim-migrate @ 526]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
515
diff
changeset
|
128 make_direct(cnv, FALSE, NULL, 0); |
515
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
129 } |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
130 } |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
131 aim_conn_kill(gaim_sess, &conn); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
132 if (!aim_getconn_type(gaim_sess, AIM_CONN_TYPE_BOS)) { |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
133 debug_print(_("major connection error\n")); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
134 signoff(); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
135 hide_login_progress(_("Disconnected.")); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
136 aim_logoff(gaim_sess); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
137 auth_failed(); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
138 gdk_input_remove(inpa); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
139 } |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
140 } |
515
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
141 if (direct) g_free(direct); |
259
e159ba2486fc
[gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
142 } |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
143 } |
1 | 144 } |
145 | |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
146 int oscar_login(char *username, char *password) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
147 struct aim_session_t *sess; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
148 struct aim_conn_t *conn; |
481
64afc8f41bcb
[gaim-migrate @ 491]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
472
diff
changeset
|
149 struct client_info_s info = {"AOL Instant Messenger (TM), version 2.1.1187/WIN32", 4, 30, 3141, "us", "en", 0x0004, 0x0001, 0x055}; |
253
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
252
diff
changeset
|
150 struct aim_user *u; |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
151 char buf[256]; |
1 | 152 |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
153 sprintf(debug_buff, _("Logging in %s\n"), username); |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
154 debug_print(debug_buff); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
155 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
156 sess = g_new0(struct aim_session_t, 1); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
157 aim_session_init(sess); |
279
501e09c51cbc
[gaim-migrate @ 289]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
277
diff
changeset
|
158 /* 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
|
159 * see if things need to be sent. */ |
501e09c51cbc
[gaim-migrate @ 289]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
277
diff
changeset
|
160 sess->tx_enqueue = &aim_tx_enqueue__immediate; |
501e09c51cbc
[gaim-migrate @ 289]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
277
diff
changeset
|
161 gaim_sess = sess; |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
162 |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
163 sprintf(buf, _("Looking up %s"), FAIM_LOGIN_SERVER); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
164 set_login_progress(1, buf); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
165 conn = aim_newconn(sess, AIM_CONN_TYPE_AUTH, FAIM_LOGIN_SERVER); |
1 | 166 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
167 if (conn == NULL) { |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
168 debug_print(_("internal connection error\n")); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
169 #ifdef USE_APPLET |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
170 setUserState(offline); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
171 #endif |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
172 set_state(STATE_OFFLINE); |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
173 hide_login_progress(_("Unable to login to AIM")); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
174 return -1; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
175 } else if (conn->fd == -1) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
176 #ifdef USE_APPLET |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
177 setUserState(offline); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
178 #endif |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
179 set_state(STATE_OFFLINE); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
180 if (conn->status & AIM_CONN_STATUS_RESOLVERR) { |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
181 sprintf(debug_buff, _("couldn't resolve host\n")); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
182 debug_print(debug_buff); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
183 hide_login_progress(debug_buff); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
184 } else if (conn->status & AIM_CONN_STATUS_CONNERR) { |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
185 sprintf(debug_buff, _("couldn't connect to host\n")); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
186 debug_print(debug_buff); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
187 hide_login_progress(debug_buff); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
188 } |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
189 return -1; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
190 } |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
191 g_snprintf(buf, sizeof(buf), _("Signon: %s"), username); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
192 set_login_progress(2, buf); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
193 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
194 aim_conn_addhandler(sess, conn, AIM_CB_FAM_SPECIAL, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
195 AIM_CB_SPECIAL_AUTHSUCCESS, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
196 gaim_parse_auth_resp, 0); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
197 aim_conn_addhandler(sess, conn, AIM_CB_FAM_GEN, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
198 AIM_CB_GEN_SERVERREADY, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
199 gaim_auth_server_ready, 0); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
200 aim_send_login(sess, conn, username, password, &info); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
201 |
270
cfa39d39dec6
[gaim-migrate @ 280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
267
diff
changeset
|
202 inpa = gdk_input_add(conn->fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION, |
288
6e609d42f767
[gaim-migrate @ 298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
203 oscar_callback, conn); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
204 |
253
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
252
diff
changeset
|
205 u = find_user(username); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
252
diff
changeset
|
206 |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
252
diff
changeset
|
207 if (!u) { |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
252
diff
changeset
|
208 u = g_new0(struct aim_user, 1); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
252
diff
changeset
|
209 g_snprintf(u->username, sizeof(u->username), DEFAULT_INFO); |
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
252
diff
changeset
|
210 aim_users = g_list_append(aim_users, u); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
211 } |
253
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
252
diff
changeset
|
212 current_user = u; |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
213 g_snprintf(current_user->username, sizeof(current_user->username), |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
214 "%s", username); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
215 g_snprintf(current_user->password, sizeof(current_user->password), |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
216 "%s", password); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
217 save_prefs(); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
218 |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
219 debug_print(_("Password sent, waiting for response\n")); |
1 | 220 |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
221 return 0; |
1 | 222 } |
223 | |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
224 void oscar_close() { |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
225 #ifdef USE_APPLET |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
226 setUserState(offline); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
227 #endif |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
228 set_state(STATE_OFFLINE); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
229 if (inpa > 0) |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
230 gdk_input_remove(inpa); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
231 inpa = -1; |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
232 aim_logoff(gaim_sess); |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
233 debug_print(_("Signed off.\n")); |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
234 } |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
235 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
236 int gaim_parse_auth_resp(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
237 struct command_rx_struct *command, ...) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
238 struct aim_conn_t *bosconn = NULL; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
239 sprintf(debug_buff, "inside auth_resp (Screen name: %s)\n", |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
240 sess->logininfo.screen_name); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
241 debug_print(debug_buff); |
1 | 242 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
243 if (sess->logininfo.errorcode) { |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
244 switch (sess->logininfo.errorcode) { |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
245 case 0x18: |
392
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
388
diff
changeset
|
246 /* connecting too frequently */ |
401
7c74e2f579b5
[gaim-migrate @ 411]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
392
diff
changeset
|
247 show_error_dialog("983\0\0"); |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
248 break; |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
249 case 0x05: |
392
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
388
diff
changeset
|
250 /* Incorrect nick/password */ |
401
7c74e2f579b5
[gaim-migrate @ 411]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
392
diff
changeset
|
251 show_error_dialog("980\0\0"); |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
252 break; |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
253 case 0x1c: |
392
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
388
diff
changeset
|
254 /* client too old */ |
401
7c74e2f579b5
[gaim-migrate @ 411]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
392
diff
changeset
|
255 show_error_dialog("981\0\0"); |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
256 break; |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
257 } |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
258 sprintf(debug_buff, "Login Error Code 0x%04x\n", |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
259 sess->logininfo.errorcode); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
260 debug_print(debug_buff); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
261 sprintf(debug_buff, "Error URL: %s\n", |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
262 sess->logininfo.errorurl); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
263 debug_print(debug_buff); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
264 #ifdef USE_APPLET |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
265 setUserState(offline); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
266 #endif |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
267 set_state(STATE_OFFLINE); |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
268 hide_login_progress(_("Authentication Failed")); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
269 gdk_input_remove(inpa); |
338
9d258a0aa560
[gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
335
diff
changeset
|
270 aim_conn_kill(sess, &command->conn); |
270
cfa39d39dec6
[gaim-migrate @ 280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
267
diff
changeset
|
271 auth_failed(); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
272 return 0; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
273 } |
1 | 274 |
275 | |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
276 sprintf(debug_buff, "Email: %s\n", sess->logininfo.email); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
277 debug_print(debug_buff); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
278 sprintf(debug_buff, "Closing auth connection...\n"); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
279 debug_print(debug_buff); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
280 gdk_input_remove(inpa); |
338
9d258a0aa560
[gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
335
diff
changeset
|
281 aim_conn_kill(sess, &command->conn); |
1 | 282 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
283 bosconn = aim_newconn(sess, AIM_CONN_TYPE_BOS, sess->logininfo.BOSIP); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
284 if (bosconn == NULL) { |
1 | 285 #ifdef USE_APPLET |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
286 setUserState(offline); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
287 #endif |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
288 set_state(STATE_OFFLINE); |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
289 hide_login_progress(_("Internal Error")); |
338
9d258a0aa560
[gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
335
diff
changeset
|
290 auth_failed(); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
291 return -1; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
292 } else if (bosconn->status != 0) { |
1 | 293 #ifdef USE_APPLET |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
294 setUserState(offline); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
295 #endif |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
296 set_state(STATE_OFFLINE); |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
297 hide_login_progress(_("Could Not Connect")); |
338
9d258a0aa560
[gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
335
diff
changeset
|
298 auth_failed(); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
299 return -1; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
300 } |
1 | 301 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
302 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
|
303 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
|
304 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
|
305 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
|
306 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
|
307 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
|
308 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
|
309 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
|
310 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
|
311 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_MSG, AIM_CB_MSG_MISSEDCALL, gaim_parse_misses, 0); |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
312 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_GEN, AIM_CB_GEN_RATECHANGE, gaim_parse_ratechange, 0); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
313 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
|
314 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_LOC, AIM_CB_LOC_USERINFO, gaim_parse_user_info, 0); |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
315 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_MSG, AIM_CB_MSG_ACK, gaim_parse_msgack, 0); |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
316 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
|
317 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
|
318 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
|
319 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
320 aim_auth_sendcookie(sess, bosconn, sess->logininfo.cookie); |
288
6e609d42f767
[gaim-migrate @ 298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
321 gaim_conn = bosconn; |
270
cfa39d39dec6
[gaim-migrate @ 280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
267
diff
changeset
|
322 inpa = gdk_input_add(bosconn->fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION, |
288
6e609d42f767
[gaim-migrate @ 298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
323 oscar_callback, bosconn); |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
324 set_login_progress(4, _("Connection established, cookie sent")); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
325 return 1; |
1 | 326 } |
327 | |
331
f3c8d79688db
[gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
319
diff
changeset
|
328 gboolean change_password = FALSE; |
f3c8d79688db
[gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
319
diff
changeset
|
329 char *old_password; |
f3c8d79688db
[gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
319
diff
changeset
|
330 char *new_password; |
f3c8d79688db
[gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
319
diff
changeset
|
331 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
332 int gaim_auth_server_ready(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
333 struct command_rx_struct *command, ...) { |
331
f3c8d79688db
[gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
319
diff
changeset
|
334 debug_print("Authorization server is ready.\n"); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
335 aim_auth_clientready(sess, command->conn); |
331
f3c8d79688db
[gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
319
diff
changeset
|
336 if (change_password) { |
f3c8d79688db
[gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
319
diff
changeset
|
337 debug_print("Changing passwords...\n"); |
f3c8d79688db
[gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
319
diff
changeset
|
338 aim_auth_changepasswd(sess, command->conn, old_password, |
f3c8d79688db
[gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
319
diff
changeset
|
339 new_password); |
f3c8d79688db
[gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
319
diff
changeset
|
340 g_free(old_password); |
f3c8d79688db
[gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
319
diff
changeset
|
341 g_free(new_password); |
f3c8d79688db
[gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
319
diff
changeset
|
342 change_password = FALSE; |
f3c8d79688db
[gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
319
diff
changeset
|
343 } |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
344 return 1; |
1 | 345 } |
346 | |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
347 int gaim_server_ready(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
348 struct command_rx_struct *command, ...) { |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
349 static int id = 1; |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
350 switch (command->conn->type) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
351 case AIM_CONN_TYPE_BOS: |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
352 aim_bos_reqrate(sess, command->conn); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
353 aim_bos_ackrateresp(sess, command->conn); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
354 aim_bos_setprivacyflags(sess, command->conn, 0x00000003); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
355 aim_bos_reqservice(sess, command->conn, AIM_CONN_TYPE_ADS); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
356 aim_bos_setgroupperm(sess, command->conn, 0x1f); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
357 debug_print("done with BOS ServerReady\n"); |
1 | 358 break; |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
359 case AIM_CONN_TYPE_CHATNAV: |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
360 debug_print("chatnav: got server ready\n"); |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
361 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
|
362 aim_bos_reqrate(sess, command->conn); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
363 aim_bos_ackrateresp(sess, command->conn); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
364 aim_chatnav_clientready(sess, command->conn); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
365 aim_chatnav_reqrights(sess, command->conn); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
366 break; |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
367 case AIM_CONN_TYPE_CHAT: |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
368 debug_print("chat: got server ready\n"); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
369 aim_conn_addhandler(sess, command->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_USERJOIN, gaim_chat_join, 0); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
370 aim_conn_addhandler(sess, command->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_USERLEAVE, gaim_chat_leave, 0); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
371 aim_conn_addhandler(sess, command->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_ROOMINFOUPDATE, gaim_chat_info_update, 0); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
372 aim_conn_addhandler(sess, command->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_INCOMINGMSG, gaim_chat_incoming_msg, 0); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
373 aim_bos_reqrate(sess, command->conn); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
374 aim_bos_ackrateresp(sess, command->conn); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
375 aim_chat_clientready(sess, command->conn); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
376 serv_got_joined_chat(id++, aim_chat_getname(command->conn)); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
377 break; |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
378 case AIM_CONN_TYPE_RENDEZVOUS: |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
379 aim_conn_addhandler(sess, command->conn, AIM_CB_FAM_OFT, AIM_CB_OFT_DIRECTIMINCOMING, gaim_directim_incoming, 0); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
380 break; |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
381 default: /* huh? */ |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
382 sprintf(debug_buff, "server ready: got unexpected connection type %04x\n", command->conn->type); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
383 debug_print(debug_buff); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
384 break; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
385 } |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
386 return 1; |
1 | 387 } |
388 | |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
389 int gaim_handle_redirect(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
390 struct command_rx_struct *command, ...) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
391 va_list ap; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
392 int serviceid; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
393 char *ip; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
394 char *cookie; |
1 | 395 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
396 va_start(ap, command); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
397 serviceid = va_arg(ap, int); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
398 ip = va_arg(ap, char *); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
399 cookie = va_arg(ap, char *); |
1 | 400 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
401 switch(serviceid) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
402 case 0x0005: /* Ads */ |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
403 debug_print("Received Ads, finishing login\n"); |
319
cea40691706c
[gaim-migrate @ 329]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
312
diff
changeset
|
404 /* we'll take care of this in the parse_toc_buddy_config() below |
277
bba300ed4fab
[gaim-migrate @ 287]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
276
diff
changeset
|
405 sprintf(buddies, "%s&", current_user->username); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
406 aim_bos_setbuddylist(sess, command->conn, buddies); |
319
cea40691706c
[gaim-migrate @ 329]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
312
diff
changeset
|
407 */ |
277
bba300ed4fab
[gaim-migrate @ 287]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
276
diff
changeset
|
408 aim_bos_setprofile(sess, command->conn, current_user->user_info, |
bba300ed4fab
[gaim-migrate @ 287]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
276
diff
changeset
|
409 NULL, gaim_caps); |
276
9e6fc62490cd
[gaim-migrate @ 286]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
274
diff
changeset
|
410 aim_seticbmparam(sess, command->conn); |
288
6e609d42f767
[gaim-migrate @ 298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
411 aim_conn_setlatency(command->conn, 1); |
270
cfa39d39dec6
[gaim-migrate @ 280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
267
diff
changeset
|
412 |
1 | 413 #ifdef USE_APPLET |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
414 make_buddy(); |
74 | 415 if (general_options & OPT_GEN_APP_BUDDY_SHOW) { |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
416 gnome_buddy_show(); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
417 createOnlinePopup(); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
418 set_applet_draw_open(); |
1 | 419 } else { |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
420 gnome_buddy_hide(); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
421 set_applet_draw_closed(); |
1 | 422 } |
423 setUserState(online); | |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
424 gtk_widget_hide(mainwindow); |
1 | 425 #else |
426 gtk_widget_hide(mainwindow); | |
427 show_buddy_list(); | |
428 refresh_buddy_window(); | |
429 #endif | |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
430 serv_finish_login(); |
265
59f1748b09a6
[gaim-migrate @ 275]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
259
diff
changeset
|
431 gaim_setup(); |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
432 if (bud_list_cache_exists()) |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
433 do_import(NULL, 0); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
434 |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
435 aim_bos_clientready(sess, command->conn); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
436 debug_print("Roger that, all systems go\n"); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
437 aim_bos_reqservice(sess, command->conn, AIM_CONN_TYPE_CHATNAV); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
438 |
1 | 439 break; |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
440 case 0x7: /* Authorizer */ |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
441 debug_print("Reconnecting with authorizor...\n"); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
442 { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
443 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
|
444 if (tstconn == NULL || tstconn->status >= AIM_CONN_STATUS_RESOLVERR) |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
445 debug_print("unable to reconnect with authorizer\n"); |
331
f3c8d79688db
[gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
319
diff
changeset
|
446 else { |
f3c8d79688db
[gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
319
diff
changeset
|
447 paspa = gdk_input_add(tstconn->fd, |
f3c8d79688db
[gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
319
diff
changeset
|
448 GDK_INPUT_READ | GDK_INPUT_EXCEPTION, |
f3c8d79688db
[gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
319
diff
changeset
|
449 oscar_callback, tstconn); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
450 aim_auth_sendcookie(sess, tstconn, cookie); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
451 } |
331
f3c8d79688db
[gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
319
diff
changeset
|
452 } |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
453 break; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
454 case 0xd: /* ChatNav */ |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
455 { |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
456 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
|
457 if (tstconn == NULL || tstconn->status >= AIM_CONN_STATUS_RESOLVERR) { |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
458 debug_print("unable to connect to chatnav server\n"); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
459 return 1; |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
460 } |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
461 aim_conn_addhandler(sess, tstconn, 0x0001, 0x0003, gaim_server_ready, 0); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
462 aim_auth_sendcookie(sess, tstconn, cookie); |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
463 cnpa = gdk_input_add(tstconn->fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION, |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
464 oscar_callback, tstconn); |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
465 } |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
466 debug_print("chatnav: connected\n"); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
467 break; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
468 case 0xe: /* Chat */ |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
469 { |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
470 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
|
471 char *roomname = va_arg(ap, char *); |
312
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
472 struct chat_connection *ccon; |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
473 if (tstconn == NULL || tstconn->status >= AIM_CONN_STATUS_RESOLVERR) { |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
474 debug_print("unable to connect to chat server\n"); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
475 return 1; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
476 } |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
477 sprintf(debug_buff, "Connected to chat room %s\n", roomname); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
478 debug_print(debug_buff); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
479 |
312
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
480 ccon = g_new0(struct chat_connection, 1); |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
481 ccon->conn = tstconn; |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
482 ccon->fd = tstconn->fd; |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
483 ccon->name = g_strdup(roomname); |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
484 |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
485 ccon->inpa = gdk_input_add(tstconn->fd, |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
486 GDK_INPUT_READ | GDK_INPUT_EXCEPTION, |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
487 oscar_callback, tstconn); |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
488 |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
489 oscar_chats = g_list_append(oscar_chats, ccon); |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
490 |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
491 aim_chat_attachname(tstconn, roomname); |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
492 aim_conn_addhandler(sess, tstconn, 0x0001, 0x0003, gaim_server_ready, 0); |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
493 aim_auth_sendcookie(sess, tstconn, cookie); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
494 } |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
495 break; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
496 default: /* huh? */ |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
497 sprintf(debug_buff, "got redirect for unknown service 0x%04x\n", |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
498 serviceid); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
499 debug_print(debug_buff); |
1 | 500 break; |
501 } | |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
502 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
503 va_end(ap); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
504 |
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_oncoming(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
509 struct command_rx_struct *command, ...) { |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
510 struct aim_userinfo_s *info; |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
511 time_t time_idle; |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
512 int type = 0; |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
513 |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
514 va_list ap; |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
515 va_start(ap, command); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
516 info = va_arg(ap, struct aim_userinfo_s *); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
517 va_end(ap); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
518 |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
519 if (info->class & AIM_CLASS_TRIAL) |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
520 type |= UC_UNCONFIRMED; |
253
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
252
diff
changeset
|
521 else if (info->class & AIM_CLASS_AOL) |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
522 type |= UC_AOL; |
253
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
252
diff
changeset
|
523 else if (info->class & AIM_CLASS_FREE) |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
524 type |= UC_NORMAL; |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
525 if (info->class & AIM_CLASS_AWAY) |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
526 type |= UC_UNAVAILABLE; |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
527 |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
528 if (info->idletime) { |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
529 time(&time_idle); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
530 time_idle -= info->idletime*60; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
531 } else |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
532 time_idle = 0; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
533 |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
534 serv_got_update(info->sn, 1, info->warnlevel, info->onlinesince, |
513
eaddaa0dbbcb
[gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
512
diff
changeset
|
535 time_idle, type, info->capabilities); |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
536 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
537 return 1; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
538 } |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
539 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
540 int gaim_parse_offgoing(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
541 struct command_rx_struct *command, ...) { |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
542 char *sn; |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
543 va_list ap; |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
544 |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
545 va_start(ap, command); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
546 sn = va_arg(ap, char *); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
547 va_end(ap); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
548 |
513
eaddaa0dbbcb
[gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
512
diff
changeset
|
549 serv_got_update(sn, 0, 0, 0, 0, 0, 0); |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
550 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
551 return 1; |
1 | 552 } |
553 | |
526
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
554 static void accept_directim(GtkWidget *w, GtkWidget *m) |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
555 { |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
556 struct aim_conn_t *newconn; |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
557 struct aim_directim_priv *priv; |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
558 int watcher; |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
559 |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
560 priv = (struct aim_directim_priv *)gtk_object_get_user_data(GTK_OBJECT(m)); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
561 gtk_widget_destroy(m); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
562 |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
563 if (!(newconn = aim_directim_connect(gaim_sess, gaim_conn, priv))) { |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
564 debug_print("imimage: could not connect\n"); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
565 return; |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
566 } |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
567 |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
568 aim_conn_addhandler(gaim_sess, newconn, AIM_CB_FAM_OFT, AIM_CB_OFT_DIRECTIMINCOMING, gaim_directim_incoming, 0); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
569 aim_conn_addhandler(gaim_sess, newconn, AIM_CB_FAM_OFT, AIM_CB_OFT_DIRECTIMTYPING, gaim_directim_typing, 0); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
570 |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
571 watcher = gdk_input_add(newconn->fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION, |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
572 oscar_callback, newconn); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
573 |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
574 sprintf(debug_buff, "DirectIM: connected to %s\n", priv->sn); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
575 debug_print(debug_buff); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
576 |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
577 serv_got_imimage(priv->sn, priv->cookie, priv->ip, newconn, watcher); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
578 |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
579 g_free(priv); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
580 } |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
581 |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
582 static void cancel_directim(GtkWidget *w, GtkWidget *m) |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
583 { |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
584 gtk_widget_destroy(m); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
585 } |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
586 |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
587 static void directim_dialog(struct aim_directim_priv *priv) |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
588 { |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
589 GtkWidget *window; |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
590 GtkWidget *vbox; |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
591 GtkWidget *hbox; |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
592 GtkWidget *label; |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
593 GtkWidget *yes; |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
594 GtkWidget *no; |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
595 GtkWidget *button; |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
596 GdkBitmap *mask; |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
597 GdkPixmap *pm; |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
598 GtkWidget *image; |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
599 char buf[BUF_LONG]; |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
600 |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
601 window = gtk_window_new(GTK_WINDOW_DIALOG); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
602 gtk_window_set_title(GTK_WINDOW(window), _("Accept Direct IM?")); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
603 gtk_widget_realize(window); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
604 aol_icon(window->window); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
605 gtk_object_set_user_data(GTK_OBJECT(window), (void *)priv); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
606 |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
607 vbox = gtk_vbox_new(TRUE, 5); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
608 gtk_container_add(GTK_CONTAINER(window), vbox); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
609 gtk_widget_show(vbox); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
610 |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
611 sprintf(buf, _("%s has requested to directly connect to your computer. " |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
612 "Do you accept?"), priv->sn); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
613 label = gtk_label_new(buf); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
614 gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 5); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
615 gtk_widget_show(label); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
616 |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
617 hbox = gtk_hbox_new(TRUE, 10); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
618 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
619 gtk_widget_show(hbox); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
620 |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
621 yes = gtk_button_new(); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
622 gtk_box_pack_start(GTK_BOX(hbox), yes, FALSE, FALSE, 5); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
623 gtk_widget_show(yes); |
535
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
526
diff
changeset
|
624 if (display_options & OPT_DISP_COOL_LOOK) |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
526
diff
changeset
|
625 gtk_button_set_relief(GTK_BUTTON(yes), GTK_RELIEF_NONE); |
526
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
626 |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
627 button = gtk_hbox_new(FALSE, 5); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
628 gtk_container_add(GTK_CONTAINER(yes), button); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
629 gtk_widget_show(button); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
630 |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
631 pm = gdk_pixmap_create_from_xpm_d(window->window, &mask, NULL, ok_xpm); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
632 image = gtk_pixmap_new(pm, mask); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
633 gtk_box_pack_start(GTK_BOX(button), image, FALSE, FALSE, 2); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
634 gtk_widget_show(image); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
635 |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
636 label = gtk_label_new(_("Accept")); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
637 gtk_box_pack_end(GTK_BOX(button), label, FALSE, FALSE, 2); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
638 gtk_widget_show(label); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
639 |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
640 no = gtk_button_new(); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
641 gtk_box_pack_end(GTK_BOX(hbox), no, FALSE, FALSE, 5); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
642 gtk_widget_show(no); |
535
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
526
diff
changeset
|
643 if (display_options & OPT_DISP_COOL_LOOK) |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
526
diff
changeset
|
644 gtk_button_set_relief(GTK_BUTTON(no), GTK_RELIEF_NONE); |
526
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
645 |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
646 button = gtk_hbox_new(FALSE, 5); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
647 gtk_container_add(GTK_CONTAINER(no), button); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
648 gtk_widget_show(button); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
649 |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
650 pm = gdk_pixmap_create_from_xpm_d(window->window, &mask, NULL, cancel_xpm); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
651 image = gtk_pixmap_new(pm, mask); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
652 gtk_box_pack_start(GTK_BOX(button), image, FALSE, FALSE, 2); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
653 gtk_widget_show(image); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
654 |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
655 label = gtk_label_new(_("Cancel")); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
656 gtk_box_pack_end(GTK_BOX(button), label, FALSE, FALSE, 2); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
657 gtk_widget_show(label); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
658 |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
659 gtk_signal_connect(GTK_OBJECT(yes), "clicked", |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
660 GTK_SIGNAL_FUNC(accept_directim), window); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
661 gtk_signal_connect(GTK_OBJECT(no), "clicked", |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
662 GTK_SIGNAL_FUNC(cancel_directim), window); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
663 |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
664 gtk_widget_show(window); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
665 } |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
666 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
667 int gaim_parse_incoming_im(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
668 struct command_rx_struct *command, ...) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
669 int channel; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
670 va_list ap; |
1 | 671 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
672 va_start(ap, command); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
673 channel = va_arg(ap, int); |
1 | 674 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
675 /* channel 1: standard message */ |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
676 if (channel == 1) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
677 struct aim_userinfo_s *userinfo; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
678 char *msg = NULL; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
679 u_int icbmflags = 0; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
680 u_short flag1, flag2; |
1 | 681 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
682 userinfo = va_arg(ap, struct aim_userinfo_s *); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
683 msg = va_arg(ap, char *); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
684 icbmflags = va_arg(ap, u_int); |
464 | 685 flag1 = (u_short)va_arg(ap, u_int); |
686 flag2 = (u_short)va_arg(ap, u_int); | |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
687 va_end(ap); |
1 | 688 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
689 serv_got_im(userinfo->sn, msg, icbmflags & AIM_IMFLAGS_AWAY); |
252
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
690 } else if (channel == 2) { |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
691 struct aim_userinfo_s *userinfo; |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
692 int rendtype = va_arg(ap, int); |
445
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
423
diff
changeset
|
693 if (rendtype & AIM_CAPS_CHAT) { |
252
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
694 char *msg, *encoding, *lang; |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
695 struct aim_chat_roominfo *roominfo; |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
696 |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
697 userinfo = va_arg(ap, struct aim_userinfo_s *); |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
698 roominfo = va_arg(ap, struct aim_chat_roominfo *); |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
699 msg = va_arg(ap, char *); |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
700 encoding = va_arg(ap, char *); |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
701 lang = va_arg(ap, char *); |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
702 va_end(ap); |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
703 |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
704 serv_got_chat_invite(roominfo->name, |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
705 roominfo->instance, |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
706 userinfo->sn, |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
707 msg); |
445
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
423
diff
changeset
|
708 } else if (rendtype & AIM_CAPS_SENDFILE) { |
338
9d258a0aa560
[gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
335
diff
changeset
|
709 /* libfaim won't tell us that we got this just yet */ |
445
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
423
diff
changeset
|
710 } else if (rendtype & AIM_CAPS_GETFILE) { |
338
9d258a0aa560
[gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
335
diff
changeset
|
711 /* nor will it tell us this. but it's still there */ |
445
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
423
diff
changeset
|
712 } else if (rendtype & AIM_CAPS_VOICE) { |
369
cf895313fc50
[gaim-migrate @ 379]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
713 /* this one libfaim tells us unuseful info about */ |
445
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
423
diff
changeset
|
714 } else if (rendtype & AIM_CAPS_BUDDYICON) { |
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
423
diff
changeset
|
715 /* bah */ |
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
423
diff
changeset
|
716 } else if (rendtype & AIM_CAPS_IMIMAGE) { |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
717 /* DirectIM stuff */ |
526
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
718 struct aim_directim_priv *priv, *priv2; |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
719 struct aim_conn_t *newconn; |
515
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
720 int watcher; |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
721 |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
722 userinfo = va_arg(ap, struct aim_userinfo_s *); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
723 priv = va_arg(ap, struct aim_directim_priv *); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
724 va_end(ap); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
725 |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
726 sprintf(debug_buff, "DirectIM request from %s (%s)\n", userinfo->sn, priv->ip); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
727 debug_print(debug_buff); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
728 |
526
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
729 priv2 = g_new0(struct aim_directim_priv, 1); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
730 strcpy(priv2->cookie, priv->cookie); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
731 strcpy(priv2->sn, priv->sn); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
732 strcpy(priv2->ip, priv->ip); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
733 directim_dialog(priv2); |
283
0f14e6d8a51b
[gaim-migrate @ 293]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
282
diff
changeset
|
734 } else { |
0f14e6d8a51b
[gaim-migrate @ 293]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
282
diff
changeset
|
735 sprintf(debug_buff, "Unknown rendtype %d\n", rendtype); |
0f14e6d8a51b
[gaim-migrate @ 293]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
282
diff
changeset
|
736 debug_print(debug_buff); |
252
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
737 } |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
738 } |
1 | 739 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
740 return 1; |
1 | 741 } |
742 | |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
743 int gaim_parse_misses(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
744 struct command_rx_struct *command, ...) { |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
745 u_short family; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
746 u_short subtype; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
747 |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
748 family = aimutil_get16(command->data+0); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
749 subtype = aimutil_get16(command->data+2); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
750 |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
751 switch (family) { |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
752 case 0x0001: |
392
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
388
diff
changeset
|
753 if (subtype == 0x000a) { |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
388
diff
changeset
|
754 /* sending messages too fast */ |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
388
diff
changeset
|
755 /* this also gets sent to us when our warning level |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
388
diff
changeset
|
756 * changes, don't ask me why or how to interpret it */ |
401
7c74e2f579b5
[gaim-migrate @ 411]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
392
diff
changeset
|
757 show_error_dialog("960\0someone"); |
392
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
388
diff
changeset
|
758 } |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
759 break; |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
760 case 0x0002: |
392
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
388
diff
changeset
|
761 if (subtype == 0x0001) { |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
388
diff
changeset
|
762 /* unknown SNAC error */ |
401
7c74e2f579b5
[gaim-migrate @ 411]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
392
diff
changeset
|
763 show_error_dialog("970\0\0"); |
392
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
388
diff
changeset
|
764 } |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
765 break; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
766 case 0x0004: |
392
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
388
diff
changeset
|
767 if (subtype == 0x0001) { |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
388
diff
changeset
|
768 /* user is not logged in */ |
401
7c74e2f579b5
[gaim-migrate @ 411]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
392
diff
changeset
|
769 show_error_dialog("901\0User"); |
392
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
388
diff
changeset
|
770 } else if (subtype == 0x000a) { |
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
388
diff
changeset
|
771 /* message has been dropped */ |
401
7c74e2f579b5
[gaim-migrate @ 411]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
392
diff
changeset
|
772 show_error_dialog("903\0\0"); |
392
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
388
diff
changeset
|
773 } |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
774 break; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
775 } |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
776 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
777 return 1; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
778 } |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
779 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
780 int gaim_parse_user_info(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
781 struct command_rx_struct *command, ...) { |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
782 struct aim_userinfo_s *info; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
783 char *prof_enc = NULL, *prof = NULL; |
249
810c595258c8
[gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
248
diff
changeset
|
784 u_short infotype; |
247
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
785 char buf[BUF_LONG]; |
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
786 va_list ap; |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
787 |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
788 va_start(ap, command); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
789 info = va_arg(ap, struct aim_userinfo_s *); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
790 prof_enc = va_arg(ap, char *); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
791 prof = va_arg(ap, char *); |
464 | 792 infotype = (u_short)va_arg(ap, u_int); |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
793 va_end(ap); |
247
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
794 |
249
810c595258c8
[gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
248
diff
changeset
|
795 if (prof == NULL || !strlen(prof)) { |
392
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
388
diff
changeset
|
796 /* no info/away message */ |
401
7c74e2f579b5
[gaim-migrate @ 411]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
392
diff
changeset
|
797 show_error_dialog("977\0\0"); |
249
810c595258c8
[gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
248
diff
changeset
|
798 return 1; |
810c595258c8
[gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
248
diff
changeset
|
799 } |
810c595258c8
[gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
248
diff
changeset
|
800 |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
801 snprintf(buf, sizeof buf, _("Username : <B>%s</B>\n<BR>" |
247
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
802 "Warning Level : <B>%d %%</B>\n<BR>" |
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
803 "Online Since : <B>%s</B><BR>" |
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
804 "Idle Minutes : <B>%d</B>\n<BR><HR><BR>" |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
805 "%s\n"), |
247
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
806 info->sn, |
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
807 info->warnlevel, |
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
808 asctime(localtime(&info->onlinesince)), |
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
809 info->idletime, |
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
810 prof); |
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
811 g_show_info_text(buf); |
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
812 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
813 return 1; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
814 } |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
815 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
816 int gaim_parse_motd(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
817 struct command_rx_struct *command, ...) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
818 char *msg; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
819 u_short id; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
820 va_list ap; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
821 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
822 va_start(ap, command); |
464 | 823 id = (u_short)va_arg(ap, u_int); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
824 msg = va_arg(ap, char *); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
825 va_end(ap); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
826 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
827 sprintf(debug_buff, "MOTD: %s\n", msg); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
828 debug_print(debug_buff); |
282
918db59d3814
[gaim-migrate @ 292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
279
diff
changeset
|
829 sprintf(debug_buff, "Gaim %s / Libfaim %s\n", |
918db59d3814
[gaim-migrate @ 292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
279
diff
changeset
|
830 VERSION, aim_getbuildstring()); |
918db59d3814
[gaim-migrate @ 292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
279
diff
changeset
|
831 debug_print(debug_buff); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
832 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
833 return 1; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
834 } |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
835 |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
836 int gaim_chatnav_info(struct aim_session_t *sess, |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
837 struct command_rx_struct *command, ...) { |
445
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
423
diff
changeset
|
838 va_list ap; |
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
423
diff
changeset
|
839 u_short type; |
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
423
diff
changeset
|
840 |
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
423
diff
changeset
|
841 va_start(ap, command); |
464 | 842 type = (u_short)va_arg(ap, u_int); |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
843 |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
844 switch(type) { |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
845 case 0x0002: { |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
846 int maxrooms; |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
847 struct aim_chat_exchangeinfo *exchanges; |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
848 int exchangecount, i = 0; |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
849 |
466 | 850 maxrooms = (u_char)va_arg(ap, u_int); |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
851 exchangecount = va_arg(ap, int); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
852 exchanges = va_arg(ap, struct aim_chat_exchangeinfo *); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
853 va_end(ap); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
854 |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
855 debug_print("chat info: Chat Rights:\n"); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
856 sprintf(debug_buff, "chat info: \tMax Concurrent Rooms: %d\n", maxrooms); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
857 debug_print(debug_buff); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
858 sprintf(debug_buff, "chat info: \tExchange List: (%d total)\n", exchangecount); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
859 debug_print(debug_buff); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
860 while (i < exchangecount) { |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
861 sprintf(debug_buff, "chat info: \t\t%x: %s (%s/%s)\n", |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
862 exchanges[i].number, |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
863 exchanges[i].name, |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
864 exchanges[i].charset1, |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
865 exchanges[i].lang1); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
866 debug_print(debug_buff); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
867 i++; |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
868 } |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
869 } |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
870 gdk_input_remove(cnpa); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
871 cnpa = -1; |
338
9d258a0aa560
[gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
335
diff
changeset
|
872 aim_conn_kill(sess, &command->conn); |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
873 break; |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
874 default: |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
875 va_end(ap); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
876 sprintf(debug_buff, "chatnav info: unknown type (%04x)\n", type); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
877 debug_print(debug_buff); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
878 break; |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
879 } |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
880 return 1; |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
881 } |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
882 |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
883 int gaim_chat_join(struct aim_session_t *sess, |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
884 struct command_rx_struct *command, ...) { |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
885 va_list ap; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
886 int count, i = 0; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
887 struct aim_userinfo_s *info; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
888 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
889 GList *bcs = buddy_chats; |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
466
diff
changeset
|
890 struct conversation *b = NULL; |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
891 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
892 va_start(ap, command); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
893 count = va_arg(ap, int); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
894 info = va_arg(ap, struct aim_userinfo_s *); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
895 va_end(ap); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
896 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
897 while(bcs) { |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
466
diff
changeset
|
898 b = (struct conversation *)bcs->data; |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
899 if (!strcasecmp(b->name, (char *)command->conn->priv)) |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
900 break; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
901 bcs = bcs->next; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
902 b = NULL; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
903 } |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
904 if (!b) |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
905 return 1; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
906 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
907 while (i < count) |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
908 add_chat_buddy(b, info[i++].sn); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
909 |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
910 return 1; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
911 } |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
912 |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
913 int gaim_chat_leave(struct aim_session_t *sess, |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
914 struct command_rx_struct *command, ...) { |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
915 va_list ap; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
916 int count, i = 0; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
917 struct aim_userinfo_s *info; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
918 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
919 GList *bcs = buddy_chats; |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
466
diff
changeset
|
920 struct conversation *b = NULL; |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
921 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
922 va_start(ap, command); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
923 count = va_arg(ap, int); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
924 info = va_arg(ap, struct aim_userinfo_s *); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
925 va_end(ap); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
926 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
927 while(bcs) { |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
466
diff
changeset
|
928 b = (struct conversation *)bcs->data; |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
929 if (!strcasecmp(b->name, (char *)command->conn->priv)) |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
930 break; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
931 bcs = bcs->next; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
932 b = NULL; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
933 } |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
934 if (!b) |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
935 return 1; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
936 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
937 while (i < count) |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
938 remove_chat_buddy(b, info[i++].sn); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
939 |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
940 return 1; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
941 } |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
942 |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
943 int gaim_chat_info_update(struct aim_session_t *sess, |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
944 struct command_rx_struct *command, ...) { |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
945 debug_print("inside chat_info_update\n"); |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
946 return 1; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
947 } |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
948 |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
949 int gaim_chat_incoming_msg(struct aim_session_t *sess, |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
950 struct command_rx_struct *command, ...) { |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
951 va_list ap; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
952 struct aim_userinfo_s *info; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
953 char *msg; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
954 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
955 GList *bcs = buddy_chats; |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
466
diff
changeset
|
956 struct conversation *b = NULL; |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
957 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
958 va_start(ap, command); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
959 info = va_arg(ap, struct aim_userinfo_s *); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
960 msg = va_arg(ap, char *); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
961 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
962 while(bcs) { |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
466
diff
changeset
|
963 b = (struct conversation *)bcs->data; |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
964 if (!strcasecmp(b->name, (char *)command->conn->priv)) |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
965 break; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
966 bcs = bcs->next; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
967 b = NULL; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
968 } |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
969 if (!b) |
270
cfa39d39dec6
[gaim-migrate @ 280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
267
diff
changeset
|
970 return 0; |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
971 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
972 serv_got_chat_in(b->id, info->sn, 0, msg); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
973 |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
974 return 1; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
975 } |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
976 |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
977 /* |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
978 * Recieved in response to an IM sent with the AIM_IMFLAGS_ACK option. |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
979 */ |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
980 int gaim_parse_msgack(struct aim_session_t *sess, struct command_rx_struct *command, ...) { |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
981 va_list ap; |
505
3bd51b3f07c3
[gaim-migrate @ 515]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
503
diff
changeset
|
982 u_short type; |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
983 char *sn = NULL; |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
984 |
505
3bd51b3f07c3
[gaim-migrate @ 515]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
503
diff
changeset
|
985 va_start(ap, command); |
3bd51b3f07c3
[gaim-migrate @ 515]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
503
diff
changeset
|
986 type = (u_short)va_arg(ap, u_int); |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
987 sn = va_arg(ap, char *); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
988 va_end(ap); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
989 |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
990 sprintf(debug_buff, "Sent message to %s.\n", sn); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
991 debug_print(debug_buff); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
992 |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
993 return 1; |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
994 } |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
995 |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
996 int gaim_parse_ratechange(struct aim_session_t *sess, struct command_rx_struct *command, ...) { |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
997 va_list ap; |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
998 unsigned long newrate; |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
999 |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1000 va_start(ap, command); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1001 newrate = va_arg(ap, unsigned long); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1002 va_end(ap); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1003 |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1004 sprintf(debug_buff, "ratechange: %lu\n", newrate); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1005 debug_print(debug_buff); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1006 |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1007 return 1; |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1008 }; |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1009 |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1010 int gaim_directim_incoming(struct aim_session_t *sess, struct command_rx_struct *command, ...) { |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1011 va_list ap; |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1012 char *sn = NULL, *msg = NULL; |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1013 struct aim_conn_t *conn; |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1014 |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1015 va_start(ap, command); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1016 conn = va_arg(ap, struct aim_conn_t *); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1017 sn = va_arg(ap, char *); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1018 msg = va_arg(ap, char *); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1019 va_end(ap); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1020 |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1021 sprintf(debug_buff, "Got DirectIM message from %s\n", sn); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1022 debug_print(debug_buff); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1023 |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1024 serv_got_im(sn, msg, 0); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1025 |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1026 return 1; |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1027 } |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1028 |
515
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1029 /* this is such a f*cked up function */ |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1030 int gaim_directim_initiate(struct aim_session_t *sess, struct command_rx_struct *command, ...) { |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1031 va_list ap; |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1032 struct aim_directim_priv *priv; |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1033 struct aim_conn_t *newconn; |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1034 struct conversation *cnv; |
517
dd4d415dbe52
[gaim-migrate @ 527]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
516
diff
changeset
|
1035 int watcher; |
515
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1036 |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1037 va_start(ap, command); |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1038 newconn = va_arg(ap, struct aim_conn_t *); |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1039 va_end(ap); |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1040 |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1041 priv = (struct aim_directim_priv *)newconn->priv; |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1042 |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1043 sprintf(debug_buff, "DirectIM: initiate success to %s\n", priv->sn); |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1044 debug_print(debug_buff); |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1045 |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1046 cnv = find_conversation(priv->sn); |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1047 gdk_input_remove(cnv->watcher); |
517
dd4d415dbe52
[gaim-migrate @ 527]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
516
diff
changeset
|
1048 watcher = gdk_input_add(newconn->fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION, |
515
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1049 oscar_callback, newconn); |
517
dd4d415dbe52
[gaim-migrate @ 527]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
516
diff
changeset
|
1050 make_direct(cnv, TRUE, newconn, watcher); |
515
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1051 |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1052 aim_conn_addhandler(sess, newconn, AIM_CB_FAM_OFT, AIM_CB_OFT_DIRECTIMINCOMING, gaim_directim_incoming, 0); |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1053 aim_conn_addhandler(sess, newconn, AIM_CB_FAM_OFT, AIM_CB_OFT_DIRECTIMTYPING, gaim_directim_typing, 0); |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1054 |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1055 return 1; |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1056 } |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1057 |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1058 int gaim_directim_typing(struct aim_session_t *sess, struct command_rx_struct *command, ...) { |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1059 va_list ap; |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1060 char *sn; |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1061 |
512
7922abb3262d
[gaim-migrate @ 522]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
511
diff
changeset
|
1062 va_start(ap, command); |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1063 sn = va_arg(ap, char *); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1064 va_end(ap); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1065 |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1066 /* I had to leave this. It's just too funny. It reminds me of my sister. */ |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1067 sprintf(debug_buff, "ohmigod! %s has started typing (DirectIM). He's going to send you a message! *squeal*\n", sn); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1068 debug_print(debug_buff); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1069 |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1070 return 1; |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1071 } |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1072 |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1073 void oscar_do_directim(char *name) { |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1074 struct aim_conn_t *newconn = aim_directim_initiate(gaim_sess, gaim_conn, NULL, name); |
515
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1075 struct conversation *cnv = find_conversation(name); /* this will never be null because it just got set up */ |
517
dd4d415dbe52
[gaim-migrate @ 527]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
516
diff
changeset
|
1076 cnv->conn = newconn; |
dd4d415dbe52
[gaim-migrate @ 527]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
516
diff
changeset
|
1077 cnv->watcher = gdk_input_add(newconn->fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION, oscar_callback, newconn); |
515
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1078 aim_conn_addhandler(gaim_sess, newconn, AIM_CB_FAM_OFT, AIM_CB_OFT_DIRECTIMINITIATE, gaim_directim_initiate, 0); |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1079 } |