Mercurial > pidgin
annotate src/oscar.c @ 971:26354cf6a362
[gaim-migrate @ 981]
small stupid fixes
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Wed, 11 Oct 2000 01:05:14 +0000 |
parents | f7886476f9d9 |
children | a45991891aba |
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> | |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
40 #include "multi.h" |
1 | 41 #include "gaim.h" |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
42 #include "aim.h" |
1 | 43 #include "gnome_applet_mgr.h" |
44 | |
526
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
45 #include "pixmaps/cancel.xpm" |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
46 #include "pixmaps/ok.xpm" |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
47 |
369
cf895313fc50
[gaim-migrate @ 379]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
48 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
|
49 AIM_CAPS_VOICE | AIM_CAPS_IMIMAGE | AIM_CAPS_BUDDYICON; |
891
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
857
diff
changeset
|
50 int keepalv = -1; |
1 | 51 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
52 struct chat_connection *find_oscar_chat(struct gaim_connection *gc, char *name) { |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
53 GSList *g = gc->oscar_chats; |
312
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
54 struct chat_connection *c = NULL; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
55 if (gc->protocol != PROTO_OSCAR) return NULL; |
312
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
56 |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
57 while (g) { |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
58 c = (struct chat_connection *)g->data; |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
59 if (!strcmp(name, c->name)) |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
60 break; |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
61 g = g->next; |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
62 c = NULL; |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
63 } |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
64 |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
65 return c; |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
66 } |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
67 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
68 static struct chat_connection *find_oscar_chat_by_conn(struct gaim_connection *gc, |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
69 struct aim_conn_t *conn) { |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
70 GSList *g = gc->oscar_chats; |
833
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
71 struct chat_connection *c = NULL; |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
72 |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
73 while (g) { |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
74 c = (struct chat_connection *)g->data; |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
75 if (c->conn == conn) |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
76 break; |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
77 g = g->next; |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
78 c = NULL; |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
79 } |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
80 |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
81 return c; |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
82 } |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
83 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
84 static struct gaim_connection *find_gaim_conn_by_aim_sess(struct aim_session_t *sess) { |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
85 GSList *g = connections; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
86 struct gaim_connection *gc = NULL; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
87 |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
88 while (g) { |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
89 gc = (struct gaim_connection *)g->data; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
90 if (sess == gc->oscar_sess) |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
91 break; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
92 g = g->next; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
93 gc = NULL; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
94 } |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
95 |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
96 return gc; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
97 } |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
98 |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
99 static struct gaim_connection *find_gaim_conn_by_oscar_conn(struct aim_conn_t *conn) { |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
100 GSList *g = connections; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
101 struct gaim_connection *c = NULL; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
102 struct aim_conn_t *s; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
103 while (g) { |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
104 c = (struct gaim_connection *)g->data; |
965
50f2977537d8
[gaim-migrate @ 975]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
964
diff
changeset
|
105 if (c->protocol != PROTO_OSCAR) { |
50f2977537d8
[gaim-migrate @ 975]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
964
diff
changeset
|
106 c = NULL; |
50f2977537d8
[gaim-migrate @ 975]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
964
diff
changeset
|
107 g = g->next; |
50f2977537d8
[gaim-migrate @ 975]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
964
diff
changeset
|
108 continue; |
50f2977537d8
[gaim-migrate @ 975]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
964
diff
changeset
|
109 } |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
110 s = c->oscar_sess->connlist; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
111 while (s) { |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
112 if (conn == s) |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
113 break; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
114 s = s->next; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
115 } |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
116 if (s) break; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
117 g = g->next; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
118 c = NULL; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
119 } |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
120 |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
121 return c; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
122 } |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
123 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
124 static int gaim_parse_auth_resp (struct aim_session_t *, struct command_rx_struct *, ...); |
741
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
736
diff
changeset
|
125 static int gaim_parse_login (struct aim_session_t *, struct command_rx_struct *, ...); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
126 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
|
127 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
|
128 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
|
129 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
|
130 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
|
131 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
|
132 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
|
133 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
|
134 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
|
135 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
|
136 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
|
137 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
|
138 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
|
139 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
|
140 static int gaim_parse_ratechange (struct aim_session_t *, struct command_rx_struct *, ...); |
771
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
141 static int gaim_parse_evilnotify (struct aim_session_t *, struct command_rx_struct *, ...); |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
142 static int gaim_bosrights (struct aim_session_t *, struct command_rx_struct *, ...); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
143 static int gaim_rateresp (struct aim_session_t *, struct command_rx_struct *, ...); |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
144 static int gaim_reportinterval (struct aim_session_t *, struct command_rx_struct *, ...); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
145 static int gaim_parse_msgerr (struct aim_session_t *, struct command_rx_struct *, ...); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
146 static int gaim_parse_buddyrights(struct aim_session_t *, struct command_rx_struct *, ...); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
147 static int gaim_parse_locerr (struct aim_session_t *, struct command_rx_struct *, ...); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
148 |
515
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
149 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
|
150 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
|
151 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
|
152 |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
153 static char *msgerrreason[] = { |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
154 "Invalid error", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
155 "Invalid SNAC", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
156 "Rate to host", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
157 "Rate to client", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
158 "Not logged in", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
159 "Service unavailable", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
160 "Service not defined", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
161 "Obsolete SNAC", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
162 "Not supported by host", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
163 "Not supported by client", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
164 "Refused by client", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
165 "Reply too big", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
166 "Responses lost", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
167 "Request denied", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
168 "Busted SNAC payload", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
169 "Insufficient rights", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
170 "In local permit/deny", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
171 "Too evil (sender)", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
172 "Too evil (receiver)", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
173 "User temporarily unavailable", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
174 "No match", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
175 "List overflow", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
176 "Request ambiguous", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
177 "Queue full", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
178 "Not while on AOL" |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
179 }; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
180 static int msgerrreasonlen = 25; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
181 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
182 static void oscar_callback(gpointer data, gint source, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
183 GdkInputCondition condition) { |
288
6e609d42f767
[gaim-migrate @ 298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
184 struct aim_conn_t *conn = (struct aim_conn_t *)data; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
185 struct gaim_connection *gc = find_gaim_conn_by_oscar_conn(conn); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
186 if (!gc) { |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
187 /* oh boy. this is probably bad. i guess the only thing we can really do |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
188 * is return? */ |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
189 debug_print("oscar callback for closed connection.\n"); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
190 return; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
191 } |
1 | 192 |
259
e159ba2486fc
[gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
193 if (condition & GDK_INPUT_EXCEPTION) { |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
194 signoff(gc); |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
195 hide_login_progress(_("Disconnected.")); |
259
e159ba2486fc
[gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
196 return; |
e159ba2486fc
[gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
197 } |
e159ba2486fc
[gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
198 if (condition & GDK_INPUT_READ) { |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
199 if (conn->type == AIM_CONN_TYPE_RENDEZVOUS_OUT) { |
515
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
200 debug_print("got information on rendezvous\n"); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
201 if (aim_handlerendconnect(gc->oscar_sess, conn) < 0) { |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
202 debug_print(_("connection error (rend)\n")); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
203 } |
259
e159ba2486fc
[gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
204 } else { |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
205 if (aim_get_command(gc->oscar_sess, conn) >= 0) { |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
206 aim_rxdispatch(gc->oscar_sess); |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
207 } else { |
638
525c566741da
[gaim-migrate @ 648]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
604
diff
changeset
|
208 if (conn->type == AIM_CONN_TYPE_RENDEZVOUS && |
525c566741da
[gaim-migrate @ 648]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
604
diff
changeset
|
209 conn->subtype == AIM_CONN_SUBTYPE_OFT_DIRECTIM) { |
525c566741da
[gaim-migrate @ 648]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
604
diff
changeset
|
210 struct conversation *cnv = |
525c566741da
[gaim-migrate @ 648]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
604
diff
changeset
|
211 find_conversation(((struct aim_directim_priv *)conn->priv)->sn); |
515
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
212 debug_print("connection error for directim\n"); |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
213 if (cnv) { |
516
ee4e18868584
[gaim-migrate @ 526]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
515
diff
changeset
|
214 make_direct(cnv, FALSE, NULL, 0); |
515
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
215 } |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
216 aim_conn_kill(gc->oscar_sess, &conn); |
704
1d989562af1f
[gaim-migrate @ 714]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
700
diff
changeset
|
217 } else if ((conn->type == AIM_CONN_TYPE_BOS) || |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
218 !(aim_getconn_type(gc->oscar_sess, AIM_CONN_TYPE_BOS))) { |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
219 debug_print(_("major connection error\n")); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
220 signoff(gc); |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
221 hide_login_progress(_("Disconnected.")); |
747
eec93c5929b9
[gaim-migrate @ 757]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
746
diff
changeset
|
222 } else if (conn->type == AIM_CONN_TYPE_CHAT) { |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
223 struct chat_connection *c = find_oscar_chat_by_conn(gc, conn); |
833
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
224 char buf[BUF_LONG]; |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
225 sprintf(debug_buff, "disconnected from chat room %s\n", c->name); |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
226 debug_print(debug_buff); |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
227 c->conn = NULL; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
228 if (c->inpa > -1) |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
229 gdk_input_remove(c->inpa); |
833
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
230 c->inpa = -1; |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
231 c->fd = -1; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
232 aim_conn_kill(gc->oscar_sess, &conn); |
833
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
233 sprintf(buf, _("You have been disconnected from chat room %s."), c->name); |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
234 do_error_dialog(buf, _("Chat Error!")); |
828
4c71c0e7f04e
[gaim-migrate @ 838]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
812
diff
changeset
|
235 } else if (conn->type == AIM_CONN_TYPE_CHATNAV) { |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
236 if (gc->cnpa > -1) |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
237 gdk_input_remove(gc->cnpa); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
238 gc->cnpa = -1; |
828
4c71c0e7f04e
[gaim-migrate @ 838]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
812
diff
changeset
|
239 debug_print("removing chatnav input watcher\n"); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
240 aim_conn_kill(gc->oscar_sess, &conn); |
695
d3db515e9a6e
[gaim-migrate @ 705]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
694
diff
changeset
|
241 } else { |
794
80274f969a09
[gaim-migrate @ 804]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
788
diff
changeset
|
242 sprintf(debug_buff, "holy crap! generic connection error! %d\n", |
80274f969a09
[gaim-migrate @ 804]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
788
diff
changeset
|
243 conn->type); |
80274f969a09
[gaim-migrate @ 804]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
788
diff
changeset
|
244 debug_print(debug_buff); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
245 aim_conn_kill(gc->oscar_sess, &conn); |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
246 } |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
247 } |
259
e159ba2486fc
[gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
248 } |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
249 } |
1 | 250 } |
251 | |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
252 struct gaim_connection *oscar_login(char *username, char *password) { |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
253 struct aim_session_t *sess; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
254 struct aim_conn_t *conn; |
253
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
252
diff
changeset
|
255 struct aim_user *u; |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
256 char buf[256]; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
257 struct gaim_connection *gc; |
1 | 258 |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
259 sprintf(debug_buff, _("Logging in %s\n"), username); |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
260 debug_print(debug_buff); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
261 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
262 gc = new_gaim_conn(PROTO_OSCAR, username, password); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
263 sess = g_new0(struct aim_session_t, 1); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
264 aim_session_init(sess); |
279
501e09c51cbc
[gaim-migrate @ 289]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
277
diff
changeset
|
265 /* 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
|
266 * see if things need to be sent. */ |
501e09c51cbc
[gaim-migrate @ 289]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
277
diff
changeset
|
267 sess->tx_enqueue = &aim_tx_enqueue__immediate; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
268 gc->oscar_sess = sess; |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
269 |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
270 sprintf(buf, _("Looking up %s"), FAIM_LOGIN_SERVER); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
271 set_login_progress(1, buf); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
272 conn = aim_newconn(sess, AIM_CONN_TYPE_AUTH, FAIM_LOGIN_SERVER); |
1 | 273 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
274 if (conn == NULL) { |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
275 debug_print(_("internal connection error\n")); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
276 #ifdef USE_APPLET |
746
5a908dd5cfc4
[gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
744
diff
changeset
|
277 set_user_state(offline); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
278 #endif |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
279 destroy_gaim_conn(gc); |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
280 hide_login_progress(_("Unable to login to AIM")); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
281 return NULL; |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
282 } else if (conn->fd == -1) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
283 #ifdef USE_APPLET |
746
5a908dd5cfc4
[gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
744
diff
changeset
|
284 set_user_state(offline); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
285 #endif |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
286 destroy_gaim_conn(gc); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
287 if (conn->status & AIM_CONN_STATUS_RESOLVERR) { |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
288 sprintf(debug_buff, _("couldn't resolve host\n")); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
289 debug_print(debug_buff); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
290 hide_login_progress(debug_buff); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
291 } else if (conn->status & AIM_CONN_STATUS_CONNERR) { |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
292 sprintf(debug_buff, _("couldn't connect to host\n")); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
293 debug_print(debug_buff); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
294 hide_login_progress(debug_buff); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
295 } |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
296 return NULL; |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
297 } |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
298 g_snprintf(buf, sizeof(buf), _("Signon: %s"), username); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
299 set_login_progress(2, buf); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
300 |
741
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
736
diff
changeset
|
301 aim_conn_addhandler(sess, conn, 0x0017, 0x0007, gaim_parse_login, 0); |
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
736
diff
changeset
|
302 aim_conn_addhandler(sess, conn, 0x0017, 0x0003, gaim_parse_auth_resp, 0); |
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
736
diff
changeset
|
303 aim_sendconnack(sess, conn); |
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
736
diff
changeset
|
304 aim_request_login(sess, conn, username); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
305 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
306 gc->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
|
307 oscar_callback, conn); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
308 |
253
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
252
diff
changeset
|
309 u = find_user(username); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
310 sprintf(gc->user_info, "%s", u->user_info); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
311 gc->options = u->options; |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
312 save_prefs(); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
313 |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
314 debug_print(_("Password sent, waiting for response\n")); |
1 | 315 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
316 return gc; |
1 | 317 } |
318 | |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
319 void oscar_close(struct gaim_connection *gc) { |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
320 if (gc->protocol != PROTO_OSCAR) return; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
321 if (gc->inpa > 0) |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
322 gdk_input_remove(gc->inpa); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
323 gc->inpa = -1; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
324 if (gc->cnpa > 0) |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
325 gdk_input_remove(gc->cnpa); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
326 gc->cnpa = -1; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
327 if (gc->paspa > 0) |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
328 gdk_input_remove(gc->paspa); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
329 gc->paspa = -1; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
330 aim_logoff(gc->oscar_sess); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
331 g_free(gc->oscar_sess); |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
332 debug_print(_("Signed off.\n")); |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
333 } |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
334 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
335 int gaim_parse_auth_resp(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
336 struct command_rx_struct *command, ...) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
337 struct aim_conn_t *bosconn = NULL; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
338 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
339 sprintf(debug_buff, "inside auth_resp (Screen name: %s)\n", |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
340 sess->logininfo.screen_name); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
341 debug_print(debug_buff); |
1 | 342 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
343 if (sess->logininfo.errorcode) { |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
344 switch (sess->logininfo.errorcode) { |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
345 case 0x18: |
392
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
388
diff
changeset
|
346 /* connecting too frequently */ |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
347 do_error_dialog(_("You have been connecting and disconnecting too frequently. Wait ten minutes and try again. If you continue to try, you will need to wait even longer."), _("Gaim - Error")); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
348 plugin_event(event_error, (void *)983, 0, 0); |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
349 break; |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
350 case 0x05: |
392
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
388
diff
changeset
|
351 /* Incorrect nick/password */ |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
352 do_error_dialog(_("Incorrect nickname or password."), _("Gaim - Error")); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
353 plugin_event(event_error, (void *)980, 0, 0); |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
354 break; |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
355 case 0x1c: |
392
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
388
diff
changeset
|
356 /* client too old */ |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
357 do_error_dialog(_("The client version you are using is too old. Please upgrade at http://www.marko.net/gaim/"), _("Gaim - Error")); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
358 plugin_event(event_error, (void *)989, 0, 0); |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
359 break; |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
360 } |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
361 sprintf(debug_buff, "Login Error Code 0x%04x\n", |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
362 sess->logininfo.errorcode); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
363 debug_print(debug_buff); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
364 sprintf(debug_buff, "Error URL: %s\n", |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
365 sess->logininfo.errorurl); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
366 debug_print(debug_buff); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
367 #ifdef USE_APPLET |
746
5a908dd5cfc4
[gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
744
diff
changeset
|
368 set_user_state(offline); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
369 #endif |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
370 gdk_input_remove(gc->inpa); |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
371 hide_login_progress(_("Authentication Failed")); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
372 signoff(gc); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
373 return 0; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
374 } |
1 | 375 |
376 | |
946
acd4d81f2afc
[gaim-migrate @ 956]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
930
diff
changeset
|
377 if (sess->logininfo.email) { |
acd4d81f2afc
[gaim-migrate @ 956]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
930
diff
changeset
|
378 sprintf(debug_buff, "Email: %s\n", sess->logininfo.email); |
acd4d81f2afc
[gaim-migrate @ 956]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
930
diff
changeset
|
379 debug_print(debug_buff); |
acd4d81f2afc
[gaim-migrate @ 956]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
930
diff
changeset
|
380 } else { |
acd4d81f2afc
[gaim-migrate @ 956]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
930
diff
changeset
|
381 debug_print("Email is NULL\n"); |
acd4d81f2afc
[gaim-migrate @ 956]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
930
diff
changeset
|
382 } |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
383 sprintf(debug_buff, "Closing auth connection...\n"); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
384 debug_print(debug_buff); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
385 gdk_input_remove(gc->inpa); |
338
9d258a0aa560
[gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
335
diff
changeset
|
386 aim_conn_kill(sess, &command->conn); |
1 | 387 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
388 bosconn = aim_newconn(sess, AIM_CONN_TYPE_BOS, sess->logininfo.BOSIP); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
389 if (bosconn == NULL) { |
1 | 390 #ifdef USE_APPLET |
746
5a908dd5cfc4
[gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
744
diff
changeset
|
391 set_user_state(offline); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
392 #endif |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
393 destroy_gaim_conn(gc); |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
394 hide_login_progress(_("Internal Error")); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
395 return -1; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
396 } else if (bosconn->status != 0) { |
1 | 397 #ifdef USE_APPLET |
746
5a908dd5cfc4
[gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
744
diff
changeset
|
398 set_user_state(offline); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
399 #endif |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
400 destroy_gaim_conn(gc); |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
401 hide_login_progress(_("Could Not Connect")); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
402 return -1; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
403 } |
1 | 404 |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
405 aim_conn_addhandler(sess, bosconn, 0x0009, 0x0003, gaim_bosrights, 0); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
406 aim_conn_addhandler(sess, bosconn, 0x0001, 0x0007, gaim_rateresp, 0); /* rate info */ |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
407 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
|
408 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
|
409 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
|
410 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_GEN, AIM_CB_GEN_REDIRECT, gaim_handle_redirect, 0); |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
411 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_STS, AIM_CB_STS_SETREPORTINTERVAL, gaim_reportinterval, 0); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
412 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_BUD, AIM_CB_BUD_RIGHTSINFO, gaim_parse_buddyrights, 0); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
413 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
|
414 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
|
415 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_MSG, AIM_CB_MSG_INCOMING, gaim_parse_incoming_im, 0); |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
416 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_LOC, AIM_CB_LOC_ERROR, gaim_parse_locerr, 0); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
417 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
|
418 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_GEN, AIM_CB_GEN_RATECHANGE, gaim_parse_ratechange, 0); |
771
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
419 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_GEN, AIM_CB_GEN_EVIL, gaim_parse_evilnotify, 0); |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
420 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_MSG, AIM_CB_MSG_ERROR, gaim_parse_msgerr, 0); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
421 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
|
422 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
|
423 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
|
424 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
|
425 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
|
426 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
427 aim_auth_sendcookie(sess, bosconn, sess->logininfo.cookie); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
428 gc->oscar_conn = bosconn; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
429 gc->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
|
430 oscar_callback, bosconn); |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
431 set_login_progress(4, _("Connection established, cookie sent")); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
432 return 1; |
1 | 433 } |
434 | |
741
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
736
diff
changeset
|
435 int gaim_parse_login(struct aim_session_t *sess, |
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
736
diff
changeset
|
436 struct command_rx_struct *command, ...) { |
857
41bfae606d39
[gaim-migrate @ 867]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
840
diff
changeset
|
437 struct client_info_s info = {"AOL Instant Messenger (SM), version 4.1.2010/WIN32", 4, 30, 3141, "us", "en", 0x0004, 0x0001, 0x055}; |
840
595ac7759563
[gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
838
diff
changeset
|
438 char *key; |
741
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
736
diff
changeset
|
439 va_list ap; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
440 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess); |
741
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
736
diff
changeset
|
441 |
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
736
diff
changeset
|
442 va_start(ap, command); |
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
736
diff
changeset
|
443 key = va_arg(ap, char *); |
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
736
diff
changeset
|
444 va_end(ap); |
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
736
diff
changeset
|
445 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
446 aim_send_login(sess, command->conn, gc->username, gc->password, &info, key); |
747
eec93c5929b9
[gaim-migrate @ 757]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
746
diff
changeset
|
447 return 1; |
741
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
736
diff
changeset
|
448 } |
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
736
diff
changeset
|
449 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
450 int gaim_server_ready(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
451 struct command_rx_struct *command, ...) { |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
452 static int id = 1; |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
453 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
454 switch (command->conn->type) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
455 case AIM_CONN_TYPE_BOS: |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
456 aim_setversions(sess, command->conn); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
457 aim_bos_reqrate(sess, command->conn); /* request rate info */ |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
458 debug_print("done with BOS ServerReady\n"); |
1 | 459 break; |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
460 case AIM_CONN_TYPE_CHATNAV: |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
461 debug_print("chatnav: got server ready\n"); |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
462 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
|
463 aim_bos_reqrate(sess, command->conn); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
464 aim_bos_ackrateresp(sess, command->conn); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
465 aim_chatnav_clientready(sess, command->conn); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
466 aim_chatnav_reqrights(sess, command->conn); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
467 break; |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
468 case AIM_CONN_TYPE_CHAT: |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
469 debug_print("chat: got server ready\n"); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
470 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
|
471 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
|
472 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
|
473 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
|
474 aim_bos_reqrate(sess, command->conn); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
475 aim_bos_ackrateresp(sess, command->conn); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
476 aim_chat_clientready(sess, command->conn); |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
477 serv_got_joined_chat(gc, id++, aim_chat_getname(command->conn)); |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
478 break; |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
479 case AIM_CONN_TYPE_RENDEZVOUS: |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
480 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
|
481 break; |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
482 default: /* huh? */ |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
483 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
|
484 debug_print(debug_buff); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
485 break; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
486 } |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
487 return 1; |
1 | 488 } |
489 | |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
490 int gaim_handle_redirect(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
491 struct command_rx_struct *command, ...) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
492 va_list ap; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
493 int serviceid; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
494 char *ip; |
840
595ac7759563
[gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
838
diff
changeset
|
495 unsigned char *cookie; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
496 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess); |
1 | 497 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
498 va_start(ap, command); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
499 serviceid = va_arg(ap, int); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
500 ip = va_arg(ap, char *); |
840
595ac7759563
[gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
838
diff
changeset
|
501 cookie = va_arg(ap, unsigned char *); |
1 | 502 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
503 switch(serviceid) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
504 case 0x7: /* Authorizer */ |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
505 debug_print("Reconnecting with authorizor...\n"); |
237
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 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
|
508 if (tstconn == NULL || tstconn->status >= AIM_CONN_STATUS_RESOLVERR) |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
509 debug_print("unable to reconnect with authorizer\n"); |
331
f3c8d79688db
[gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
319
diff
changeset
|
510 else { |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
511 gc->paspa = gdk_input_add(tstconn->fd, |
331
f3c8d79688db
[gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
319
diff
changeset
|
512 GDK_INPUT_READ | GDK_INPUT_EXCEPTION, |
f3c8d79688db
[gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
319
diff
changeset
|
513 oscar_callback, tstconn); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
514 aim_auth_sendcookie(sess, tstconn, cookie); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
515 } |
331
f3c8d79688db
[gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
319
diff
changeset
|
516 } |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
517 break; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
518 case 0xd: /* ChatNav */ |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
519 { |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
520 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
|
521 if (tstconn == NULL || tstconn->status >= AIM_CONN_STATUS_RESOLVERR) { |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
522 debug_print("unable to connect to chatnav server\n"); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
523 return 1; |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
524 } |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
525 aim_conn_addhandler(sess, tstconn, 0x0001, 0x0003, gaim_server_ready, 0); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
526 aim_auth_sendcookie(sess, tstconn, cookie); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
527 gc->cnpa = gdk_input_add(tstconn->fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION, |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
528 oscar_callback, tstconn); |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
529 } |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
530 debug_print("chatnav: connected\n"); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
531 break; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
532 case 0xe: /* Chat */ |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
533 { |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
534 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
|
535 char *roomname = va_arg(ap, char *); |
312
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
536 struct chat_connection *ccon; |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
537 if (tstconn == NULL || tstconn->status >= AIM_CONN_STATUS_RESOLVERR) { |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
538 debug_print("unable to connect to chat server\n"); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
539 return 1; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
540 } |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
541 sprintf(debug_buff, "Connected to chat room %s\n", roomname); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
542 debug_print(debug_buff); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
543 |
312
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
544 ccon = g_new0(struct chat_connection, 1); |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
545 ccon->conn = tstconn; |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
546 ccon->fd = tstconn->fd; |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
547 ccon->name = g_strdup(roomname); |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
548 |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
549 ccon->inpa = gdk_input_add(tstconn->fd, |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
550 GDK_INPUT_READ | GDK_INPUT_EXCEPTION, |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
551 oscar_callback, tstconn); |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
552 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
553 gc->oscar_chats = g_slist_append(gc->oscar_chats, ccon); |
312
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
554 |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
555 aim_chat_attachname(tstconn, roomname); |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
556 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
|
557 aim_auth_sendcookie(sess, tstconn, cookie); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
558 } |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
559 break; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
560 default: /* huh? */ |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
561 sprintf(debug_buff, "got redirect for unknown service 0x%04x\n", |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
562 serviceid); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
563 debug_print(debug_buff); |
1 | 564 break; |
565 } | |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
566 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
567 va_end(ap); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
568 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
569 return 1; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
570 } |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
571 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
572 int gaim_parse_oncoming(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
573 struct command_rx_struct *command, ...) { |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
574 struct aim_userinfo_s *info; |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
575 time_t time_idle; |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
576 int type = 0; |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
577 |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
578 va_list ap; |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
579 va_start(ap, command); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
580 info = va_arg(ap, struct aim_userinfo_s *); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
581 va_end(ap); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
582 |
900
e18815f5a4e9
[gaim-migrate @ 910]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
583 if (info->flags & AIM_FLAG_UNCONFIRMED) |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
584 type |= UC_UNCONFIRMED; |
900
e18815f5a4e9
[gaim-migrate @ 910]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
585 else if (info->flags & AIM_FLAG_ADMINISTRATOR) |
771
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
586 type |= UC_ADMIN; |
900
e18815f5a4e9
[gaim-migrate @ 910]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
587 else if (info->flags & AIM_FLAG_AOL) |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
588 type |= UC_AOL; |
900
e18815f5a4e9
[gaim-migrate @ 910]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
589 else if (info->flags & AIM_FLAG_FREE) |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
590 type |= UC_NORMAL; |
900
e18815f5a4e9
[gaim-migrate @ 910]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
591 if (info->flags & AIM_FLAG_AWAY) |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
592 type |= UC_UNAVAILABLE; |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
593 |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
594 if (info->idletime) { |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
595 time(&time_idle); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
596 time_idle -= info->idletime*60; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
597 } else |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
598 time_idle = 0; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
599 |
601
e670cdb5fb2f
[gaim-migrate @ 611]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
592
diff
changeset
|
600 serv_got_update(info->sn, 1, info->warnlevel/10, info->onlinesince, |
513
eaddaa0dbbcb
[gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
512
diff
changeset
|
601 time_idle, type, info->capabilities); |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
602 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
603 return 1; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
604 } |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
605 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
606 int gaim_parse_offgoing(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
607 struct command_rx_struct *command, ...) { |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
608 char *sn; |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
609 va_list ap; |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
610 |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
611 va_start(ap, command); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
612 sn = va_arg(ap, char *); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
613 va_end(ap); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
614 |
513
eaddaa0dbbcb
[gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
512
diff
changeset
|
615 serv_got_update(sn, 0, 0, 0, 0, 0, 0); |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
616 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
617 return 1; |
1 | 618 } |
619 | |
526
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
620 static void accept_directim(GtkWidget *w, GtkWidget *m) |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
621 { |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
622 struct aim_conn_t *newconn; |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
623 struct aim_directim_priv *priv; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
624 struct gaim_connection *gc; |
526
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
625 int watcher; |
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 priv = (struct aim_directim_priv *)gtk_object_get_user_data(GTK_OBJECT(m)); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
628 gc = (struct gaim_connection *)gtk_object_get_user_data(GTK_OBJECT(w)); |
526
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
629 gtk_widget_destroy(m); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
630 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
631 if (!(newconn = aim_directim_connect(gc->oscar_sess, gc->oscar_conn, priv))) { |
526
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
632 debug_print("imimage: could not connect\n"); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
633 return; |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
634 } |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
635 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
636 aim_conn_addhandler(gc->oscar_sess, newconn, AIM_CB_FAM_OFT, AIM_CB_OFT_DIRECTIMINCOMING, gaim_directim_incoming, 0); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
637 aim_conn_addhandler(gc->oscar_sess, newconn, AIM_CB_FAM_OFT, AIM_CB_OFT_DIRECTIMTYPING, gaim_directim_typing, 0); |
526
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
638 |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
639 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
|
640 oscar_callback, newconn); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
641 |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
642 sprintf(debug_buff, "DirectIM: connected to %s\n", priv->sn); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
643 debug_print(debug_buff); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
644 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
645 serv_got_imimage(gc, priv->sn, priv->cookie, priv->ip, newconn, watcher); |
526
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
646 |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
647 g_free(priv); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
648 } |
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 static void cancel_directim(GtkWidget *w, GtkWidget *m) |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
651 { |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
652 gtk_widget_destroy(m); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
653 } |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
654 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
655 static void directim_dialog(struct gaim_connection *gc, struct aim_directim_priv *priv) |
526
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
656 { |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
657 GtkWidget *window; |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
658 GtkWidget *vbox; |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
659 GtkWidget *hbox; |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
660 GtkWidget *label; |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
661 GtkWidget *yes; |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
662 GtkWidget *no; |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
663 char buf[BUF_LONG]; |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
664 |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
665 window = gtk_window_new(GTK_WINDOW_DIALOG); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
666 gtk_window_set_title(GTK_WINDOW(window), _("Accept Direct IM?")); |
905 | 667 gtk_window_set_wmclass(GTK_WINDOW(window), "directim", "Gaim"); |
526
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
668 gtk_widget_realize(window); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
669 aol_icon(window->window); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
670 gtk_object_set_user_data(GTK_OBJECT(window), (void *)priv); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
671 |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
672 vbox = gtk_vbox_new(TRUE, 5); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
673 gtk_container_add(GTK_CONTAINER(window), vbox); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
674 gtk_widget_show(vbox); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
675 |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
676 sprintf(buf, _("%s has requested to directly connect to your computer. " |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
677 "Do you accept?"), priv->sn); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
678 label = gtk_label_new(buf); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
679 gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 5); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
680 gtk_widget_show(label); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
681 |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
682 hbox = gtk_hbox_new(TRUE, 10); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
683 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
684 gtk_widget_show(hbox); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
685 |
604
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
601
diff
changeset
|
686 yes = picture_button(window, _("Accept"), ok_xpm); |
526
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
687 gtk_box_pack_start(GTK_BOX(hbox), yes, FALSE, FALSE, 5); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
688 gtk_object_set_user_data(GTK_OBJECT(yes), gc); |
526
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
689 |
604
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
601
diff
changeset
|
690 no = picture_button(window, _("Cancel"), cancel_xpm); |
526
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
691 gtk_box_pack_end(GTK_BOX(hbox), no, FALSE, FALSE, 5); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
692 |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
693 gtk_signal_connect(GTK_OBJECT(yes), "clicked", |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
694 GTK_SIGNAL_FUNC(accept_directim), window); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
695 gtk_signal_connect(GTK_OBJECT(no), "clicked", |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
696 GTK_SIGNAL_FUNC(cancel_directim), window); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
697 |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
698 gtk_widget_show(window); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
699 } |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
700 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
701 int gaim_parse_incoming_im(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
702 struct command_rx_struct *command, ...) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
703 int channel; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
704 va_list ap; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
705 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess); |
1 | 706 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
707 va_start(ap, command); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
708 channel = va_arg(ap, int); |
1 | 709 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
710 /* channel 1: standard message */ |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
711 if (channel == 1) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
712 struct aim_userinfo_s *userinfo; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
713 char *msg = NULL; |
744
f53e8f48628d
[gaim-migrate @ 754]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
741
diff
changeset
|
714 char *tmp = g_malloc(BUF_LONG); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
715 u_int icbmflags = 0; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
716 u_short flag1, flag2; |
1 | 717 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
718 userinfo = va_arg(ap, struct aim_userinfo_s *); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
719 msg = va_arg(ap, char *); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
720 icbmflags = va_arg(ap, u_int); |
464 | 721 flag1 = (u_short)va_arg(ap, u_int); |
722 flag2 = (u_short)va_arg(ap, u_int); | |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
723 va_end(ap); |
1 | 724 |
744
f53e8f48628d
[gaim-migrate @ 754]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
741
diff
changeset
|
725 g_snprintf(tmp, BUF_LONG, "%s", msg); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
726 serv_got_im(gc, userinfo->sn, tmp, icbmflags & AIM_IMFLAGS_AWAY); |
744
f53e8f48628d
[gaim-migrate @ 754]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
741
diff
changeset
|
727 g_free(tmp); |
252
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
728 } else if (channel == 2) { |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
729 struct aim_userinfo_s *userinfo; |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
730 int rendtype = va_arg(ap, int); |
445
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
423
diff
changeset
|
731 if (rendtype & AIM_CAPS_CHAT) { |
252
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
732 char *msg, *encoding, *lang; |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
733 struct aim_chat_roominfo *roominfo; |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
734 |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
735 userinfo = va_arg(ap, struct aim_userinfo_s *); |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
736 roominfo = va_arg(ap, struct aim_chat_roominfo *); |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
737 msg = va_arg(ap, char *); |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
738 encoding = va_arg(ap, char *); |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
739 lang = va_arg(ap, char *); |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
740 va_end(ap); |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
741 |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
742 serv_got_chat_invite(gc, |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
743 roominfo->name, |
693
30a8e386849d
[gaim-migrate @ 703]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
692
diff
changeset
|
744 roominfo->exchange, |
252
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
745 userinfo->sn, |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
746 msg); |
445
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
423
diff
changeset
|
747 } else if (rendtype & AIM_CAPS_SENDFILE) { |
338
9d258a0aa560
[gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
335
diff
changeset
|
748 /* 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
|
749 } else if (rendtype & AIM_CAPS_GETFILE) { |
338
9d258a0aa560
[gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
335
diff
changeset
|
750 /* 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
|
751 } else if (rendtype & AIM_CAPS_VOICE) { |
369
cf895313fc50
[gaim-migrate @ 379]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
752 /* this one libfaim tells us unuseful info about */ |
445
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
423
diff
changeset
|
753 } else if (rendtype & AIM_CAPS_BUDDYICON) { |
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
423
diff
changeset
|
754 /* bah */ |
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
423
diff
changeset
|
755 } else if (rendtype & AIM_CAPS_IMIMAGE) { |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
756 /* DirectIM stuff */ |
526
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
757 struct aim_directim_priv *priv, *priv2; |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
758 |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
759 userinfo = va_arg(ap, struct aim_userinfo_s *); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
760 priv = va_arg(ap, struct aim_directim_priv *); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
761 va_end(ap); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
762 |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
763 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
|
764 debug_print(debug_buff); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
765 |
526
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
766 priv2 = g_new0(struct aim_directim_priv, 1); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
767 strcpy(priv2->cookie, priv->cookie); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
768 strcpy(priv2->sn, priv->sn); |
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
769 strcpy(priv2->ip, priv->ip); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
770 directim_dialog(gc, priv2); |
283
0f14e6d8a51b
[gaim-migrate @ 293]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
282
diff
changeset
|
771 } else { |
0f14e6d8a51b
[gaim-migrate @ 293]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
282
diff
changeset
|
772 sprintf(debug_buff, "Unknown rendtype %d\n", rendtype); |
0f14e6d8a51b
[gaim-migrate @ 293]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
282
diff
changeset
|
773 debug_print(debug_buff); |
252
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
774 } |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
775 } |
1 | 776 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
777 return 1; |
1 | 778 } |
779 | |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
780 int gaim_parse_misses(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
781 struct command_rx_struct *command, ...) { |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
782 va_list ap; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
783 u_short chan, nummissed, reason; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
784 struct aim_userinfo_s *userinfo; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
785 char buf[1024]; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
786 |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
787 va_start(ap, command); |
838
7714587cd1f9
[gaim-migrate @ 848]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
836
diff
changeset
|
788 chan = (u_short)va_arg(ap, u_int); |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
789 userinfo = va_arg(ap, struct aim_userinfo_s *); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
790 nummissed = (u_short)va_arg(ap, u_int); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
791 reason = (u_short)va_arg(ap, u_int); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
792 va_end(ap); |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
793 |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
794 switch(reason) { |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
795 case 1: |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
796 /* message too large */ |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
797 sprintf(buf, _("You missed a message from %s because it was too large."), userinfo->sn); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
798 do_error_dialog(buf, _("Gaim - Error")); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
799 plugin_event(event_error, (void *)961, 0, 0); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
800 break; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
801 default: |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
802 sprintf(buf, _("You missed a message from %s for unknown reasons."), userinfo->sn); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
803 do_error_dialog(buf, _("Gaim - Error")); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
804 plugin_event(event_error, (void *)970, 0, 0); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
805 break; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
806 } |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
807 |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
808 return 1; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
809 } |
709
957957d0dc2c
[gaim-migrate @ 719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
704
diff
changeset
|
810 |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
811 int gaim_parse_msgerr(struct aim_session_t *sess, |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
812 struct command_rx_struct *command, ...) { |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
813 va_list ap; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
814 char *destn; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
815 u_short reason; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
816 char buf[1024]; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
817 |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
818 va_start(ap, command); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
819 destn = va_arg(ap, char *); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
820 reason = (u_short)va_arg(ap, u_int); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
821 va_end(ap); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
822 |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
823 sprintf(buf, _("Your message to %s did not get sent: %s"), destn, |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
824 (reason < msgerrreasonlen) ? msgerrreason[reason] : _("Reason unknown")); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
825 do_error_dialog(buf, _("Gaim - Error")); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
826 |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
827 return 1; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
828 } |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
829 |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
830 int gaim_parse_locerr(struct aim_session_t *sess, |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
831 struct command_rx_struct *command, ...) { |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
832 va_list ap; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
833 char *destn; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
834 u_short reason; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
835 char buf[1024]; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
836 |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
837 va_start(ap, command); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
838 destn = va_arg(ap, char *); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
839 reason = (u_short)va_arg(ap, u_int); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
840 va_end(ap); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
841 |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
842 sprintf(buf, _("User information for %s unavailable: %s"), destn, |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
843 (reason < msgerrreasonlen) ? msgerrreason[reason] : _("Reason unknown")); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
844 do_error_dialog(buf, _("Gaim - Error")); |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
845 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
846 return 1; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
847 } |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
848 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
849 int gaim_parse_user_info(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
850 struct command_rx_struct *command, ...) { |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
851 struct aim_userinfo_s *info; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
852 char *prof_enc = NULL, *prof = NULL; |
249
810c595258c8
[gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
248
diff
changeset
|
853 u_short infotype; |
247
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
854 char buf[BUF_LONG]; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
855 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess); |
247
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
856 va_list ap; |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
857 |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
858 va_start(ap, command); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
859 info = va_arg(ap, struct aim_userinfo_s *); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
860 prof_enc = va_arg(ap, char *); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
861 prof = va_arg(ap, char *); |
464 | 862 infotype = (u_short)va_arg(ap, u_int); |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
863 va_end(ap); |
247
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
864 |
249
810c595258c8
[gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
248
diff
changeset
|
865 if (prof == NULL || !strlen(prof)) { |
392
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
388
diff
changeset
|
866 /* no info/away message */ |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
867 char buf[1024]; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
868 sprintf(buf, _("%s has no info/away message."), info->sn); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
869 do_error_dialog(buf, _("Gaim - Error")); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
870 plugin_event(event_error, (void *)977, 0, 0); |
249
810c595258c8
[gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
248
diff
changeset
|
871 return 1; |
810c595258c8
[gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
248
diff
changeset
|
872 } |
810c595258c8
[gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
248
diff
changeset
|
873 |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
874 snprintf(buf, sizeof buf, _("Username : <B>%s</B>\n<BR>" |
247
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
875 "Warning Level : <B>%d %%</B>\n<BR>" |
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
876 "Online Since : <B>%s</B><BR>" |
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
877 "Idle Minutes : <B>%d</B>\n<BR><HR><BR>" |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
878 "%s\n"), |
247
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
879 info->sn, |
601
e670cdb5fb2f
[gaim-migrate @ 611]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
592
diff
changeset
|
880 info->warnlevel/10, |
247
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
881 asctime(localtime(&info->onlinesince)), |
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
882 info->idletime, |
592
7c75d69a1129
[gaim-migrate @ 602]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
535
diff
changeset
|
883 infotype == AIM_GETINFO_GENERALINFO ? prof : |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
884 away_subs(prof, gc->username)); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
885 g_show_info_text(away_subs(buf, gc->username)); |
247
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
886 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
887 return 1; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
888 } |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
889 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
890 int gaim_parse_motd(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
891 struct command_rx_struct *command, ...) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
892 char *msg; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
893 u_short id; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
894 va_list ap; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
895 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
896 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
897 va_start(ap, command); |
464 | 898 id = (u_short)va_arg(ap, u_int); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
899 msg = va_arg(ap, char *); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
900 va_end(ap); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
901 |
771
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
902 sprintf(debug_buff, "MOTD: %s (%d)\n", msg, id); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
903 debug_print(debug_buff); |
282
918db59d3814
[gaim-migrate @ 292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
279
diff
changeset
|
904 sprintf(debug_buff, "Gaim %s / Libfaim %s\n", |
918db59d3814
[gaim-migrate @ 292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
279
diff
changeset
|
905 VERSION, aim_getbuildstring()); |
918db59d3814
[gaim-migrate @ 292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
279
diff
changeset
|
906 debug_print(debug_buff); |
771
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
907 if (id != 4) |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
908 do_error_dialog(_("Your connection may be lost."), |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
909 _("AOL error")); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
910 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
911 if (gc->keepalive < 0) |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
912 update_keepalive(gc, gc->keepalive); |
891
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
857
diff
changeset
|
913 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
914 return 1; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
915 } |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
916 |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
917 int gaim_chatnav_info(struct aim_session_t *sess, |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
918 struct command_rx_struct *command, ...) { |
445
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
423
diff
changeset
|
919 va_list ap; |
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
423
diff
changeset
|
920 u_short type; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
921 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess); |
445
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
423
diff
changeset
|
922 |
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
423
diff
changeset
|
923 va_start(ap, command); |
464 | 924 type = (u_short)va_arg(ap, u_int); |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
925 |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
926 switch(type) { |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
927 case 0x0002: { |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
928 int maxrooms; |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
929 struct aim_chat_exchangeinfo *exchanges; |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
930 int exchangecount, i = 0; |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
931 |
466 | 932 maxrooms = (u_char)va_arg(ap, u_int); |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
933 exchangecount = va_arg(ap, int); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
934 exchanges = va_arg(ap, struct aim_chat_exchangeinfo *); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
935 va_end(ap); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
936 |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
937 debug_print("chat info: Chat Rights:\n"); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
938 sprintf(debug_buff, "chat info: \tMax Concurrent Rooms: %d\n", maxrooms); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
939 debug_print(debug_buff); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
940 sprintf(debug_buff, "chat info: \tExchange List: (%d total)\n", exchangecount); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
941 debug_print(debug_buff); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
942 while (i < exchangecount) { |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
943 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
|
944 exchanges[i].number, |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
945 exchanges[i].name, |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
946 exchanges[i].charset1, |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
947 exchanges[i].lang1); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
948 debug_print(debug_buff); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
949 i++; |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
950 } |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
951 if (gc->create_exchange) { |
904
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
952 sprintf(debug_buff, "creating room %s\n", |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
953 gc->create_name); |
904
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
954 debug_print(debug_buff); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
955 aim_chatnav_createroom(sess, command->conn, gc->create_name, gc->create_exchange); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
956 gc->create_exchange = 0; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
957 g_free(gc->create_name); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
958 gc->create_name = NULL; |
904
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
959 } |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
960 } |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
961 break; |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
962 case 0x0008: { |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
963 char *fqcn, *name, *ck; |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
964 u_short instance, flags, maxmsglen, maxoccupancy, unknown; |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
965 unsigned char createperms; |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
966 unsigned long createtime; |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
967 |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
968 fqcn = va_arg(ap, char *); |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
969 instance = (u_short)va_arg(ap, u_int); |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
970 flags = (u_short)va_arg(ap, u_int); |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
971 createtime = va_arg(ap, unsigned long); |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
972 maxmsglen = (u_short)va_arg(ap, u_int); |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
973 maxoccupancy = (u_short)va_arg(ap, u_int); |
906
7b976e5e1c3a
[gaim-migrate @ 916]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
905
diff
changeset
|
974 createperms = (unsigned char)va_arg(ap, int); |
904
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
975 unknown = (u_short)va_arg(ap, u_int); |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
976 name = va_arg(ap, char *); |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
977 ck = va_arg(ap, char *); |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
978 va_end(ap); |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
979 |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
980 sprintf(debug_buff, "created room: %s %d %d %lu %d %d %d %d %s %s\n", fqcn, instance, flags, createtime, maxmsglen, maxoccupancy, createperms, unknown, name, ck); |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
981 debug_print(debug_buff); |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
982 if (flags & 0x4) { |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
983 sprintf(debug_buff, "joining %s on exchange 5\n", name); |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
984 debug_print(debug_buff); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
985 aim_chat_join(gc->oscar_sess, gc->oscar_conn, 5, ck); |
904
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
986 } else |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
987 sprintf(debug_buff, "joining %s on exchange 4\n", name);{ |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
988 debug_print(debug_buff); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
989 aim_chat_join(gc->oscar_sess, gc->oscar_conn, 4, ck); |
904
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
990 } |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
991 } |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
992 break; |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
993 default: |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
994 va_end(ap); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
995 sprintf(debug_buff, "chatnav info: unknown type (%04x)\n", type); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
996 debug_print(debug_buff); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
997 break; |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
998 } |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
999 return 1; |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
1000 } |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1001 |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1002 int gaim_chat_join(struct aim_session_t *sess, |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1003 struct command_rx_struct *command, ...) { |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1004 va_list ap; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1005 int count, i = 0; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1006 struct aim_userinfo_s *info; |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
1007 struct gaim_connection *g = find_gaim_conn_by_aim_sess(sess); |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1008 |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
1009 GSList *bcs = g->buddy_chats; |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
466
diff
changeset
|
1010 struct conversation *b = NULL; |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1011 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1012 va_start(ap, command); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1013 count = va_arg(ap, int); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1014 info = va_arg(ap, struct aim_userinfo_s *); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1015 va_end(ap); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1016 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1017 while(bcs) { |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
466
diff
changeset
|
1018 b = (struct conversation *)bcs->data; |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1019 if (!strcasecmp(b->name, (char *)command->conn->priv)) |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1020 break; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1021 bcs = bcs->next; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1022 b = NULL; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1023 } |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1024 if (!b) |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1025 return 1; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1026 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1027 while (i < count) |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1028 add_chat_buddy(b, info[i++].sn); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1029 |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1030 return 1; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1031 } |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1032 |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1033 int gaim_chat_leave(struct aim_session_t *sess, |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1034 struct command_rx_struct *command, ...) { |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1035 va_list ap; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1036 int count, i = 0; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1037 struct aim_userinfo_s *info; |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
1038 struct gaim_connection *g = find_gaim_conn_by_aim_sess(sess); |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1039 |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
1040 GSList *bcs = g->buddy_chats; |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
466
diff
changeset
|
1041 struct conversation *b = NULL; |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1042 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1043 va_start(ap, command); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1044 count = va_arg(ap, int); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1045 info = va_arg(ap, struct aim_userinfo_s *); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1046 va_end(ap); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1047 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1048 while(bcs) { |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
466
diff
changeset
|
1049 b = (struct conversation *)bcs->data; |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1050 if (!strcasecmp(b->name, (char *)command->conn->priv)) |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1051 break; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1052 bcs = bcs->next; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1053 b = NULL; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1054 } |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1055 if (!b) |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1056 return 1; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1057 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1058 while (i < count) |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1059 remove_chat_buddy(b, info[i++].sn); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1060 |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1061 return 1; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1062 } |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1063 |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1064 int gaim_chat_info_update(struct aim_session_t *sess, |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1065 struct command_rx_struct *command, ...) { |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1066 debug_print("inside chat_info_update\n"); |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1067 return 1; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1068 } |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1069 |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1070 int gaim_chat_incoming_msg(struct aim_session_t *sess, |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1071 struct command_rx_struct *command, ...) { |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1072 va_list ap; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1073 struct aim_userinfo_s *info; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1074 char *msg; |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
1075 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess); |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1076 |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
1077 GSList *bcs = gc->buddy_chats; |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
466
diff
changeset
|
1078 struct conversation *b = NULL; |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1079 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1080 va_start(ap, command); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1081 info = va_arg(ap, struct aim_userinfo_s *); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1082 msg = va_arg(ap, char *); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1083 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1084 while(bcs) { |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
466
diff
changeset
|
1085 b = (struct conversation *)bcs->data; |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1086 if (!strcasecmp(b->name, (char *)command->conn->priv)) |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1087 break; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1088 bcs = bcs->next; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1089 b = NULL; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1090 } |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1091 if (!b) |
270
cfa39d39dec6
[gaim-migrate @ 280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
267
diff
changeset
|
1092 return 0; |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1093 |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
1094 serv_got_chat_in(gc, b->id, info->sn, 0, msg); |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1095 |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1096 return 1; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1097 } |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1098 |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1099 /* |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1100 * 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
|
1101 */ |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1102 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
|
1103 va_list ap; |
505
3bd51b3f07c3
[gaim-migrate @ 515]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
503
diff
changeset
|
1104 u_short type; |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1105 char *sn = NULL; |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1106 |
505
3bd51b3f07c3
[gaim-migrate @ 515]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
503
diff
changeset
|
1107 va_start(ap, command); |
3bd51b3f07c3
[gaim-migrate @ 515]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
503
diff
changeset
|
1108 type = (u_short)va_arg(ap, u_int); |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1109 sn = va_arg(ap, char *); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1110 va_end(ap); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1111 |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1112 sprintf(debug_buff, "Sent message to %s.\n", sn); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1113 debug_print(debug_buff); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1114 |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1115 return 1; |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1116 } |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1117 |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1118 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
|
1119 va_list ap; |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1120 unsigned long newrate; |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1121 |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1122 va_start(ap, command); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1123 newrate = va_arg(ap, unsigned long); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1124 va_end(ap); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1125 |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1126 sprintf(debug_buff, "ratechange: %lu\n", newrate); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1127 debug_print(debug_buff); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1128 |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1129 return 1; |
840
595ac7759563
[gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
838
diff
changeset
|
1130 } |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1131 |
771
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1132 int gaim_parse_evilnotify(struct aim_session_t *sess, struct command_rx_struct *command, ...) { |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1133 va_list ap; |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1134 char *sn; |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1135 |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1136 va_start(ap, command); |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1137 sn = va_arg(ap, char *); |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1138 va_end(ap); |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1139 |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1140 serv_got_eviled(sn, 0); |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1141 |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1142 return 1; |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1143 } |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1144 |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1145 int gaim_rateresp(struct aim_session_t *sess, struct command_rx_struct *command, ...) { |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
1146 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess); |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1147 switch (command->conn->type) { |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1148 case AIM_CONN_TYPE_BOS: |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1149 aim_bos_ackrateresp(sess, command->conn); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1150 aim_bos_reqpersonalinfo(sess, command->conn); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1151 aim_bos_reqlocaterights(sess, command->conn); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
1152 aim_bos_setprofile(sess, command->conn, gc->user_info, NULL, gaim_caps); |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1153 aim_bos_reqbuddyrights(sess, command->conn); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1154 |
966
f7886476f9d9
[gaim-migrate @ 976]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
965
diff
changeset
|
1155 if (mainwindow) |
f7886476f9d9
[gaim-migrate @ 976]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
965
diff
changeset
|
1156 gtk_widget_hide(mainwindow); |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1157 show_buddy_list(); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1158 |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1159 #ifdef USE_APPLET |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1160 if (general_options & OPT_GEN_APP_BUDDY_SHOW) { |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1161 refresh_buddy_window(); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1162 createOnlinePopup(); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1163 applet_buddy_show = TRUE; |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1164 } else { |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1165 gtk_widget_hide(blist); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1166 applet_buddy_show = FALSE; |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1167 } |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1168 set_user_state(online); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1169 #else |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1170 refresh_buddy_window(); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1171 #endif |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1172 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
1173 serv_finish_login(gc); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
1174 gaim_setup(gc); |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1175 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
1176 if (bud_list_cache_exists(gc)) |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
1177 do_import(NULL, gc); |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1178 |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1179 debug_print("buddy list loaded\n"); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1180 |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1181 setup_buddy_chats(); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1182 |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1183 aim_addicbmparam(sess, command->conn); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1184 aim_bos_reqicbmparaminfo(sess, command->conn); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1185 |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1186 aim_bos_reqrights(sess, command->conn); |
900
e18815f5a4e9
[gaim-migrate @ 910]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
1187 aim_bos_setgroupperm(sess, command->conn, AIM_FLAG_ALLUSERS); |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1188 aim_bos_setprivacyflags(sess, command->conn, AIM_PRIVFLAGS_ALLOWIDLE | |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1189 AIM_PRIVFLAGS_ALLOWMEMBERSINCE); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1190 |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1191 break; |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1192 default: |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1193 sprintf(debug_buff, "got rate response for unhandled connection type %04x\n", |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1194 command->conn->type); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1195 debug_print(debug_buff); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1196 break; |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1197 } |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1198 |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1199 return 1; |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1200 } |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1201 |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1202 int gaim_reportinterval(struct aim_session_t *sess, struct command_rx_struct *command, ...) { |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1203 if (command->data) { |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1204 sprintf(debug_buff, "minimum report interval: %d (seconds?)\n", aimutil_get16(command->data+10)); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1205 debug_print(debug_buff); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1206 } else |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1207 debug_print("NULL minimum report interval!\n"); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1208 return 1; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1209 } |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1210 |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1211 int gaim_parse_buddyrights(struct aim_session_t *sess, struct command_rx_struct *command, ...) { |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1212 va_list ap; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1213 u_short maxbuddies, maxwatchers; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1214 |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1215 va_start(ap, command); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1216 maxbuddies = (u_short)va_arg(ap, u_int); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1217 maxwatchers = (u_short)va_arg(ap, u_int); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1218 va_end(ap); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1219 |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1220 sprintf(debug_buff, "buddy list rights: Max buddies = %d / Max watchers = %d\n", maxbuddies, maxwatchers); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1221 debug_print(debug_buff); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1222 |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1223 return 1; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1224 } |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1225 |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1226 int gaim_bosrights(struct aim_session_t *sess, struct command_rx_struct *command, ...) { |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1227 u_short maxpermits, maxdenies; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1228 va_list ap; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1229 |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1230 va_start(ap, command); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1231 maxpermits = (u_short)va_arg(ap, u_int); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1232 maxdenies = (u_short)va_arg(ap, u_int); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1233 va_end(ap); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1234 |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1235 sprintf(debug_buff, "BOS rights: Max permit = %d / Max deny = %d\n", maxpermits, maxdenies); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1236 debug_print(debug_buff); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1237 |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1238 aim_bos_clientready(sess, command->conn); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1239 |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1240 aim_bos_reqservice(sess, command->conn, AIM_CONN_TYPE_CHATNAV); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1241 |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1242 return 1; |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1243 } |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1244 |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1245 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
|
1246 va_list ap; |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1247 char *sn = NULL, *msg = NULL; |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1248 struct aim_conn_t *conn; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
1249 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess); |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1250 |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1251 va_start(ap, command); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1252 conn = va_arg(ap, struct aim_conn_t *); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1253 sn = va_arg(ap, char *); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1254 msg = va_arg(ap, char *); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1255 va_end(ap); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1256 |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1257 sprintf(debug_buff, "Got DirectIM message from %s\n", sn); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1258 debug_print(debug_buff); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1259 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
1260 serv_got_im(gc, sn, msg, 0); |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1261 |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1262 return 1; |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1263 } |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1264 |
515
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1265 /* this is such a f*cked up function */ |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1266 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
|
1267 va_list ap; |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1268 struct aim_directim_priv *priv; |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1269 struct aim_conn_t *newconn; |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1270 struct conversation *cnv; |
517
dd4d415dbe52
[gaim-migrate @ 527]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
516
diff
changeset
|
1271 int watcher; |
515
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1272 |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1273 va_start(ap, command); |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1274 newconn = va_arg(ap, struct aim_conn_t *); |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1275 va_end(ap); |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1276 |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1277 priv = (struct aim_directim_priv *)newconn->priv; |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1278 |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1279 sprintf(debug_buff, "DirectIM: initiate success to %s\n", priv->sn); |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1280 debug_print(debug_buff); |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1281 |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1282 cnv = find_conversation(priv->sn); |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1283 gdk_input_remove(cnv->watcher); |
517
dd4d415dbe52
[gaim-migrate @ 527]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
516
diff
changeset
|
1284 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
|
1285 oscar_callback, newconn); |
517
dd4d415dbe52
[gaim-migrate @ 527]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
516
diff
changeset
|
1286 make_direct(cnv, TRUE, newconn, watcher); |
515
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1287 |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1288 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
|
1289 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
|
1290 |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1291 return 1; |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1292 } |
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1293 |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1294 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
|
1295 va_list ap; |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1296 char *sn; |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1297 |
512
7922abb3262d
[gaim-migrate @ 522]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
511
diff
changeset
|
1298 va_start(ap, command); |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1299 sn = va_arg(ap, char *); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1300 va_end(ap); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1301 |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1302 /* 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
|
1303 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
|
1304 debug_print(debug_buff); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1305 |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1306 return 1; |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1307 } |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1308 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
1309 void oscar_do_directim(struct gaim_connection *gc, char *name) { |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
1310 struct aim_conn_t *newconn = aim_directim_initiate(gc->oscar_sess, gc->oscar_conn, NULL, name); |
515
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
1311 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
|
1312 cnv->conn = newconn; |
dd4d415dbe52
[gaim-migrate @ 527]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
516
diff
changeset
|
1313 cnv->watcher = gdk_input_add(newconn->fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION, oscar_callback, newconn); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
1314 aim_conn_addhandler(gc->oscar_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
|
1315 } |
891
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
857
diff
changeset
|
1316 |
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
857
diff
changeset
|
1317 void send_keepalive(gpointer d) { |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
1318 struct gaim_connection *gc = (struct gaim_connection *)d; |
891
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
857
diff
changeset
|
1319 debug_print("sending oscar NOP\n"); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
1320 if (gc->protocol == PROTO_OSCAR) { /* keeping it open for TOC */ |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
1321 aim_flap_nop(gc->oscar_sess, gc->oscar_conn); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
1322 } else if (gc->protocol == PROTO_TOC) { |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
1323 sflap_send(gc, "", 0, TYPE_KEEPALIVE); |
891
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
857
diff
changeset
|
1324 } |
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
857
diff
changeset
|
1325 } |
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
857
diff
changeset
|
1326 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
1327 void update_keepalive(struct gaim_connection *gc, gboolean on) { |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
1328 if (on && gc->keepalive < 0 && blist) { |
891
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
857
diff
changeset
|
1329 debug_print("allowing NOP\n"); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
1330 gc->keepalive = gtk_timeout_add(60000, (GtkFunction)send_keepalive, gc); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
1331 } else if (!on && gc->keepalive > -1) { |
891
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
857
diff
changeset
|
1332 debug_print("removing NOP\n"); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
1333 gtk_timeout_remove(gc->keepalive); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
1334 gc->keepalive = -1; |
891
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
857
diff
changeset
|
1335 } |
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
857
diff
changeset
|
1336 } |