Mercurial > pidgin
annotate src/toc.c @ 1088:18a14e6dd0af
[gaim-migrate @ 1098]
more fixes for proxy stuff
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Mon, 13 Nov 2000 00:37:02 +0000 |
parents | 56c7ceb986a8 |
children | f0f5c10cce63 |
rev | line source |
---|---|
1 | 1 /* |
2 * gaim | |
3 * | |
4 * Copyright (C) 1998-1999, Mark Spencer <markster@marko.net> | |
5 * | |
6 * This program is free software; you can redistribute it and/or modify | |
7 * it under the terms of the GNU General Public License as published by | |
8 * the Free Software Foundation; either version 2 of the License, or | |
9 * (at your option) any later version. | |
10 * | |
11 * This program is distributed in the hope that it will be useful, | |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 * GNU General Public License for more details. | |
15 * | |
16 * You should have received a copy of the GNU General Public License | |
17 * along with this program; if not, write to the Free Software | |
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
19 * | |
20 */ | |
21 | |
22 | |
23 | |
349
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
333
diff
changeset
|
24 #ifdef HAVE_CONFIG_H |
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
333
diff
changeset
|
25 #include "../config.h" |
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
333
diff
changeset
|
26 #endif |
1 | 27 #include <netdb.h> |
28 #include <gtk/gtk.h> | |
29 #include <unistd.h> | |
30 #include <errno.h> | |
31 #include <netinet/in.h> | |
32 #include <arpa/inet.h> | |
33 #include <string.h> | |
34 #include <stdlib.h> | |
35 #include <stdio.h> | |
36 #include <time.h> | |
37 #include <sys/socket.h> | |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
38 #include "prpl.h" |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
39 #include "multi.h" |
1 | 40 #include "gaim.h" |
41 #include "gnome_applet_mgr.h" | |
1087
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
42 #include "proxy.h" |
1 | 43 |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
44 #include "pixmaps/admin_icon.xpm" |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
45 #include "pixmaps/aol_icon.xpm" |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
46 #include "pixmaps/away_icon.xpm" |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
47 #include "pixmaps/dt_icon.xpm" |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
48 #include "pixmaps/free_icon.xpm" |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
49 |
1088
18a14e6dd0af
[gaim-migrate @ 1098]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1087
diff
changeset
|
50 #define REVISION "gaim:$Revision: 1098 $" |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
51 |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
52 struct toc_data { |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
53 int toc_fd; |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
54 int seqno; |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
55 int state; |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
56 }; |
1 | 57 |
58 | |
59 static unsigned int peer_ver=0; | |
60 #ifdef _WIN32 | |
61 static int win32_r; | |
62 #endif | |
63 | |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
64 static int toc_signon(struct gaim_connection *); |
1 | 65 |
1087
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
66 /* constants to identify proto_opts */ |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
67 #define USEROPT_AUTH 0 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
68 #define USEROPT_AUTHPORT 1 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
69 #define USEROPT_SOCKSHOST 2 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
70 #define USEROPT_SOCKSPORT 3 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
71 #define USEROPT_PROXYTYPE 4 |
1 | 72 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
73 /* ok. this function used to take username/password, and return 0 on success. |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
74 * now, it takes username/password, and returns NULL on error or a new gaim_connection |
976
2586b2a3725e
[gaim-migrate @ 986]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
975
diff
changeset
|
75 * on success. */ |
980
82c5865f7cfe
[gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
978
diff
changeset
|
76 void toc_login(struct aim_user *user) |
1 | 77 { |
78 char *config; | |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
79 struct gaim_connection *gc; |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
80 struct toc_data *tdt; |
1 | 81 char buf[80]; |
82 char buf2[2048]; | |
83 | |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
84 gc = new_gaim_conn(PROTO_TOC, user->username, user->password); |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
85 gc->proto_data = tdt = g_new0(struct toc_data, 1); |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
86 |
1088
18a14e6dd0af
[gaim-migrate @ 1098]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1087
diff
changeset
|
87 g_snprintf(buf, sizeof(buf), "Looking up %s", |
18a14e6dd0af
[gaim-migrate @ 1098]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1087
diff
changeset
|
88 user->proto_opt[USEROPT_AUTH][0] ? user->proto_opt[USEROPT_AUTH] : TOC_HOST); |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
89 set_login_progress(gc, 1, buf); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
90 while (gtk_events_pending()) |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
91 gtk_main_iteration(); |
1 | 92 |
1087
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
93 tdt->toc_fd = proxy_connect( |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
94 user->proto_opt[USEROPT_AUTH][0] ? user->proto_opt[USEROPT_AUTH] : TOC_HOST, |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
95 user->proto_opt[USEROPT_AUTHPORT][0] ? atoi(user->proto_opt[USEROPT_AUTHPORT]) : TOC_PORT, |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
96 user->proto_opt[USEROPT_SOCKSHOST], atoi(user->proto_opt[USEROPT_SOCKSPORT]), |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
97 atoi(user->proto_opt[USEROPT_PROXYTYPE])); |
1 | 98 |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
99 if (tdt->toc_fd < 0) { |
1 | 100 g_snprintf(buf, sizeof(buf), "Connect to %s failed", |
1087
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
101 user->proto_opt[USEROPT_AUTH]); |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
102 hide_login_progress(gc, buf); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
103 destroy_gaim_conn(gc); |
980
82c5865f7cfe
[gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
978
diff
changeset
|
104 return; |
1 | 105 } |
106 | |
980
82c5865f7cfe
[gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
978
diff
changeset
|
107 g_snprintf(buf, sizeof(buf), "Signon: %s", gc->username); |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
108 set_login_progress(gc, 3, buf); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
109 while (gtk_events_pending()) |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
110 gtk_main_iteration(); |
1 | 111 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
112 if (toc_signon(gc) < 0) { |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
113 hide_login_progress(gc, "Disconnected."); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
114 destroy_gaim_conn(gc); |
980
82c5865f7cfe
[gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
978
diff
changeset
|
115 return; |
1 | 116 } |
117 | |
118 g_snprintf(buf, sizeof(buf), "Waiting for reply..."); | |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
119 set_login_progress(gc, 4, buf); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
120 while (gtk_events_pending()) |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
121 gtk_main_iteration(); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
122 if (toc_wait_signon(gc) < 0) { |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
123 hide_login_progress(gc, "Authentication Failed"); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
124 destroy_gaim_conn(gc); |
980
82c5865f7cfe
[gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
978
diff
changeset
|
125 return; |
1 | 126 } |
127 | |
980
82c5865f7cfe
[gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
978
diff
changeset
|
128 gc->options = user->options; |
1 | 129 save_prefs(); |
130 | |
131 g_snprintf(buf, sizeof(buf), "Retrieving config..."); | |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
132 set_login_progress(gc, 5, buf); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
133 while (gtk_events_pending()) |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
134 gtk_main_iteration(); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
135 |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
136 account_online(user, gc); |
1002
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1000
diff
changeset
|
137 serv_finish_login(gc); |
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1000
diff
changeset
|
138 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
139 config = toc_wait_config(gc); |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
140 tdt->state = STATE_ONLINE; |
1 | 141 |
300
b32c83750104
[gaim-migrate @ 310]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
296
diff
changeset
|
142 if (config != NULL) |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
143 parse_toc_buddy_list(gc, config, 0); |
300
b32c83750104
[gaim-migrate @ 310]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
296
diff
changeset
|
144 else |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
145 do_import(0, gc); |
1 | 146 |
147 g_snprintf(buf2, sizeof(buf2), "toc_init_done"); | |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
148 sflap_send(gc, buf2, -1, TYPE_DATA); |
1 | 149 |
211
2042a38da38b
[gaim-migrate @ 221]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
208
diff
changeset
|
150 g_snprintf(buf2, sizeof(buf2), "toc_set_caps %s %s %s %s %s", |
2042a38da38b
[gaim-migrate @ 221]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
208
diff
changeset
|
151 FILE_SEND_UID, FILE_GET_UID, B_ICON_UID, IMAGE_UID, |
2042a38da38b
[gaim-migrate @ 221]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
208
diff
changeset
|
152 VOICE_UID); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
153 sflap_send(gc, buf2, -1, TYPE_DATA); |
149 | 154 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
155 if (gc->keepalive < 0) |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
156 update_keepalive(gc, gc->options & OPT_USR_KEEPALV); |
1 | 157 } |
158 | |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
159 void toc_close(struct gaim_connection *gc) |
1 | 160 { |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
161 if (gc->protocol != PROTO_TOC) return; /* how did this happen? */ |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
162 if (gc->inpa > 0) |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
163 gdk_input_remove(gc->inpa); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
164 gc->inpa = -1; |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
165 close(((struct toc_data *)gc->proto_data)->toc_fd); |
1 | 166 } |
167 | |
168 unsigned char *roast_password(char *pass) | |
169 { | |
170 /* Trivial "encryption" */ | |
171 static char rp[256]; | |
172 static char *roast = ROAST; | |
173 int pos=2; | |
174 int x; | |
175 strcpy(rp, "0x"); | |
176 for (x=0;(x<150) && pass[x]; x++) | |
177 pos+=sprintf(&rp[pos],"%02x", pass[x] ^ roast[x % strlen(roast)]); | |
178 rp[pos]='\0'; | |
179 return rp; | |
180 } | |
181 | |
182 | |
183 char *print_header(void *hdr_v) | |
184 { | |
185 static char s[80]; | |
186 struct sflap_hdr *hdr = (struct sflap_hdr *)hdr_v; | |
187 g_snprintf(s,sizeof(s), "[ ast: %c, type: %d, seqno: %d, len: %d ]", | |
188 hdr->ast, hdr->type, ntohs(hdr->seqno), ntohs(hdr->len)); | |
189 return s; | |
190 } | |
191 | |
192 void print_buffer(char *buf, int len) | |
193 { | |
194 #if 0 | |
195 int x; | |
196 printf("[ "); | |
197 for (x=0;x<len;x++) | |
198 printf("%d ", buf[x]); | |
199 printf("]\n"); | |
200 printf("[ "); | |
201 for (x=0;x<len;x++) | |
202 printf("%c ", buf[x]); | |
203 printf("]\n"); | |
204 #endif | |
205 } | |
206 | |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
207 int sflap_send(struct gaim_connection *gc, char *buf, int olen, int type) |
1 | 208 { |
209 int len; | |
210 int slen=0; | |
211 struct sflap_hdr hdr; | |
212 char obuf[MSG_LEN]; | |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
213 struct toc_data *tdt = (struct toc_data *)gc->proto_data; |
1 | 214 |
970 | 215 /* One _last_ 2048 check here! This shouldn't ever |
216 * get hit though, hopefully. If it gets hit on an IM | |
217 * It'll lose the last " and the message won't go through, | |
218 * but this'll stop a segfault. */ | |
219 if (strlen(buf) > (MSG_LEN - sizeof(hdr))) { | |
220 buf[MSG_LEN - sizeof(hdr) - 3] = '"'; | |
221 buf[MSG_LEN - sizeof(hdr) - 2] = '\0'; | |
222 } | |
1 | 223 |
970 | 224 debug_printf("%s [Len %d]\n", buf, strlen(buf)); |
1 | 225 |
226 if (olen < 0) | |
227 len = escape_message(buf); | |
228 else | |
229 len = olen; | |
230 hdr.ast = '*'; | |
231 hdr.type = type; | |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
232 hdr.seqno = htons(tdt->seqno++ & 0xffff); |
1 | 233 hdr.len = htons(len + (type == TYPE_SIGNON ? 0 : 1)); |
234 | |
235 sprintf(debug_buff,"Escaped message is '%s'\n",buf); | |
236 debug_print(debug_buff); | |
237 | |
238 memcpy(obuf, &hdr, sizeof(hdr)); | |
239 slen += sizeof(hdr); | |
240 memcpy(&obuf[slen], buf, len); | |
241 slen += len; | |
242 if (type != TYPE_SIGNON) { | |
243 obuf[slen]='\0'; | |
244 slen += 1; | |
245 } | |
246 print_buffer(obuf, slen); | |
247 | |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
248 return write(tdt->toc_fd, obuf, slen); |
1 | 249 } |
250 | |
251 | |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
252 static int wait_reply(struct gaim_connection *gc, char *buffer, size_t buflen) |
1 | 253 { |
79 | 254 size_t res=-1; |
255 int read_rv = -1; | |
1 | 256 struct sflap_hdr *hdr=(struct sflap_hdr *)buffer; |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
257 struct toc_data *tdt = (struct toc_data *)gc->proto_data; |
1 | 258 char *c; |
259 | |
79 | 260 if(buflen < sizeof(struct sflap_hdr)) { |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
261 do_error_dialog(_("Unable to read from server: Buffer too small"), |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
262 _("Gaim - Error (internal)")); |
79 | 263 return -1; |
264 } | |
265 | |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
266 while((read_rv = read(tdt->toc_fd, buffer, 1))) { |
79 | 267 if (read_rv < 0 || read_rv > 1) |
268 return -1; | |
1 | 269 if (buffer[0] == '*') |
270 break; | |
271 | |
272 } | |
273 | |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
274 read_rv = read(tdt->toc_fd, buffer+1, sizeof(struct sflap_hdr) - 1); |
1 | 275 |
79 | 276 if (read_rv < 0) |
277 return read_rv; | |
1 | 278 |
79 | 279 res = read_rv + 1; |
1 | 280 |
281 | |
282 sprintf(debug_buff, "Rcv: %s %s\n",print_header(buffer), ""); | |
283 debug_print(debug_buff); | |
284 | |
285 | |
79 | 286 if(buflen < sizeof(struct sflap_hdr) + ntohs(hdr->len) + 1) { |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
287 do_error_dialog(_("Unable to read from server: Too much information"), |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
288 _("Gaim - Error (internal)")); |
79 | 289 return -1; |
290 } | |
1 | 291 |
292 while (res < (sizeof(struct sflap_hdr) + ntohs(hdr->len))) { | |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
293 read_rv = read(tdt->toc_fd, buffer + res, (ntohs(hdr->len) + sizeof(struct sflap_hdr)) - res); |
79 | 294 if(read_rv < 0) return read_rv; |
295 res += read_rv; | |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
296 /* my feeling is this will kill us. if there's data pending then we'll come right back |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
297 * to where we are now. possible workarounds are to remove the input watcher until |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
298 * we're done with this part |
1 | 299 while(gtk_events_pending()) |
300 gtk_main_iteration(); | |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
301 */ |
1 | 302 } |
303 | |
304 if (res >= sizeof(struct sflap_hdr)) | |
305 buffer[res]='\0'; | |
306 else | |
307 return res - sizeof(struct sflap_hdr); | |
308 | |
309 switch(hdr->type) { | |
310 case TYPE_SIGNON: | |
311 memcpy(&peer_ver, buffer + sizeof(struct sflap_hdr), 4); | |
312 peer_ver = ntohl(peer_ver); | |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
313 tdt->seqno = ntohs(hdr->seqno); |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
314 tdt->state = STATE_SIGNON_REQUEST; |
1 | 315 break; |
316 case TYPE_DATA: | |
317 if (!strncasecmp(buffer + sizeof(struct sflap_hdr), "SIGN_ON:", strlen("SIGN_ON:"))) | |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
318 tdt->state = STATE_SIGNON_ACK; |
1 | 319 else if (!strncasecmp(buffer + sizeof(struct sflap_hdr), "CONFIG:", strlen("CONFIG:"))) { |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
320 tdt->state = STATE_CONFIG; |
301
f905caee43ca
[gaim-migrate @ 311]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
300
diff
changeset
|
321 } else if (!strncasecmp(buffer + sizeof(struct sflap_hdr), "ERROR:", strlen("ERROR:"))) { |
1 | 322 c = strtok(buffer + sizeof(struct sflap_hdr) + strlen("ERROR:"), ":"); |
323 show_error_dialog(c); | |
324 } | |
325 | |
326 sprintf(debug_buff, "Data: %s\n",buffer + sizeof(struct sflap_hdr)); | |
327 debug_print(debug_buff); | |
328 | |
329 break; | |
330 default: | |
331 sprintf(debug_buff, "Unknown/unimplemented packet type %d\n",hdr->type); | |
332 debug_print(debug_buff); | |
333 } | |
334 return res; | |
335 } | |
336 | |
337 | |
338 | |
339 void toc_callback( gpointer data, | |
340 gint source, | |
341 GdkInputCondition condition ) | |
342 { | |
343 char *buf; | |
344 char *c; | |
345 char *l; | |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
346 struct gaim_connection *gc = (struct gaim_connection *)data; |
1 | 347 |
866
646acb9e9c38
[gaim-migrate @ 876]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
863
diff
changeset
|
348 buf = g_malloc(2 * BUF_LONG); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
349 if (wait_reply(gc, buf, 2 * BUF_LONG) < 0) { |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
350 hide_login_progress(gc, "Connection Closed"); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
351 signoff(gc); /* this will free gc for us */ |
1 | 352 g_free(buf); |
353 return; | |
354 } | |
355 | |
356 | |
357 c=strtok(buf+sizeof(struct sflap_hdr),":"); /* Ditch the first part */ | |
358 if (!strcasecmp(c,"UPDATE_BUDDY")) { | |
359 char *uc; | |
360 int logged, evil, idle, type = 0; | |
361 time_t signon; | |
362 time_t time_idle; | |
363 | |
364 c = strtok(NULL,":"); /* c is name */ | |
365 | |
366 l = strtok(NULL,":"); /* l is T/F logged status */ | |
367 | |
368 sscanf(strtok(NULL, ":"), "%d", &evil); | |
369 | |
370 sscanf(strtok(NULL, ":"), "%ld", &signon); | |
371 | |
372 sscanf(strtok(NULL, ":"), "%d", &idle); | |
373 | |
374 uc = strtok(NULL, ":"); | |
375 | |
376 | |
377 if (!strncasecmp(l,"T",1)) | |
378 logged = 1; | |
379 else | |
380 logged = 0; | |
381 | |
382 | |
383 if (uc[0] == 'A') | |
384 type |= UC_AOL; | |
385 | |
386 switch(uc[1]) { | |
387 case 'A': | |
388 type |= UC_ADMIN; | |
389 break; | |
390 case 'U': | |
391 type |= UC_UNCONFIRMED; | |
392 break; | |
393 case 'O': | |
394 type |= UC_NORMAL; | |
395 break; | |
396 default: | |
397 break; | |
398 } | |
399 | |
400 switch(uc[2]) { | |
401 case 'U': | |
402 type |= UC_UNAVAILABLE; | |
403 break; | |
404 default: | |
405 break; | |
406 } | |
407 | |
408 if (idle) { | |
409 time(&time_idle); | |
410 time_idle -= idle*60; | |
411 } else | |
412 time_idle = 0; | |
413 | |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
414 serv_got_update(gc, c, logged, evil, signon, time_idle, type, 0); |
1 | 415 |
300
b32c83750104
[gaim-migrate @ 310]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
296
diff
changeset
|
416 } else if (!strcasecmp(c, "CONFIG")) { |
b32c83750104
[gaim-migrate @ 310]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
296
diff
changeset
|
417 /* do we want to load the buddy list again here? */ |
318
35796808896a
[gaim-migrate @ 328]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
301
diff
changeset
|
418 c = strtok(NULL,":"); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
419 parse_toc_buddy_list(gc, c, 0); |
1 | 420 } else if (!strcasecmp(c, "ERROR")) { |
301
f905caee43ca
[gaim-migrate @ 311]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
300
diff
changeset
|
421 /* This should be handled by wait_reply |
1 | 422 c = strtok(NULL,":"); |
423 show_error_dialog(c); | |
301
f905caee43ca
[gaim-migrate @ 311]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
300
diff
changeset
|
424 */ |
1 | 425 } else if (!strcasecmp(c, "NICK")) { |
426 c = strtok(NULL,":"); | |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
427 g_snprintf(gc->username, sizeof(gc->username), "%s", c); |
1 | 428 } else if (!strcasecmp(c, "IM_IN")) { |
429 char *away, *message; | |
430 int a = 0; | |
431 | |
432 c = strtok(NULL,":"); | |
433 away = strtok(NULL,":"); | |
434 | |
435 message = away; | |
436 | |
437 while(*message && (*message != ':')) | |
438 message++; | |
439 | |
440 message++; | |
441 | |
442 if (!strncasecmp(away, "T", 1)) | |
443 a = 1; | |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
444 serv_got_im(gc, c, message, a); |
1 | 445 |
446 } else if (!strcasecmp(c, "GOTO_URL")) { | |
447 char *name; | |
448 char *url; | |
449 | |
450 char tmp[256]; | |
451 | |
452 name = strtok(NULL, ":"); | |
453 url = strtok(NULL, ":"); | |
454 | |
455 | |
1088
18a14e6dd0af
[gaim-migrate @ 1098]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1087
diff
changeset
|
456 g_snprintf(tmp, sizeof(tmp), "http://%s:%d/%s", TOC_HOST, TOC_PORT, url); |
1087
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
457 g_show_info(gc->user, tmp); |
1 | 458 } else if (!strcasecmp(c, "EVILED")) { |
459 int lev; | |
460 char *name = NULL; | |
461 | |
462 sscanf(strtok(NULL, ":"), "%d", &lev); | |
463 name = strtok(NULL, ":"); | |
464 | |
465 sprintf(debug_buff,"%s | %d\n", name, lev); | |
466 debug_print(debug_buff); | |
467 | |
468 serv_got_eviled(name, lev); | |
469 | |
470 } else if (!strcasecmp(c, "CHAT_JOIN")) { | |
471 char *name; | |
472 int id; | |
473 | |
474 | |
475 sscanf(strtok(NULL, ":"), "%d", &id); | |
476 name = strtok(NULL, ":"); | |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
477 serv_got_joined_chat(gc, id, name); |
1 | 478 |
479 } else if (!strcasecmp(c, "DIR_STATUS")) { | |
149 | 480 } else if (!strcasecmp(c, "ADMIN_PASSWD_STATUS")) { |
481 do_error_dialog("Password Change Successeful", "Gaim - Password Change"); | |
1 | 482 } else if (!strcasecmp(c, "CHAT_UPDATE_BUDDY")) { |
483 int id; | |
484 char *in; | |
485 char *buddy; | |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
486 GSList *bcs = gc->buddy_chats; |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
447
diff
changeset
|
487 struct conversation *b = NULL; |
1 | 488 |
489 sscanf(strtok(NULL, ":"), "%d", &id); | |
490 | |
491 in = strtok(NULL, ":"); | |
492 | |
493 while(bcs) { | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
447
diff
changeset
|
494 b = (struct conversation *)bcs->data; |
1 | 495 if (id == b->id) |
496 break; | |
497 bcs = bcs->next; | |
498 b = NULL; | |
499 } | |
500 | |
44 | 501 if (!b) { |
45 | 502 g_free(buf); |
1 | 503 return; |
44 | 504 } |
1 | 505 |
506 | |
507 if (!strcasecmp(in, "T")) { | |
508 while((buddy = strtok(NULL, ":")) != NULL) { | |
509 add_chat_buddy(b, buddy); | |
510 } | |
511 } else { | |
512 while((buddy = strtok(NULL, ":")) != NULL) { | |
513 remove_chat_buddy(b, buddy); | |
514 } | |
515 } | |
516 | |
517 } else if (!strcasecmp(c, "CHAT_LEFT")) { | |
518 int id; | |
519 | |
520 | |
521 sscanf(strtok(NULL, ":"), "%d", &id); | |
522 | |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
523 serv_got_chat_left(gc, id); |
1 | 524 |
525 | |
526 } else if (!strcasecmp(c, "CHAT_IN")) { | |
527 | |
528 int id, w; | |
529 char *m; | |
530 char *who, *whisper; | |
531 | |
532 | |
533 sscanf(strtok(NULL, ":"), "%d", &id); | |
534 who = strtok(NULL, ":"); | |
535 whisper = strtok(NULL, ":"); | |
536 m = whisper; | |
537 while(*m && (*m != ':')) m++; | |
538 m++; | |
539 | |
540 if (!strcasecmp(whisper, "T")) | |
541 w = 1; | |
542 else | |
543 w = 0; | |
544 | |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
545 serv_got_chat_in(gc, id, who, w, m); |
1 | 546 |
547 | |
548 } else if (!strcasecmp(c, "CHAT_INVITE")) { | |
549 char *name; | |
550 char *who; | |
551 char *message; | |
552 int id; | |
553 | |
554 | |
555 name = strtok(NULL, ":"); | |
556 sscanf(strtok(NULL, ":"), "%d", &id); | |
557 who = strtok(NULL, ":"); | |
558 message = strtok(NULL, ":"); | |
559 | |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
560 serv_got_chat_invite(gc, name, id, who, message); |
1 | 561 |
562 | |
563 } else if (!strcasecmp(c, "RVOUS_PROPOSE")) { | |
564 char *user; | |
565 char *uuid; | |
566 char *cookie; | |
567 int seq; | |
568 char *rip, *pip, *vip; | |
569 int port; | |
570 int unk[4]; | |
571 char *messages[4]; | |
572 int subtype, files, totalsize; | |
573 char *name; | |
574 char *tmp; | |
575 int i; | |
576 struct file_transfer *ft; | |
577 | |
578 | |
579 user = strtok(NULL, ":"); | |
580 uuid = strtok(NULL, ":"); | |
581 cookie = strtok(NULL, ":"); | |
582 sscanf(strtok(NULL, ":"), "%d", &seq); | |
583 rip = strtok(NULL, ":"); | |
584 pip = strtok(NULL, ":"); | |
585 vip = strtok(NULL, ":"); | |
586 sscanf(strtok(NULL, ":"), "%d", &port); | |
587 | |
197
24f0fef56a73
[gaim-migrate @ 207]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
196
diff
changeset
|
588 if (!strcmp(uuid, FILE_SEND_UID)) { |
196
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
589 /* we're getting a file */ |
211
2042a38da38b
[gaim-migrate @ 221]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
208
diff
changeset
|
590 for (i=0; i<4; i++) { |
2042a38da38b
[gaim-migrate @ 221]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
208
diff
changeset
|
591 sscanf(strtok(NULL, ":"), "%d", &unk[i]); |
2042a38da38b
[gaim-migrate @ 221]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
208
diff
changeset
|
592 if (unk[i] == 10001) |
2042a38da38b
[gaim-migrate @ 221]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
208
diff
changeset
|
593 break; |
2042a38da38b
[gaim-migrate @ 221]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
208
diff
changeset
|
594 messages[i] = frombase64(strtok(NULL, ":")); |
2042a38da38b
[gaim-migrate @ 221]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
208
diff
changeset
|
595 } |
2042a38da38b
[gaim-migrate @ 221]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
208
diff
changeset
|
596 tmp = frombase64(strtok(NULL, ":")); |
196
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
597 subtype = tmp[1]; |
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
598 files = tmp[3]; /* These are fine */ |
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
599 |
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
600 totalsize = 0; |
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
601 totalsize |= (tmp[4] << 24) & 0xff000000; |
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
602 totalsize |= (tmp[5] << 16) & 0x00ff0000; |
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
603 totalsize |= (tmp[6] << 8) & 0x0000ff00; |
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
604 totalsize |= (tmp[7] << 0) & 0x000000ff; |
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
605 |
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
606 name = tmp + 8; |
1 | 607 |
196
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
608 ft = g_new0(struct file_transfer, 1); |
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
609 |
198
73e9a0bfff62
[gaim-migrate @ 208]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
197
diff
changeset
|
610 ft->cookie = g_strdup(cookie); |
196
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
611 ft->ip = g_strdup(pip); |
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
612 ft->port = port; |
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
613 if (i) |
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
614 ft->message = g_strdup(messages[0]); |
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
615 else |
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
616 ft->message = NULL; |
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
617 ft->filename = g_strdup(name); |
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
618 ft->user = g_strdup(user); |
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
619 ft->size = totalsize; |
198
73e9a0bfff62
[gaim-migrate @ 208]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
197
diff
changeset
|
620 sprintf(ft->UID, "%s", FILE_SEND_UID); |
978
563c409e26a1
[gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
976
diff
changeset
|
621 ft->gc = gc; |
196
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
622 |
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
623 g_free(tmp); |
1 | 624 |
196
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
625 for (i--; i >= 0; i--) |
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
626 g_free(messages[i]); |
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
627 |
507
d17547ff9c2a
[gaim-migrate @ 517]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
472
diff
changeset
|
628 if (totalsize) /* sanity check */ |
d17547ff9c2a
[gaim-migrate @ 517]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
472
diff
changeset
|
629 accept_file_dialog(ft); |
197
24f0fef56a73
[gaim-migrate @ 207]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
196
diff
changeset
|
630 } else if (!strcmp(uuid, FILE_GET_UID)) { |
196
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
631 /* we're sending a file */ |
211
2042a38da38b
[gaim-migrate @ 221]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
208
diff
changeset
|
632 for (i=0; i<4; i++) { |
2042a38da38b
[gaim-migrate @ 221]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
208
diff
changeset
|
633 sscanf(strtok(NULL, ":"), "%d", &unk[i]); |
2042a38da38b
[gaim-migrate @ 221]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
208
diff
changeset
|
634 if (unk[i] == 10001) |
2042a38da38b
[gaim-migrate @ 221]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
208
diff
changeset
|
635 break; |
2042a38da38b
[gaim-migrate @ 221]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
208
diff
changeset
|
636 messages[i] = frombase64(strtok(NULL, ":")); |
2042a38da38b
[gaim-migrate @ 221]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
208
diff
changeset
|
637 } |
2042a38da38b
[gaim-migrate @ 221]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
208
diff
changeset
|
638 tmp = frombase64(strtok(NULL, ":")); |
198
73e9a0bfff62
[gaim-migrate @ 208]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
197
diff
changeset
|
639 ft = g_new0(struct file_transfer, 1); |
73e9a0bfff62
[gaim-migrate @ 208]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
197
diff
changeset
|
640 |
73e9a0bfff62
[gaim-migrate @ 208]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
197
diff
changeset
|
641 ft->cookie = g_strdup(cookie); |
73e9a0bfff62
[gaim-migrate @ 208]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
197
diff
changeset
|
642 ft->ip = g_strdup(pip); |
73e9a0bfff62
[gaim-migrate @ 208]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
197
diff
changeset
|
643 ft->port = port; |
73e9a0bfff62
[gaim-migrate @ 208]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
197
diff
changeset
|
644 if (i) |
73e9a0bfff62
[gaim-migrate @ 208]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
197
diff
changeset
|
645 ft->message = g_strdup(messages[0]); |
73e9a0bfff62
[gaim-migrate @ 208]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
197
diff
changeset
|
646 else |
73e9a0bfff62
[gaim-migrate @ 208]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
197
diff
changeset
|
647 ft->message = NULL; |
73e9a0bfff62
[gaim-migrate @ 208]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
197
diff
changeset
|
648 ft->user = g_strdup(user); |
73e9a0bfff62
[gaim-migrate @ 208]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
197
diff
changeset
|
649 sprintf(ft->UID, "%s", FILE_GET_UID); |
978
563c409e26a1
[gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
976
diff
changeset
|
650 ft->gc = gc; |
198
73e9a0bfff62
[gaim-migrate @ 208]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
197
diff
changeset
|
651 |
73e9a0bfff62
[gaim-migrate @ 208]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
197
diff
changeset
|
652 g_free(tmp); |
73e9a0bfff62
[gaim-migrate @ 208]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
197
diff
changeset
|
653 |
73e9a0bfff62
[gaim-migrate @ 208]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
197
diff
changeset
|
654 for (i--; i >= 0; i--) |
73e9a0bfff62
[gaim-migrate @ 208]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
197
diff
changeset
|
655 g_free(messages[i]); |
73e9a0bfff62
[gaim-migrate @ 208]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
197
diff
changeset
|
656 |
73e9a0bfff62
[gaim-migrate @ 208]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
197
diff
changeset
|
657 accept_file_dialog(ft); |
369
cf895313fc50
[gaim-migrate @ 379]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
351
diff
changeset
|
658 } else if (!strcmp(uuid, VOICE_UID)) { |
cf895313fc50
[gaim-migrate @ 379]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
351
diff
changeset
|
659 /* oh goody. voice over ip. fun stuff. */ |
cf895313fc50
[gaim-migrate @ 379]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
351
diff
changeset
|
660 |
196
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
661 /* |
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
662 } else if (!strcmp(uuid, B_ICON_UID)) { |
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
663 } else if (!strcmp(uuid, IMAGE_UID)) { |
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
664 */ |
1 | 665 |
196
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
666 } else { |
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
667 sprintf(debug_buff,"don't know what to do with %s\n", |
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
668 uuid); |
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
669 debug_print(debug_buff); |
211
2042a38da38b
[gaim-migrate @ 221]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
208
diff
changeset
|
670 tmp = g_malloc(BUF_LEN); |
2042a38da38b
[gaim-migrate @ 221]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
208
diff
changeset
|
671 name = frombase64(cookie); |
2042a38da38b
[gaim-migrate @ 221]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
208
diff
changeset
|
672 snprintf(tmp, BUF_LEN, "toc_rvous_cancel %s %s %s", |
2042a38da38b
[gaim-migrate @ 221]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
208
diff
changeset
|
673 user, name, uuid); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
674 sflap_send(gc, tmp, strlen(tmp), TYPE_DATA); |
211
2042a38da38b
[gaim-migrate @ 221]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
208
diff
changeset
|
675 free(name); |
2042a38da38b
[gaim-migrate @ 221]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
208
diff
changeset
|
676 free(tmp); |
196
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
677 } |
1 | 678 } else { |
679 sprintf(debug_buff,"don't know what to do with %s\n", c); | |
680 debug_print(debug_buff); | |
681 } | |
682 g_free(buf); | |
683 } | |
684 | |
685 | |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
686 int toc_signon(struct gaim_connection *gc) |
1 | 687 { |
688 char buf[BUF_LONG]; | |
689 int res; | |
690 struct signon so; | |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
691 struct toc_data *tdt = (struct toc_data *)gc->proto_data; |
1 | 692 |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
693 sprintf(debug_buff,"State = %d\n", tdt->state); |
1 | 694 debug_print(debug_buff); |
695 | |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
696 if ((res = write(tdt->toc_fd, FLAPON, strlen(FLAPON))) < 0) |
1 | 697 return res; |
698 /* Wait for signon packet */ | |
699 | |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
700 tdt->state = STATE_FLAPON; |
1 | 701 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
702 if ((res = wait_reply(gc, buf, sizeof(buf)) < 0)) |
1 | 703 return res; |
704 | |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
705 if (tdt->state != STATE_SIGNON_REQUEST) { |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
706 sprintf(debug_buff, "State should be %d, but is %d instead\n", STATE_SIGNON_REQUEST, tdt->state); |
1 | 707 debug_print(debug_buff); |
708 return -1; | |
709 } | |
710 | |
711 /* Compose a response */ | |
712 | |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
713 g_snprintf(so.username, sizeof(so.username), "%s", gc->username); |
1 | 714 so.ver = ntohl(1); |
715 so.tag = ntohs(1); | |
716 so.namelen = htons(strlen(so.username)); | |
717 | |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
718 sflap_send(gc, (char *)&so, ntohs(so.namelen) + 8, TYPE_SIGNON); |
1 | 719 |
720 g_snprintf(buf, sizeof(buf), | |
721 "toc_signon %s %d %s %s %s \"%s\"", | |
1087
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
722 AUTH_HOST, AUTH_PORT, normalize(gc->username), roast_password(gc->password), |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
723 LANGUAGE, REVISION); |
1 | 724 |
725 sprintf(debug_buff,"Send: %s\n", buf); | |
726 debug_print(debug_buff); | |
727 | |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
728 return sflap_send(gc, buf, -1, TYPE_DATA); |
1 | 729 } |
730 | |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
731 int toc_wait_signon(struct gaim_connection *gc) |
1 | 732 { |
733 /* Wait for the SIGNON to be approved */ | |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
734 struct toc_data *tdt = (struct toc_data *)gc->proto_data; |
351
22161278657c
[gaim-migrate @ 361]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
735 char buf[BUF_LONG]; |
1 | 736 int res; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
737 res = wait_reply(gc, buf, sizeof(buf)); |
1 | 738 if (res < 0) |
739 return res; | |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
740 if (tdt->state != STATE_SIGNON_ACK) { |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
741 sprintf(debug_buff, "State should be %d, but is %d instead\n",STATE_SIGNON_ACK, tdt->state); |
1 | 742 debug_print(debug_buff); |
743 return -1; | |
744 } | |
745 return 0; | |
746 } | |
747 | |
748 #ifdef _WIN32 | |
749 gint win32_read() | |
750 { | |
751 int ret; | |
752 struct fd_set fds; | |
753 struct timeval tv; | |
754 | |
755 FD_ZERO(&fds); | |
756 | |
757 tv.tv_sec = 0; | |
758 tv.tv_usec = 200; | |
759 | |
760 FD_SET(toc_fd, &fds); | |
761 | |
762 ret = select(toc_fd + 1, &fds, NULL, NULL, &tv); | |
763 | |
764 if (ret == 0) { | |
765 return TRUE; | |
766 } | |
767 | |
768 toc_callback(NULL, 0, (GdkInputCondition)0); | |
769 return TRUE; | |
770 } | |
771 #endif | |
772 | |
773 | |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
774 char *toc_wait_config(struct gaim_connection *gc) |
1 | 775 { |
776 /* Waits for configuration packet, returning the contents of the packet */ | |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
777 struct toc_data *tdt = (struct toc_data *)gc->proto_data; |
351
22161278657c
[gaim-migrate @ 361]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
778 static char buf[BUF_LONG]; |
1 | 779 int res; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
780 res = wait_reply(gc, buf, sizeof(buf)); |
1 | 781 if (res < 0) |
782 return NULL; | |
300
b32c83750104
[gaim-migrate @ 310]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
296
diff
changeset
|
783 /* Apparently, the toc_config is optional. *VERY* Optional |
285 | 784 */ |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
785 if (tdt->state != STATE_CONFIG) { |
300
b32c83750104
[gaim-migrate @ 310]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
296
diff
changeset
|
786 res = 0; |
b32c83750104
[gaim-migrate @ 310]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
296
diff
changeset
|
787 } else { |
b32c83750104
[gaim-migrate @ 310]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
296
diff
changeset
|
788 res = 1; |
b32c83750104
[gaim-migrate @ 310]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
296
diff
changeset
|
789 } |
1 | 790 /* At this point, it's time to setup automatic handling of incoming packets */ |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
791 tdt->state = STATE_ONLINE; |
1 | 792 #ifdef _WIN32 |
300
b32c83750104
[gaim-migrate @ 310]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
296
diff
changeset
|
793 win32_r = gtk_timeout_add(1000, (GtkFunction)win32_read, NULL); |
1 | 794 #else |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
795 gc->inpa = gdk_input_add(tdt->toc_fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION, toc_callback, gc); |
1 | 796 #endif |
300
b32c83750104
[gaim-migrate @ 310]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
296
diff
changeset
|
797 if (res) |
b32c83750104
[gaim-migrate @ 310]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
296
diff
changeset
|
798 return buf; |
b32c83750104
[gaim-migrate @ 310]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
296
diff
changeset
|
799 else |
b32c83750104
[gaim-migrate @ 310]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
296
diff
changeset
|
800 return NULL; |
1 | 801 } |
802 | |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
803 void toc_build_config(struct gaim_connection *gc, char *s, int len, gboolean show) |
1 | 804 { |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
805 GSList *grp = gc->groups; |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
806 GSList *mem; |
678
c72f58814e9f
[gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
676
diff
changeset
|
807 struct group *g; |
c72f58814e9f
[gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
676
diff
changeset
|
808 struct buddy *b; |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
809 GSList *plist = gc->permit; |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
810 GSList *dlist = gc->deny; |
1 | 811 |
678
c72f58814e9f
[gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
676
diff
changeset
|
812 int pos=0; |
c72f58814e9f
[gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
676
diff
changeset
|
813 |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
814 if (!gc->permdeny) |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
815 gc->permdeny = 1; |
1 | 816 |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
817 pos += g_snprintf(&s[pos], len - pos, "m %d\n", gc->permdeny); |
678
c72f58814e9f
[gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
676
diff
changeset
|
818 while(grp) { |
c72f58814e9f
[gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
676
diff
changeset
|
819 g = (struct group *)grp->data; |
c72f58814e9f
[gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
676
diff
changeset
|
820 pos += g_snprintf(&s[pos], len - pos, "g %s\n", g->name); |
c72f58814e9f
[gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
676
diff
changeset
|
821 mem = g->members; |
c72f58814e9f
[gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
676
diff
changeset
|
822 while(mem) { |
c72f58814e9f
[gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
676
diff
changeset
|
823 b = (struct buddy *)mem->data; |
710
efd72a117875
[gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
681
diff
changeset
|
824 pos += g_snprintf(&s[pos], len - pos, "b %s%s%s\n", b->name, |
efd72a117875
[gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
681
diff
changeset
|
825 show ? ":" : "", show ? b->show : ""); |
678
c72f58814e9f
[gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
676
diff
changeset
|
826 mem = mem->next; |
c72f58814e9f
[gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
676
diff
changeset
|
827 } |
940 | 828 grp = g_slist_next(grp); |
678
c72f58814e9f
[gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
676
diff
changeset
|
829 } |
1 | 830 |
678
c72f58814e9f
[gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
676
diff
changeset
|
831 while(plist) { |
c72f58814e9f
[gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
676
diff
changeset
|
832 pos += g_snprintf(&s[pos], len - pos, "p %s\n", (char *)plist->data); |
c72f58814e9f
[gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
676
diff
changeset
|
833 plist=plist->next; |
c72f58814e9f
[gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
676
diff
changeset
|
834 } |
c72f58814e9f
[gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
676
diff
changeset
|
835 |
c72f58814e9f
[gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
676
diff
changeset
|
836 while(dlist) { |
c72f58814e9f
[gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
676
diff
changeset
|
837 pos += g_snprintf(&s[pos], len - pos, "d %s\n", (char *)dlist->data); |
c72f58814e9f
[gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
676
diff
changeset
|
838 dlist=dlist->next; |
c72f58814e9f
[gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
676
diff
changeset
|
839 } |
1 | 840 } |
841 | |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
842 void parse_toc_buddy_list(struct gaim_connection *gc, char *config, int from_do_import) |
1 | 843 { |
844 char *c; | |
681
5422dbecd861
[gaim-migrate @ 691]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
678
diff
changeset
|
845 char current[256]; |
1 | 846 char *name; |
847 GList *bud; | |
228 | 848 int how_many = 0; |
849 | |
1 | 850 bud = NULL; |
851 | |
332
b573f33c5e0e
[gaim-migrate @ 342]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
318
diff
changeset
|
852 if (config != NULL) { |
b573f33c5e0e
[gaim-migrate @ 342]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
318
diff
changeset
|
853 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
854 /* skip "CONFIG:" (if it exists)*/ |
681
5422dbecd861
[gaim-migrate @ 691]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
678
diff
changeset
|
855 c = strncmp(config + sizeof(struct sflap_hdr),"CONFIG:",strlen("CONFIG:"))? |
1 | 856 strtok(config, "\n"): |
857 strtok(config + sizeof(struct sflap_hdr)+strlen("CONFIG:"), "\n"); | |
681
5422dbecd861
[gaim-migrate @ 691]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
678
diff
changeset
|
858 do { |
5422dbecd861
[gaim-migrate @ 691]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
678
diff
changeset
|
859 if (c == NULL) |
5422dbecd861
[gaim-migrate @ 691]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
678
diff
changeset
|
860 break; |
5422dbecd861
[gaim-migrate @ 691]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
678
diff
changeset
|
861 if (*c == 'g') { |
5422dbecd861
[gaim-migrate @ 691]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
678
diff
changeset
|
862 strncpy(current,c+2, sizeof(current)); |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
863 add_group(gc, current); |
681
5422dbecd861
[gaim-migrate @ 691]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
678
diff
changeset
|
864 how_many++; |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
865 } else if (*c == 'b' && !find_buddy(gc, c+2)) { |
710
efd72a117875
[gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
681
diff
changeset
|
866 char nm[80], sw[80], *tmp = c+2; |
efd72a117875
[gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
681
diff
changeset
|
867 int i = 0; |
efd72a117875
[gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
681
diff
changeset
|
868 while (*tmp != ':' && *tmp) |
efd72a117875
[gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
681
diff
changeset
|
869 nm[i++] = *tmp++; |
efd72a117875
[gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
681
diff
changeset
|
870 if (*tmp == ':') *tmp++ = '\0'; |
efd72a117875
[gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
681
diff
changeset
|
871 nm[i] = '\0'; |
efd72a117875
[gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
681
diff
changeset
|
872 i = 0; |
efd72a117875
[gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
681
diff
changeset
|
873 while (*tmp) sw[i++] = *tmp++; |
efd72a117875
[gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
681
diff
changeset
|
874 sw[i] = '\0'; |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
875 if (!find_buddy(gc, nm)) |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
876 add_buddy(gc, current, nm, sw); |
681
5422dbecd861
[gaim-migrate @ 691]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
678
diff
changeset
|
877 how_many++; |
710
efd72a117875
[gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
681
diff
changeset
|
878 |
681
5422dbecd861
[gaim-migrate @ 691]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
678
diff
changeset
|
879 bud = g_list_append(bud, c+2); |
5422dbecd861
[gaim-migrate @ 691]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
678
diff
changeset
|
880 } else if (*c == 'p') { |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
881 GSList *d = gc->permit; |
681
5422dbecd861
[gaim-migrate @ 691]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
678
diff
changeset
|
882 char *n; |
863
55194c5f338f
[gaim-migrate @ 873]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
793
diff
changeset
|
883 name = g_malloc(strlen(c+2) + 2); |
681
5422dbecd861
[gaim-migrate @ 691]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
678
diff
changeset
|
884 g_snprintf(name, strlen(c+2) + 1, "%s", c+2); |
5422dbecd861
[gaim-migrate @ 691]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
678
diff
changeset
|
885 n = g_strdup(normalize(name)); |
5422dbecd861
[gaim-migrate @ 691]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
678
diff
changeset
|
886 while (d) { |
5422dbecd861
[gaim-migrate @ 691]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
678
diff
changeset
|
887 if (!strcasecmp(n, normalize(d->data))) |
5422dbecd861
[gaim-migrate @ 691]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
678
diff
changeset
|
888 break; |
5422dbecd861
[gaim-migrate @ 691]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
678
diff
changeset
|
889 d = d->next; |
5422dbecd861
[gaim-migrate @ 691]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
678
diff
changeset
|
890 } |
5422dbecd861
[gaim-migrate @ 691]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
678
diff
changeset
|
891 g_free(n); |
5422dbecd861
[gaim-migrate @ 691]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
678
diff
changeset
|
892 if (!d) |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
893 gc->permit = g_slist_append(gc->permit, name); |
681
5422dbecd861
[gaim-migrate @ 691]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
678
diff
changeset
|
894 } else if (*c == 'd') { |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
895 GSList *d = gc->deny; |
681
5422dbecd861
[gaim-migrate @ 691]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
678
diff
changeset
|
896 char *n; |
5422dbecd861
[gaim-migrate @ 691]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
678
diff
changeset
|
897 name = g_malloc(strlen(c+2) + 2); |
5422dbecd861
[gaim-migrate @ 691]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
678
diff
changeset
|
898 g_snprintf(name, strlen(c+2) + 1, "%s", c+2); |
5422dbecd861
[gaim-migrate @ 691]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
678
diff
changeset
|
899 n = g_strdup(normalize(name)); |
5422dbecd861
[gaim-migrate @ 691]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
678
diff
changeset
|
900 while (d) { |
5422dbecd861
[gaim-migrate @ 691]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
678
diff
changeset
|
901 if (!strcasecmp(n, normalize(d->data))) |
5422dbecd861
[gaim-migrate @ 691]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
678
diff
changeset
|
902 break; |
5422dbecd861
[gaim-migrate @ 691]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
678
diff
changeset
|
903 d = d->next; |
5422dbecd861
[gaim-migrate @ 691]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
678
diff
changeset
|
904 } |
5422dbecd861
[gaim-migrate @ 691]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
678
diff
changeset
|
905 g_free(n); |
5422dbecd861
[gaim-migrate @ 691]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
678
diff
changeset
|
906 if (!d) |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
907 gc->deny = g_slist_append(gc->deny, name); |
793
57cc66fbfa8e
[gaim-migrate @ 803]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
774
diff
changeset
|
908 } else if (!strncmp("toc", c, 3)) { |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
909 sscanf(c + strlen(c) - 1, "%d", &gc->permdeny); |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
910 sprintf(debug_buff, "permdeny: %d\n", gc->permdeny); |
793
57cc66fbfa8e
[gaim-migrate @ 803]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
774
diff
changeset
|
911 debug_print(debug_buff); |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
912 if (gc->permdeny == 0) |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
913 gc->permdeny = 1; |
793
57cc66fbfa8e
[gaim-migrate @ 803]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
774
diff
changeset
|
914 } else if (*c == 'm') { |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
915 sscanf(c + 2, "%d", &gc->permdeny); |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
916 sprintf(debug_buff, "permdeny: %d\n", gc->permdeny); |
793
57cc66fbfa8e
[gaim-migrate @ 803]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
774
diff
changeset
|
917 debug_print(debug_buff); |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
918 if (gc->permdeny == 0) |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
919 gc->permdeny = 1; |
681
5422dbecd861
[gaim-migrate @ 691]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
678
diff
changeset
|
920 } |
5422dbecd861
[gaim-migrate @ 691]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
678
diff
changeset
|
921 } while((c=strtok(NULL,"\n"))); |
1 | 922 #if 0 |
681
5422dbecd861
[gaim-migrate @ 691]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
678
diff
changeset
|
923 fprintf(stdout, "Sending message '%s'\n",buf); |
1 | 924 #endif |
681
5422dbecd861
[gaim-migrate @ 691]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
678
diff
changeset
|
925 |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
926 if (bud != NULL) serv_add_buddies(gc, bud); |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
927 serv_set_permit_deny(gc); |
681
5422dbecd861
[gaim-migrate @ 691]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
678
diff
changeset
|
928 if (blist) { |
5422dbecd861
[gaim-migrate @ 691]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
678
diff
changeset
|
929 build_edit_tree(); |
5422dbecd861
[gaim-migrate @ 691]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
678
diff
changeset
|
930 } |
332
b573f33c5e0e
[gaim-migrate @ 342]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
318
diff
changeset
|
931 } |
b573f33c5e0e
[gaim-migrate @ 342]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
318
diff
changeset
|
932 |
228 | 933 /* perhaps the server dropped the buddy list, try importing from |
934 cache */ | |
935 | |
296
a88b889b692b
[gaim-migrate @ 306]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
285
diff
changeset
|
936 if ( how_many == 0 && !from_do_import ) { |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
937 do_import( (GtkWidget *) NULL, gc ); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
938 } else if ( gc && (bud_list_cache_exists(gc) == FALSE) ) { |
229 | 939 do_export( (GtkWidget *) NULL, 0 ); |
228 | 940 } |
1 | 941 } |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
942 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
943 static char *toc_name() { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
944 return "TOC"; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
945 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
946 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
947 static void toc_send_im(struct gaim_connection *gc, char *name, char *message, int away) { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
948 char buf[MSG_LEN - 7]; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
949 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
950 escape_text(message); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
951 g_snprintf(buf, MSG_LEN - 8, "toc_send_im %s \"%s\"%s", normalize(name), |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
952 message, ((away) ? " auto" : "")); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
953 sflap_send(gc, buf, -1, TYPE_DATA); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
954 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
955 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
956 static void toc_get_info(struct gaim_connection *g, char *name) { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
957 char buf[MSG_LEN]; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
958 g_snprintf(buf, MSG_LEN, "toc_get_info %s", normalize(name)); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
959 sflap_send(g, buf, -1, TYPE_DATA); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
960 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
961 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
962 static void toc_get_dir(struct gaim_connection *g, char *name) { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
963 char buf[MSG_LEN]; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
964 g_snprintf(buf, MSG_LEN, "toc_get_dir %s", normalize(name)); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
965 sflap_send(g, buf, -1, TYPE_DATA); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
966 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
967 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
968 static void toc_set_dir(struct gaim_connection *g, char *first, char *middle, char *last, |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
969 char *maiden, char *city, char *state, char *country, int web) { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
970 char buf2[BUF_LEN*4], buf[BUF_LEN]; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
971 g_snprintf(buf2, sizeof(buf2), "%s:%s:%s:%s:%s:%s:%s:%s", first, |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
972 middle, last, maiden, city, state, country, |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
973 (web == 1) ? "Y" : ""); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
974 escape_text(buf2); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
975 g_snprintf(buf, sizeof(buf), "toc_set_dir %s", buf2); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
976 sflap_send(g, buf, -1, TYPE_DATA); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
977 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
978 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
979 static void toc_dir_search(struct gaim_connection *g, char *first, char *middle, char *last, |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
980 char *maiden, char *city, char *state, char *country, char *email) { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
981 char buf[BUF_LONG]; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
982 g_snprintf(buf, sizeof(buf)/2, "toc_dir_search %s:%s:%s:%s:%s:%s:%s:%s", first, middle, |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
983 last, maiden, city, state, country, email); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
984 sprintf(debug_buff,"Searching for: %s,%s,%s,%s,%s,%s,%s\n", first, middle, last, maiden, |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
985 city, state, country); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
986 debug_print(debug_buff); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
987 sflap_send(g, buf, -1, TYPE_DATA); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
988 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
989 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
990 static void toc_set_away(struct gaim_connection *g, char *message) { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
991 char buf[MSG_LEN]; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
992 if (message) { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
993 escape_text(message); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
994 g_snprintf(buf, MSG_LEN, "toc_set_away \"%s\"", message); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
995 } else |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
996 g_snprintf(buf, MSG_LEN, "toc_set_away \"\""); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
997 sflap_send(g, buf, -1, TYPE_DATA); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
998 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
999 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1000 static void toc_set_info(struct gaim_connection *g, char *info) { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1001 char buf[MSG_LEN]; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1002 escape_text(info); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1003 g_snprintf(buf, sizeof(buf), "toc_set_info \"%s\n\"", info); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1004 sflap_send(g, buf, -1, TYPE_DATA); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1005 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1006 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1007 static void toc_change_passwd(struct gaim_connection *g, char *orig, char *new) { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1008 char buf[MSG_LEN]; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1009 g_snprintf(buf, BUF_LONG, "toc_change_passwd %s %s", orig, new); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1010 sflap_send(g, buf, strlen(buf), TYPE_DATA); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1011 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1012 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1013 static void toc_add_buddy(struct gaim_connection *g, char *name) { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1014 char buf[1024]; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1015 g_snprintf(buf, sizeof(buf), "toc_add_buddy %s", normalize(name)); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1016 sflap_send(g, buf, -1, TYPE_DATA); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1017 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1018 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1019 static void toc_add_buddies(struct gaim_connection *g, GList *buddies) { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1020 char buf[MSG_LEN]; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1021 int n; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1022 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1023 n = g_snprintf(buf, sizeof(buf), "toc_add_buddy"); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1024 while (buddies) { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1025 if (strlen(normalize(buddies->data)) > MSG_LEN - n - 16) { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1026 sflap_send(g, buf, -1, TYPE_DATA); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1027 n = g_snprintf(buf, sizeof(buf), "toc_add_buddy"); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1028 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1029 n += g_snprintf(buf + n, sizeof(buf)-n, " %s", normalize(buddies->data)); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1030 buddies = buddies->next; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1031 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1032 sflap_send(g, buf, -1, TYPE_DATA); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1033 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1034 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1035 static void toc_remove_buddy(struct gaim_connection *g, char *name) { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1036 char buf[1024]; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1037 g_snprintf(buf, sizeof(buf), "toc_remove_buddy %s", normalize(name)); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1038 sflap_send(g, buf, -1, TYPE_DATA); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1039 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1040 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1041 static void toc_set_idle(struct gaim_connection *g, int time) { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1042 char buf[256]; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1043 g_snprintf(buf, sizeof(buf), "toc_set_idle %d", time); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1044 sflap_send(g, buf, -1, TYPE_DATA); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1045 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1046 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1047 static void toc_warn(struct gaim_connection *g, char *name, int anon) { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1048 char send[256]; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1049 g_snprintf(send, 255, "toc_evil %s %s", name, ((anon) ? "anon" : "norm")); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1050 sflap_send(g, send, -1, TYPE_DATA); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1051 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1052 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1053 static void toc_accept_chat(struct gaim_connection *g, int i) { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1054 char buf[256]; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1055 g_snprintf(buf, 255, "toc_chat_accept %d", i); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1056 sflap_send(g, buf, -1, TYPE_DATA); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1057 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1058 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1059 static void toc_join_chat(struct gaim_connection *g, int exchange, char *name) { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1060 char buf[BUF_LONG]; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1061 g_snprintf(buf, sizeof(buf)/2, "toc_chat_join %d \"%s\"", exchange, name); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1062 sflap_send(g, buf, -1, TYPE_DATA); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1063 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1064 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1065 static void toc_chat_invite(struct gaim_connection *g, int id, char *message, char *name) { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1066 char buf[BUF_LONG]; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1067 g_snprintf(buf, sizeof(buf)/2, "toc_chat_invite %d \"%s\" %s", id, message, normalize(name)); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1068 sflap_send(g, buf, -1, TYPE_DATA); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1069 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1070 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1071 static void toc_chat_leave(struct gaim_connection *g, int id) { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1072 char buf[256]; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1073 g_snprintf(buf, 255, "toc_chat_leave %d", id); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1074 sflap_send(g, buf, -1, TYPE_DATA); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1075 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1076 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1077 static void toc_chat_whisper(struct gaim_connection *g, int id, char *who, char *message) { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1078 char buf2[MSG_LEN]; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1079 g_snprintf(buf2, sizeof(buf2), "toc_chat_whisper %d %s \"%s\"", id, who, message); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1080 sflap_send(g, buf2, -1, TYPE_DATA); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1081 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1082 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1083 static void toc_chat_send(struct gaim_connection *g, int id, char *message) { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1084 char buf[MSG_LEN]; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1085 escape_text(message); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1086 g_snprintf(buf, sizeof(buf), "toc_chat_send %d \"%s\"",id, message); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1087 sflap_send(g, buf, -1, TYPE_DATA); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1088 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1089 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1090 static void toc_keepalive(struct gaim_connection *gc) { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1091 sflap_send(gc, "", 0, TYPE_KEEPALIVE); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1092 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1093 |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1094 static char **toc_list_icon(int uc) { |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1095 if (uc & UC_UNAVAILABLE) |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1096 return (char **)away_icon_xpm; |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1097 if (uc & UC_AOL) |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1098 return (char **)aol_icon_xpm; |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1099 if (uc & UC_NORMAL) |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1100 return (char **)free_icon_xpm; |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1101 if (uc & UC_ADMIN) |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1102 return (char **)admin_icon_xpm; |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1103 if (uc & UC_UNCONFIRMED) |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1104 return (char **)dt_icon_xpm; |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1105 return NULL; |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1106 } |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1107 |
1032
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1108 static void toc_info(GtkObject *obj, char *who) { |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1109 struct gaim_connection *gc = (struct gaim_connection *)gtk_object_get_user_data(obj); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1110 serv_get_info(gc, who); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1111 } |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1112 |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1113 static void toc_dir_info(GtkObject *obj, char *who) { |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1114 struct gaim_connection *gc = (struct gaim_connection *)gtk_object_get_user_data(obj); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1115 serv_get_dir(gc, who); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1116 } |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1117 |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1118 static void toc_action_menu(GtkWidget *menu, struct gaim_connection *gc, char *who) { |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1119 GtkWidget *button; |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1120 |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1121 button = gtk_menu_item_new_with_label(_("Get Info")); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1122 gtk_signal_connect(GTK_OBJECT(button), "activate", |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1123 GTK_SIGNAL_FUNC(toc_info), who); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1124 gtk_object_set_user_data(GTK_OBJECT(button), gc); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1125 gtk_menu_append(GTK_MENU(menu), button); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1126 gtk_widget_show(button); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1127 |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1128 button = gtk_menu_item_new_with_label(_("Get Dir Info")); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1129 gtk_signal_connect(GTK_OBJECT(button), "activate", |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1130 GTK_SIGNAL_FUNC(toc_dir_info), who); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1131 gtk_object_set_user_data(GTK_OBJECT(button), gc); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1132 gtk_menu_append(GTK_MENU(menu), button); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1133 gtk_widget_show(button); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1134 } |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1135 |
1087
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1136 static void toc_print_option(GtkEntry *entry, struct aim_user *user) { |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1137 int entrynum; |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1138 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1139 entrynum = (int) gtk_object_get_user_data(GTK_OBJECT(entry)); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1140 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1141 if (entrynum == USEROPT_AUTH) { |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1142 g_snprintf(user->proto_opt[USEROPT_AUTH], |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1143 sizeof(user->proto_opt[USEROPT_AUTH]), |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1144 "%s", gtk_entry_get_text(entry)); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1145 } else if (entrynum == USEROPT_AUTHPORT) { |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1146 g_snprintf(user->proto_opt[USEROPT_AUTHPORT], |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1147 sizeof(user->proto_opt[USEROPT_AUTHPORT]), |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1148 "%s", gtk_entry_get_text(entry)); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1149 } else if (entrynum == USEROPT_SOCKSHOST) { |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1150 g_snprintf(user->proto_opt[USEROPT_SOCKSHOST], |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1151 sizeof(user->proto_opt[USEROPT_SOCKSHOST]), |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1152 "%s", gtk_entry_get_text(entry)); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1153 } else if (entrynum == USEROPT_SOCKSPORT) { |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1154 g_snprintf(user->proto_opt[USEROPT_SOCKSPORT], |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1155 sizeof(user->proto_opt[USEROPT_SOCKSPORT]), |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1156 "%s", gtk_entry_get_text(entry)); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1157 } |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1158 } |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1159 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1160 static void toc_print_optionrad(GtkRadioButton *entry, struct aim_user *user) { |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1161 int entrynum; |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1162 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1163 entrynum = (int) gtk_object_get_user_data(GTK_OBJECT(entry)); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1164 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1165 g_snprintf(user->proto_opt[USEROPT_PROXYTYPE], |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1166 sizeof(user->proto_opt[USEROPT_PROXYTYPE]), |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1167 "%d", entrynum); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1168 } |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1169 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1170 static void toc_user_opts(GtkWidget *book, struct aim_user *user) { |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1171 /* so here, we create the new notebook page */ |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1172 GtkWidget *vbox; |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1173 GtkWidget *hbox; |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1174 GtkWidget *label; |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1175 GtkWidget *entry; |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1176 GtkWidget *first, *opt; |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1177 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1178 vbox = gtk_vbox_new(FALSE, 0); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1179 gtk_notebook_append_page(GTK_NOTEBOOK(book), vbox, |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1180 gtk_label_new("TOC Options")); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1181 gtk_widget_show(vbox); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1182 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1183 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1184 hbox = gtk_hbox_new(FALSE, 0); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1185 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1186 gtk_widget_show(hbox); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1187 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1188 label = gtk_label_new("TOC Host:"); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1189 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1190 gtk_widget_show(label); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1191 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1192 entry = gtk_entry_new(); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1193 gtk_box_pack_end(GTK_BOX(hbox), entry, FALSE, FALSE, 5); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1194 gtk_object_set_user_data(GTK_OBJECT(entry), (void *)USEROPT_AUTH); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1195 gtk_signal_connect(GTK_OBJECT(entry), "changed", |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1196 GTK_SIGNAL_FUNC(toc_print_option), user); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1197 if (user->proto_opt[USEROPT_AUTH][0]) { |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1198 debug_printf("setting text %s\n", user->proto_opt[USEROPT_AUTH]); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1199 gtk_entry_set_text(GTK_ENTRY(entry), user->proto_opt[USEROPT_AUTH]); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1200 } else |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1201 gtk_entry_set_text(GTK_ENTRY(entry), "toc.oscar.aol.com"); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1202 gtk_widget_show(entry); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1203 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1204 hbox = gtk_hbox_new(FALSE, 0); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1205 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1206 gtk_widget_show(hbox); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1207 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1208 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1209 label = gtk_label_new("TOC Port:"); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1210 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1211 gtk_widget_show(label); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1212 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1213 entry = gtk_entry_new(); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1214 gtk_box_pack_end(GTK_BOX(hbox), entry, FALSE, FALSE, 5); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1215 gtk_object_set_user_data(GTK_OBJECT(entry), (void *)1); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1216 gtk_signal_connect(GTK_OBJECT(entry), "changed", |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1217 GTK_SIGNAL_FUNC(toc_print_option), user); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1218 if (user->proto_opt[USEROPT_AUTHPORT][0]) { |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1219 debug_printf("setting text %s\n", user->proto_opt[USEROPT_AUTHPORT]); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1220 gtk_entry_set_text(GTK_ENTRY(entry), user->proto_opt[USEROPT_AUTHPORT]); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1221 } else |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1222 gtk_entry_set_text(GTK_ENTRY(entry), "9898"); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1223 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1224 gtk_widget_show(entry); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1225 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1226 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1227 hbox = gtk_hbox_new(FALSE, 0); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1228 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1229 gtk_widget_show(hbox); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1230 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1231 label = gtk_label_new("Proxy Host:"); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1232 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1233 gtk_widget_show(label); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1234 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1235 entry = gtk_entry_new(); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1236 gtk_box_pack_end(GTK_BOX(hbox), entry, FALSE, FALSE, 5); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1237 gtk_object_set_user_data(GTK_OBJECT(entry), (void *)USEROPT_SOCKSHOST); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1238 gtk_signal_connect(GTK_OBJECT(entry), "changed", |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1239 GTK_SIGNAL_FUNC(toc_print_option), user); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1240 if (user->proto_opt[USEROPT_SOCKSHOST][0]) { |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1241 debug_printf("setting text %s\n", user->proto_opt[USEROPT_SOCKSHOST]); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1242 gtk_entry_set_text(GTK_ENTRY(entry), user->proto_opt[USEROPT_SOCKSHOST]); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1243 } |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1244 gtk_widget_show(entry); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1245 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1246 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1247 hbox = gtk_hbox_new(FALSE, 0); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1248 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1249 gtk_widget_show(hbox); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1250 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1251 label = gtk_label_new("Proxy Port:"); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1252 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1253 gtk_widget_show(label); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1254 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1255 entry = gtk_entry_new(); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1256 gtk_box_pack_end(GTK_BOX(hbox), entry, FALSE, FALSE, 5); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1257 gtk_object_set_user_data(GTK_OBJECT(entry), (void *)USEROPT_SOCKSPORT); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1258 gtk_signal_connect(GTK_OBJECT(entry), "changed", |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1259 GTK_SIGNAL_FUNC(toc_print_option), user); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1260 if (user->proto_opt[USEROPT_SOCKSPORT][0]) { |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1261 debug_printf("setting text %s\n", user->proto_opt[USEROPT_SOCKSPORT]); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1262 gtk_entry_set_text(GTK_ENTRY(entry), user->proto_opt[USEROPT_SOCKSPORT]); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1263 } |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1264 gtk_widget_show(entry); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1265 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1266 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1267 first = gtk_radio_button_new_with_label(NULL, "No proxy"); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1268 gtk_box_pack_start(GTK_BOX(vbox), first, FALSE, FALSE, 0); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1269 gtk_object_set_user_data(GTK_OBJECT(first), (void *)PROXY_NONE); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1270 gtk_signal_connect(GTK_OBJECT(first), "clicked", GTK_SIGNAL_FUNC(toc_print_optionrad), user); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1271 gtk_widget_show(first); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1272 if (atoi(user->proto_opt[USEROPT_PROXYTYPE]) == PROXY_NONE) |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1273 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(first), TRUE); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1274 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1275 opt = gtk_radio_button_new_with_label(gtk_radio_button_group(GTK_RADIO_BUTTON(first)), "SOCKS 4"); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1276 gtk_box_pack_start(GTK_BOX(vbox), opt, FALSE, FALSE, 0); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1277 gtk_object_set_user_data(GTK_OBJECT(opt), (void *)PROXY_SOCKS4); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1278 gtk_signal_connect(GTK_OBJECT(opt), "clicked", GTK_SIGNAL_FUNC(toc_print_optionrad), user); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1279 gtk_widget_show(opt); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1280 if (atoi(user->proto_opt[USEROPT_PROXYTYPE]) == PROXY_SOCKS4) |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1281 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(opt), TRUE); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1282 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1283 opt = gtk_radio_button_new_with_label(gtk_radio_button_group(GTK_RADIO_BUTTON(first)), "SOCKS 5"); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1284 gtk_box_pack_start(GTK_BOX(vbox), opt, FALSE, FALSE, 0); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1285 gtk_object_set_user_data(GTK_OBJECT(opt), (void *)PROXY_SOCKS5); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1286 gtk_signal_connect(GTK_OBJECT(opt), "clicked", GTK_SIGNAL_FUNC(toc_print_optionrad), user); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1287 gtk_widget_show(opt); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1288 if (atoi(user->proto_opt[USEROPT_PROXYTYPE]) == PROXY_SOCKS5) |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1289 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(opt), TRUE); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1290 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1291 opt = gtk_radio_button_new_with_label(gtk_radio_button_group(GTK_RADIO_BUTTON(first)), "HTTP"); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1292 gtk_box_pack_start(GTK_BOX(vbox), opt, FALSE, FALSE, 0); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1293 gtk_object_set_user_data(GTK_OBJECT(opt), (void *)PROXY_HTTP); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1294 gtk_signal_connect(GTK_OBJECT(opt), "clicked", GTK_SIGNAL_FUNC(toc_print_optionrad), user); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1295 gtk_widget_show(opt); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1296 if (atoi(user->proto_opt[USEROPT_PROXYTYPE]) == PROXY_HTTP) |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1297 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(opt), TRUE); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1298 } |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1299 |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
1300 void toc_init(struct prpl *ret) { |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1301 ret->protocol = PROTO_TOC; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1302 ret->name = toc_name; |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1303 ret->list_icon = toc_list_icon; |
1032
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1304 ret->action_menu = toc_action_menu; |
1087
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1305 ret->user_opts = toc_user_opts; |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1306 ret->login = toc_login; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1307 ret->close = toc_close; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1308 ret->send_im = toc_send_im; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1309 ret->set_info = toc_set_info; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1310 ret->get_info = toc_get_info; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1311 ret->set_away = toc_set_away; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1312 ret->get_away_msg = NULL; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1313 ret->set_dir = toc_set_dir; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1314 ret->get_dir = toc_get_dir; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1315 ret->dir_search = toc_dir_search; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1316 ret->set_idle = toc_set_idle; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1317 ret->change_passwd = toc_change_passwd; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1318 ret->add_buddy = toc_add_buddy; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1319 ret->add_buddies = toc_add_buddies; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1320 ret->remove_buddy = toc_remove_buddy; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1321 ret->add_permit = NULL; /* FIXME */ |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1322 ret->add_deny = NULL; |
1038
daad2440a642
[gaim-migrate @ 1048]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1032
diff
changeset
|
1323 ret->rem_permit = NULL; |
daad2440a642
[gaim-migrate @ 1048]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1032
diff
changeset
|
1324 ret->rem_deny = NULL; |
daad2440a642
[gaim-migrate @ 1048]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1032
diff
changeset
|
1325 ret->set_permit_deny = NULL; |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1326 ret->warn = toc_warn; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1327 ret->accept_chat = toc_accept_chat; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1328 ret->join_chat = toc_join_chat; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1329 ret->chat_invite = toc_chat_invite; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1330 ret->chat_leave = toc_chat_leave; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1331 ret->chat_whisper = toc_chat_whisper; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1332 ret->chat_send = toc_chat_send; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1333 ret->keepalive = toc_keepalive; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1334 } |