Mercurial > pidgin
annotate src/toc.c @ 1398:f6b0cf1f4c3b
[gaim-migrate @ 1408]
yay, right-click menus in chat
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Tue, 09 Jan 2001 10:03:48 +0000 |
parents | 829242e7348c |
children | bf041349b11e |
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" |
1087
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
41 #include "proxy.h" |
1 | 42 |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
43 #include "pixmaps/admin_icon.xpm" |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
44 #include "pixmaps/aol_icon.xpm" |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
45 #include "pixmaps/away_icon.xpm" |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
46 #include "pixmaps/dt_icon.xpm" |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
47 #include "pixmaps/free_icon.xpm" |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
48 |
1383
829242e7348c
[gaim-migrate @ 1393]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1370
diff
changeset
|
49 #define REVISION "gaim:$Revision: 1393 $" |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
50 |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
51 #define TYPE_SIGNON 1 |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
52 #define TYPE_DATA 2 |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
53 #define TYPE_ERROR 3 |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
54 #define TYPE_SIGNOFF 4 |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
55 #define TYPE_KEEPALIVE 5 |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
56 |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
57 #define FLAPON "FLAPON\r\n\r\n" |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
58 #define ROAST "Tic/Toc" |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
59 |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
60 #define TOC_HOST "toc.oscar.aol.com" |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
61 #define TOC_PORT 9898 |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
62 #define AUTH_HOST "login.oscar.aol.com" |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
63 #define AUTH_PORT 5190 |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
64 #define LANGUAGE "english" |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
65 |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
66 #define STATE_OFFLINE 0 |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
67 #define STATE_FLAPON 1 |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
68 #define STATE_SIGNON_REQUEST 2 |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
69 #define STATE_ONLINE 3 |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
70 #define STATE_PAUSE 4 |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
71 |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
72 struct toc_data { |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
73 int toc_fd; |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
74 int seqno; |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
75 int state; |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
76 }; |
1 | 77 |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
78 struct sflap_hdr { |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
79 unsigned char ast; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
80 unsigned char type; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
81 unsigned short seqno; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
82 unsigned short len; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
83 }; |
1 | 84 |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
85 struct signon { |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
86 unsigned int ver; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
87 unsigned short tag; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
88 unsigned short namelen; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
89 char username[80]; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
90 }; |
1 | 91 |
1087
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
92 /* constants to identify proto_opts */ |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
93 #define USEROPT_AUTH 0 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
94 #define USEROPT_AUTHPORT 1 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
95 #define USEROPT_SOCKSHOST 2 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
96 #define USEROPT_SOCKSPORT 3 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
97 #define USEROPT_PROXYTYPE 4 |
1 | 98 |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
99 static void toc_callback(gpointer, gint, GdkInputCondition); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
100 static unsigned char *roast_password(char *); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
101 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
102 /* 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
|
103 * 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
|
104 * on success. */ |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
105 static void toc_login(struct aim_user *user) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
106 { |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
107 struct gaim_connection *gc; |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
108 struct toc_data *tdt; |
1 | 109 char buf[80]; |
110 | |
1089
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1088
diff
changeset
|
111 gc = new_gaim_conn(user); |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
112 gc->proto_data = tdt = g_new0(struct toc_data, 1); |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
113 |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
114 g_snprintf(buf, sizeof buf, "Lookin up %s", |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
115 user->proto_opt[USEROPT_AUTH][0] ? user->proto_opt[USEROPT_AUTH] : TOC_HOST); |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
116 /* this is such a hack */ |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
117 set_login_progress(gc, 1, buf); |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
118 while (gtk_events_pending()) |
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
119 gtk_main_iteration(); |
1089
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1088
diff
changeset
|
120 if (!g_slist_find(connections, gc)) |
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1088
diff
changeset
|
121 return; |
1 | 122 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
123 tdt->toc_fd = |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
124 proxy_connect(user->proto_opt[USEROPT_AUTH][0] ? user->proto_opt[USEROPT_AUTH] : TOC_HOST, |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
125 user->proto_opt[USEROPT_AUTHPORT][0] ? atoi(user-> |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
126 proto_opt[USEROPT_AUTHPORT]) : |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
127 TOC_PORT, user->proto_opt[USEROPT_SOCKSHOST], |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
128 atoi(user->proto_opt[USEROPT_SOCKSPORT]), |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
129 atoi(user->proto_opt[USEROPT_PROXYTYPE])); |
1 | 130 |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
131 debug_printf("* Client connects to TOC\n"); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
132 if (tdt->toc_fd < 0) { |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
133 g_snprintf(buf, sizeof(buf), "Connect to %s failed", user->proto_opt[USEROPT_AUTH]); |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
134 hide_login_progress(gc, buf); |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
135 signoff(gc); |
980
82c5865f7cfe
[gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
978
diff
changeset
|
136 return; |
1 | 137 } |
138 | |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
139 debug_printf("* Client sends \"FLAPON\\r\\n\\r\\n\"\n"); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
140 if (write(tdt->toc_fd, FLAPON, strlen(FLAPON)) < 0) { |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
141 hide_login_progress(gc, "Disconnected."); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
142 signoff(gc); |
1089
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1088
diff
changeset
|
143 return; |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
144 } |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
145 tdt->state = STATE_FLAPON; |
1 | 146 |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
147 /* i know a lot of people like to look at gaim to see how TOC works. so i'll comment |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
148 * on what this does. it's really simple. when there's data ready to be read from the |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
149 * toc_fd file descriptor, toc_callback is called, with gc passed as its data arg. */ |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
150 gc->inpa = gdk_input_add(tdt->toc_fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION, toc_callback, gc); |
1 | 151 |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
152 g_snprintf(buf, sizeof(buf), "Signon: %s", gc->username); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
153 set_login_progress(gc, 2, buf); |
1 | 154 } |
155 | |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
156 static void toc_close(struct gaim_connection *gc) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
157 { |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
158 if (gc->inpa > 0) |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
159 gdk_input_remove(gc->inpa); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
940
diff
changeset
|
160 gc->inpa = -1; |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
161 close(((struct toc_data *)gc->proto_data)->toc_fd); |
1 | 162 } |
163 | |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
164 int sflap_send(struct gaim_connection *gc, char *buf, int olen, int type) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
165 { |
1 | 166 int len; |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
167 int slen = 0; |
1 | 168 struct sflap_hdr hdr; |
169 char obuf[MSG_LEN]; | |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
170 struct toc_data *tdt = (struct toc_data *)gc->proto_data; |
1 | 171 |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
172 if (tdt->state == STATE_PAUSE) |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
173 /* TOC has given us the PAUSE message; sending could cause a disconnect |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
174 * so we just return here like everything went through fine */ |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
175 return 0; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
176 |
970 | 177 /* One _last_ 2048 check here! This shouldn't ever |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
178 * get hit though, hopefully. If it gets hit on an IM |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
179 * It'll lose the last " and the message won't go through, |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
180 * but this'll stop a segfault. */ |
970 | 181 if (strlen(buf) > (MSG_LEN - sizeof(hdr))) { |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
182 debug_printf("message too long, truncating\n"); |
970 | 183 buf[MSG_LEN - sizeof(hdr) - 3] = '"'; |
184 buf[MSG_LEN - sizeof(hdr) - 2] = '\0'; | |
185 } | |
1 | 186 |
187 if (olen < 0) | |
188 len = escape_message(buf); | |
189 else | |
190 len = olen; | |
191 hdr.ast = '*'; | |
192 hdr.type = type; | |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
193 hdr.seqno = htons(tdt->seqno++ & 0xffff); |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
194 hdr.len = htons(len + (type == TYPE_SIGNON ? 0 : 1)); |
1 | 195 |
196 memcpy(obuf, &hdr, sizeof(hdr)); | |
197 slen += sizeof(hdr); | |
198 memcpy(&obuf[slen], buf, len); | |
199 slen += len; | |
200 if (type != TYPE_SIGNON) { | |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
201 obuf[slen] = '\0'; |
1 | 202 slen += 1; |
203 } | |
204 | |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
205 return write(tdt->toc_fd, obuf, slen); |
1 | 206 } |
207 | |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
208 static int wait_reply(struct gaim_connection *gc, char *buffer, size_t buflen) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
209 { |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
210 struct toc_data *tdt = (struct toc_data *)gc->proto_data; |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
211 struct sflap_hdr *hdr; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
212 int ret; |
1 | 213 |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
214 if (read(tdt->toc_fd, buffer, sizeof(struct sflap_hdr)) < 0) { |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
215 debug_printf("error, couldn't read flap header\n"); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
216 return -1; |
79 | 217 } |
218 | |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
219 hdr = (struct sflap_hdr *)buffer; |
1 | 220 |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
221 if (buflen < ntohs(hdr->len)) { |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
222 /* fake like there's a read error */ |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
223 debug_printf("buffer too small (have %d, need %d)\n", buflen, ntohs(hdr->len)); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
224 return -1; |
1 | 225 } |
226 | |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
227 if (ntohs(hdr->len) > 0) { |
1234
cedf7047081e
[gaim-migrate @ 1244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1208
diff
changeset
|
228 int count = 0; |
cedf7047081e
[gaim-migrate @ 1244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1208
diff
changeset
|
229 ret = 0; |
cedf7047081e
[gaim-migrate @ 1244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1208
diff
changeset
|
230 do { |
cedf7047081e
[gaim-migrate @ 1244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1208
diff
changeset
|
231 count += ret; |
cedf7047081e
[gaim-migrate @ 1244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1208
diff
changeset
|
232 ret = read(tdt->toc_fd, |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
233 buffer + sizeof(struct sflap_hdr) + count, ntohs(hdr->len)); |
1234
cedf7047081e
[gaim-migrate @ 1244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1208
diff
changeset
|
234 } while (count + ret < ntohs(hdr->len) && ret > 0); |
cedf7047081e
[gaim-migrate @ 1244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1208
diff
changeset
|
235 buffer[sizeof(struct sflap_hdr) + count + ret] = '\0'; |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
236 return ret; |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
237 } else |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
238 return 0; |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
239 } |
1 | 240 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
241 static unsigned char *roast_password(char *pass) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
242 { |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
243 /* Trivial "encryption" */ |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
244 static char rp[256]; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
245 static char *roast = ROAST; |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
246 int pos = 2; |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
247 int x; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
248 strcpy(rp, "0x"); |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
249 for (x = 0; (x < 150) && pass[x]; x++) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
250 pos += sprintf(&rp[pos], "%02x", pass[x] ^ roast[x % strlen(roast)]); |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
251 rp[pos] = '\0'; |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
252 return rp; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
253 } |
1 | 254 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
255 static void toc_callback(gpointer data, gint source, GdkInputCondition condition) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
256 { |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
257 struct gaim_connection *gc = (struct gaim_connection *)data; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
258 struct toc_data *tdt = (struct toc_data *)gc->proto_data; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
259 struct sflap_hdr *hdr; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
260 struct signon so; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
261 char buf[8 * 1024], *c; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
262 char snd[MSG_LEN]; |
1 | 263 |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
264 if (condition & GDK_INPUT_EXCEPTION) { |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
265 debug_printf("gdk_input exception! check internet connection\n"); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
266 hide_login_progress(gc, _("Connection Closed")); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
267 signoff(gc); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
268 return; |
79 | 269 } |
1 | 270 |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
271 /* there's data waiting to be read, so read it. */ |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
272 if (wait_reply(gc, buf, 8 * 1024) < 0) { |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
273 hide_login_progress(gc, _("Connection Closed")); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
274 signoff(gc); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
275 return; |
1 | 276 } |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
277 |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
278 if (tdt->state == STATE_FLAPON) { |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
279 hdr = (struct sflap_hdr *)buf; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
280 if (hdr->type != TYPE_SIGNON) |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
281 debug_printf("problem, hdr->type != TYPE_SIGNON\n"); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
282 else |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
283 debug_printf("* TOC sends Client FLAP SIGNON\n"); |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
284 tdt->seqno = ntohs(hdr->seqno); |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
285 tdt->state = STATE_SIGNON_REQUEST; |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
286 |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
287 debug_printf("* Client sends TOC FLAP SIGNON\n"); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
288 g_snprintf(so.username, sizeof(so.username), "%s", gc->username); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
289 so.ver = htonl(1); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
290 so.tag = htons(1); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
291 so.namelen = htons(strlen(so.username)); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
292 if (sflap_send(gc, (char *)&so, ntohs(so.namelen) + 8, TYPE_SIGNON) < 0) { |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
293 hide_login_progress(gc, _("Disconnected.")); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
294 signoff(gc); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
295 return; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
296 } |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
297 |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
298 debug_printf("* Client sends TOC \"toc_signon\" message\n"); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
299 g_snprintf(snd, sizeof snd, "toc_signon %s %d %s %s %s \"%s\"", |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
300 AUTH_HOST, AUTH_PORT, normalize(gc->username), |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
301 roast_password(gc->password), LANGUAGE, REVISION); |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
302 if (sflap_send(gc, snd, -1, TYPE_DATA) < 0) { |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
303 hide_login_progress(gc, _("Disconnected.")); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
304 signoff(gc); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
305 return; |
1 | 306 } |
307 | |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
308 set_login_progress(gc, 3, _("Waiting for reply...")); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
309 return; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
310 } |
1 | 311 |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
312 if (tdt->state == STATE_SIGNON_REQUEST) { |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
313 debug_printf("* TOC sends client SIGN_ON reply\n"); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
314 if (strncasecmp(buf + sizeof(struct sflap_hdr), "SIGN_ON", strlen("SIGN_ON"))) { |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
315 debug_printf("Didn't get SIGN_ON! buf was: %s\n", |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
316 buf + sizeof(struct sflap_hdr)); |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
317 hide_login_progress(gc, _("Authentication Failed")); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
318 signoff(gc); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
319 return; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
320 } |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
321 /* we're supposed to check that it's really TOC v1 here but we know it is ;) */ |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
322 debug_printf("TOC version: %s\n", buf + sizeof(struct sflap_hdr) + 4); |
1 | 323 |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
324 /* we used to check for the CONFIG here, but we'll wait until we've sent our |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
325 * version of the config and then the toc_init_done message. we'll come back to |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
326 * the callback in a better state if we get CONFIG anyway */ |
1 | 327 |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
328 tdt->state = STATE_ONLINE; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
329 |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
330 account_online(gc); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
331 serv_finish_login(gc); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
332 |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
333 do_import(0, gc); |
1 | 334 |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
335 /* Client sends TOC toc_init_done message */ |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
336 debug_printf("* Client sends TOC toc_init_done message\n"); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
337 g_snprintf(snd, sizeof snd, "toc_init_done"); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
338 sflap_send(gc, snd, -1, TYPE_DATA); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
339 |
1383
829242e7348c
[gaim-migrate @ 1393]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1370
diff
changeset
|
340 g_snprintf(snd, sizeof snd, "toc_set_caps %s %s", |
829242e7348c
[gaim-migrate @ 1393]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1370
diff
changeset
|
341 FILE_SEND_UID, FILE_GET_UID); |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
342 sflap_send(gc, snd, -1, TYPE_DATA); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
343 |
1 | 344 return; |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
345 } |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
346 |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
347 debug_printf("From TOC server: %s\n", buf + sizeof(struct sflap_hdr)); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
348 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
349 c = strtok(buf + sizeof(struct sflap_hdr), ":"); /* Ditch the first part */ |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
350 |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
351 if (!strcasecmp(c, "SIGN_ON")) { |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
352 /* we should only get here after a PAUSE */ |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
353 if (tdt->state != STATE_PAUSE) |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
354 debug_printf("got SIGN_ON but not PAUSE!\n"); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
355 else { |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
356 tdt->state = STATE_ONLINE; |
1146
22f3c32a28f6
[gaim-migrate @ 1156]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1145
diff
changeset
|
357 g_snprintf(snd, sizeof snd, "toc_signon %s %d %s %s %s \"%s\"", |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
358 AUTH_HOST, AUTH_PORT, normalize(gc->username), |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
359 roast_password(gc->password), LANGUAGE, REVISION); |
1146
22f3c32a28f6
[gaim-migrate @ 1156]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1145
diff
changeset
|
360 if (sflap_send(gc, snd, -1, TYPE_DATA) < 0) { |
22f3c32a28f6
[gaim-migrate @ 1156]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1145
diff
changeset
|
361 hide_login_progress(gc, _("Disconnected.")); |
22f3c32a28f6
[gaim-migrate @ 1156]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1145
diff
changeset
|
362 signoff(gc); |
22f3c32a28f6
[gaim-migrate @ 1156]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1145
diff
changeset
|
363 return; |
22f3c32a28f6
[gaim-migrate @ 1156]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1145
diff
changeset
|
364 } |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
365 do_import(0, gc); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
366 g_snprintf(snd, sizeof snd, "toc_init_done"); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
367 sflap_send(gc, snd, -1, TYPE_DATA); |
1146
22f3c32a28f6
[gaim-migrate @ 1156]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1145
diff
changeset
|
368 do_error_dialog(_("TOC has come back from its pause. You may now send" |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
369 " messages again."), _("TOC Resume")); |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
370 } |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
371 } else if (!strcasecmp(c, "CONFIG")) { |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
372 c = strtok(NULL, ":"); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
373 parse_toc_buddy_list(gc, c, 0); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
374 } else if (!strcasecmp(c, "NICK")) { |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
375 c = strtok(NULL, ":"); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
376 g_snprintf(gc->username, sizeof(gc->username), "%s", c); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
377 } else if (!strcasecmp(c, "IM_IN")) { |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
378 char *away, *message; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
379 int a = 0; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
380 |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
381 c = strtok(NULL, ":"); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
382 away = strtok(NULL, ":"); |
1112
3f56704a09bd
[gaim-migrate @ 1122]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1106
diff
changeset
|
383 |
3f56704a09bd
[gaim-migrate @ 1122]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1106
diff
changeset
|
384 message = away; |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
385 while (*message && (*message != ':')) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
386 message++; |
1112
3f56704a09bd
[gaim-migrate @ 1122]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1106
diff
changeset
|
387 message++; |
3f56704a09bd
[gaim-migrate @ 1122]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1106
diff
changeset
|
388 |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
389 a = (away && (*away == 'T')) ? 1 : 0; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
390 |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
391 serv_got_im(gc, c, message, a); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
392 } else if (!strcasecmp(c, "UPDATE_BUDDY")) { |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
393 char *l, *uc; |
1 | 394 int logged, evil, idle, type = 0; |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
395 time_t signon, time_idle; |
1 | 396 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
397 c = strtok(NULL, ":"); /* name */ |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
398 l = strtok(NULL, ":"); /* online */ |
1 | 399 sscanf(strtok(NULL, ":"), "%d", &evil); |
1114
c61f9c384413
[gaim-migrate @ 1124]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1113
diff
changeset
|
400 sscanf(strtok(NULL, ":"), "%ld", &signon); |
1 | 401 sscanf(strtok(NULL, ":"), "%d", &idle); |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
402 uc = strtok(NULL, ":"); |
1 | 403 |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
404 logged = (l && (*l == 'T')) ? 1 : 0; |
1 | 405 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
406 if (uc[0] == 'A') |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
407 type |= UC_AOL; |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
408 switch (uc[1]) { |
1 | 409 case 'A': |
410 type |= UC_ADMIN; | |
411 break; | |
412 case 'U': | |
413 type |= UC_UNCONFIRMED; | |
414 break; | |
415 case 'O': | |
416 type |= UC_NORMAL; | |
417 break; | |
418 default: | |
419 break; | |
420 } | |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
421 if (uc[2] == 'U') |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
422 type |= UC_UNAVAILABLE; |
1 | 423 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
424 if (idle) { |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
425 time(&time_idle); |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
426 time_idle -= idle * 60; |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
427 } else |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
428 time_idle = 0; |
1 | 429 |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
430 serv_got_update(gc, c, logged, evil, signon, time_idle, type, 0); |
1 | 431 } else if (!strcasecmp(c, "ERROR")) { |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
432 c = strtok(NULL, ":"); |
1 | 433 show_error_dialog(c); |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
434 } else if (!strcasecmp(c, "EVILED")) { |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
435 int lev; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
436 char *name; |
1 | 437 |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
438 sscanf(strtok(NULL, ":"), "%d", &lev); |
1 | 439 name = strtok(NULL, ":"); |
440 | |
1100
f168625b63fe
[gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1089
diff
changeset
|
441 serv_got_eviled(gc, name, lev); |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
442 } else if (!strcasecmp(c, "CHAT_JOIN")) { |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
443 char *name; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
444 int id; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
445 |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
446 sscanf(strtok(NULL, ":"), "%d", &id); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
447 name = strtok(NULL, ":"); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
448 |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
449 serv_got_joined_chat(gc, id, name); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
450 } else if (!strcasecmp(c, "CHAT_IN")) { |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
451 int id, w; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
452 char *m, *who, *whisper; |
1 | 453 |
454 sscanf(strtok(NULL, ":"), "%d", &id); | |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
455 who = strtok(NULL, ":"); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
456 whisper = strtok(NULL, ":"); |
1112
3f56704a09bd
[gaim-migrate @ 1122]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1106
diff
changeset
|
457 m = whisper; |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
458 while (*m && (*m != ':')) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
459 m++; |
1112
3f56704a09bd
[gaim-migrate @ 1122]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1106
diff
changeset
|
460 m++; |
1 | 461 |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
462 w = (whisper && (*whisper == 'T')) ? 1 : 0; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
463 |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
464 serv_got_chat_in(gc, id, who, w, m); |
1 | 465 } else if (!strcasecmp(c, "CHAT_UPDATE_BUDDY")) { |
466 int id; | |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
467 char *in, *buddy; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
468 GSList *bcs = gc->buddy_chats; |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
447
diff
changeset
|
469 struct conversation *b = NULL; |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
470 |
1 | 471 sscanf(strtok(NULL, ":"), "%d", &id); |
472 in = strtok(NULL, ":"); | |
473 | |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
474 while (bcs) { |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
447
diff
changeset
|
475 b = (struct conversation *)bcs->data; |
1 | 476 if (id == b->id) |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
477 break; |
1 | 478 bcs = bcs->next; |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
479 b = NULL; |
44 | 480 } |
1 | 481 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
482 if (!b) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
483 return; |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
484 |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
485 if (in && (*in == 'T')) |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
486 while ((buddy = strtok(NULL, ":")) != NULL) |
1 | 487 add_chat_buddy(b, buddy); |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
488 else |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
489 while ((buddy = strtok(NULL, ":")) != NULL) |
1 | 490 remove_chat_buddy(b, buddy); |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
491 } else if (!strcasecmp(c, "CHAT_INVITE")) { |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
492 char *name, *who, *message; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
493 int id; |
1 | 494 |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
495 name = strtok(NULL, ":"); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
496 sscanf(strtok(NULL, ":"), "%d", &id); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
497 who = strtok(NULL, ":"); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
498 message = strtok(NULL, ":"); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
499 |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
500 serv_got_chat_invite(gc, name, id, who, message); |
1 | 501 } else if (!strcasecmp(c, "CHAT_LEFT")) { |
1182
bab9f3dc07f8
[gaim-migrate @ 1192]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
502 GSList *bcs = gc->buddy_chats; |
bab9f3dc07f8
[gaim-migrate @ 1192]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
503 struct conversation *b = NULL; |
1 | 504 int id; |
505 | |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
506 sscanf(strtok(NULL, ":"), "%d", &id); |
1 | 507 |
1182
bab9f3dc07f8
[gaim-migrate @ 1192]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
508 while (bcs) { |
bab9f3dc07f8
[gaim-migrate @ 1192]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
509 b = (struct conversation *)bcs->data; |
bab9f3dc07f8
[gaim-migrate @ 1192]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
510 if (id == b->id) |
bab9f3dc07f8
[gaim-migrate @ 1192]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
511 break; |
bab9f3dc07f8
[gaim-migrate @ 1192]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
512 b = NULL; |
bab9f3dc07f8
[gaim-migrate @ 1192]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
513 bcs = bcs->next; |
bab9f3dc07f8
[gaim-migrate @ 1192]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
514 } |
bab9f3dc07f8
[gaim-migrate @ 1192]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
515 |
bab9f3dc07f8
[gaim-migrate @ 1192]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
516 if (!b) |
bab9f3dc07f8
[gaim-migrate @ 1192]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
517 return; |
bab9f3dc07f8
[gaim-migrate @ 1192]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
518 |
bab9f3dc07f8
[gaim-migrate @ 1192]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
519 if (b->window) { |
bab9f3dc07f8
[gaim-migrate @ 1192]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
520 char error_buf[BUF_LONG]; |
bab9f3dc07f8
[gaim-migrate @ 1192]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
521 b->gc = NULL; |
bab9f3dc07f8
[gaim-migrate @ 1192]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
522 g_snprintf(error_buf, sizeof error_buf, _("You have been disconnected" |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
523 " from chat room %s."), b->name); |
1182
bab9f3dc07f8
[gaim-migrate @ 1192]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
524 } else |
bab9f3dc07f8
[gaim-migrate @ 1192]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
525 serv_got_chat_left(gc, id); |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
526 } else if (!strcasecmp(c, "GOTO_URL")) { |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
527 char *name, *url, tmp[256]; |
1 | 528 |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
529 name = strtok(NULL, ":"); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
530 url = strtok(NULL, ":"); |
1 | 531 |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
532 g_snprintf(tmp, sizeof(tmp), "http://%s:%d/%s", TOC_HOST, TOC_PORT, url); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
533 g_show_info(gc->user, tmp); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
534 } else if (!strcasecmp(c, "DIR_STATUS")) { |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
535 } else if (!strcasecmp(c, "ADMIN_NICK_STATUS")) { |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
536 } else if (!strcasecmp(c, "ADMIN_PASSWD_STATUS")) { |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
537 do_error_dialog(_("Password Change Successeful"), _("Gaim - Password Change")); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
538 } else if (!strcasecmp(c, "PAUSE")) { |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
539 tdt->state = STATE_PAUSE; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
540 do_error_dialog(_("TOC has sent a PAUSE command. When this happens, TOC ignores" |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
541 " any messages sent to it, and may kick you off if you send a" |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
542 " message. Gaim will prevent anything from going through. This" |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
543 " is only temporary, please be patient."), _("TOC Pause")); |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
544 } else if (!strcasecmp(c, "RVOUS_PROPOSE")) { |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
545 char *user, *uuid, *cookie; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
546 int seq; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
547 char *rip, *pip, *vip; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
548 int port; |
1 | 549 |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
550 user = strtok(NULL, ":"); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
551 uuid = strtok(NULL, ":"); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
552 cookie = strtok(NULL, ":"); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
553 sscanf(strtok(NULL, ":"), "%d", &seq); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
554 rip = strtok(NULL, ":"); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
555 pip = strtok(NULL, ":"); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
556 vip = strtok(NULL, ":"); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
557 sscanf(strtok(NULL, ":"), "%d", &port); |
1 | 558 |
197
24f0fef56a73
[gaim-migrate @ 207]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
196
diff
changeset
|
559 if (!strcmp(uuid, FILE_SEND_UID)) { |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
560 /* they want us to get a file */ |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
561 int unk[4], i; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
562 char *messages[4], *tmp, *name; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
563 int subtype, files, totalsize = 0; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
564 struct file_transfer *ft; |
196
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
565 |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
566 for (i = 0; i < 4; i++) { |
1113
4efa1ca61a2a
[gaim-migrate @ 1123]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1112
diff
changeset
|
567 sscanf(strtok(NULL, ":"), "%d", &unk[i]); |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
568 if (unk[i] == 10001) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
569 break; |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
570 messages[i] = frombase64(strtok(NULL, ":")); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
571 } |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
572 tmp = frombase64(strtok(NULL, ":")); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
573 |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
574 subtype = tmp[1]; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
575 files = tmp[3]; |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
576 |
196
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
577 totalsize |= (tmp[4] << 24) & 0xff000000; |
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
578 totalsize |= (tmp[5] << 16) & 0x00ff0000; |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
579 totalsize |= (tmp[6] << 8) & 0x0000ff00; |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
580 totalsize |= (tmp[7] << 0) & 0x000000ff; |
196
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
581 |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
582 if (!totalsize) { |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
583 g_free(tmp); |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
584 for (i--; i >= 0; i--) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
585 g_free(messages[i]); |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
586 return; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
587 } |
196
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
588 |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
589 name = tmp + 8; |
1 | 590 |
198
73e9a0bfff62
[gaim-migrate @ 208]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
197
diff
changeset
|
591 ft = g_new0(struct file_transfer, 1); |
73e9a0bfff62
[gaim-migrate @ 208]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
197
diff
changeset
|
592 ft->cookie = g_strdup(cookie); |
73e9a0bfff62
[gaim-migrate @ 208]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
197
diff
changeset
|
593 ft->ip = g_strdup(pip); |
73e9a0bfff62
[gaim-migrate @ 208]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
197
diff
changeset
|
594 ft->port = port; |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
595 if (i) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
596 ft->message = g_strdup(messages[0]); |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
597 else |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
598 ft->message = NULL; |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
599 ft->filename = g_strdup(name); |
198
73e9a0bfff62
[gaim-migrate @ 208]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
197
diff
changeset
|
600 ft->user = g_strdup(user); |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
601 ft->size = totalsize; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
602 g_snprintf(ft->UID, sizeof(ft->UID), "%s", FILE_SEND_UID); |
978
563c409e26a1
[gaim-migrate @ 988]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
976
diff
changeset
|
603 ft->gc = gc; |
198
73e9a0bfff62
[gaim-migrate @ 208]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
197
diff
changeset
|
604 |
73e9a0bfff62
[gaim-migrate @ 208]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
197
diff
changeset
|
605 g_free(tmp); |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
606 for (i--; i >= 0; i--) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
607 g_free(messages[i]); |
198
73e9a0bfff62
[gaim-migrate @ 208]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
197
diff
changeset
|
608 |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
609 accept_file_dialog(ft); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
610 } else if (!strcmp(uuid, FILE_GET_UID)) { |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
611 /* they want us to send a file */ |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
612 int unk[4], i; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
613 char *messages[4], *tmp; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
614 struct file_transfer *ft; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
615 |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
616 for (i = 0; i < 4; i++) { |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
617 sscanf(strtok(NULL, ":"), "%d", unk + i); |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
618 if (unk[i] == 10001) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
619 break; |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
620 messages[i] = frombase64(strtok(NULL, ":")); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
621 } |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
622 tmp = frombase64(strtok(NULL, ":")); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
623 |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
624 ft = g_new0(struct file_transfer, 1); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
625 ft->cookie = g_strdup(cookie); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
626 ft->ip = g_strdup(pip); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
627 ft->port = port; |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
628 if (i) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
629 ft->message = g_strdup(messages[0]); |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
630 else |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
631 ft->message = NULL; |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
632 ft->user = g_strdup(user); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
633 g_snprintf(ft->UID, sizeof(ft->UID), "%s", FILE_GET_UID); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
634 ft->gc = gc; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
635 |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
636 g_free(tmp); |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
637 for (i--; i >= 0; i--) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
638 g_free(messages[i]); |
198
73e9a0bfff62
[gaim-migrate @ 208]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
197
diff
changeset
|
639 |
73e9a0bfff62
[gaim-migrate @ 208]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
197
diff
changeset
|
640 accept_file_dialog(ft); |
369
cf895313fc50
[gaim-migrate @ 379]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
351
diff
changeset
|
641 } else if (!strcmp(uuid, VOICE_UID)) { |
cf895313fc50
[gaim-migrate @ 379]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
351
diff
changeset
|
642 /* oh goody. voice over ip. fun stuff. */ |
196
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
643 } else if (!strcmp(uuid, B_ICON_UID)) { |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
644 /* buddy icon... */ |
196
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
645 } else if (!strcmp(uuid, IMAGE_UID)) { |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
646 /* aka Direct IM */ |
196
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
647 } else { |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
648 debug_printf("Don't know what to do with RVOUS UUID %s\n", uuid); |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
649 /* do we have to do anything here? i think it just times out */ |
196
3042e11c1902
[gaim-migrate @ 206]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
194
diff
changeset
|
650 } |
1 | 651 } else { |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
652 debug_printf("don't know what to do with %s\n", c); |
1 | 653 } |
654 } | |
655 | |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
656 static char *toc_name() |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
657 { |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
658 return "TOC"; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
659 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
660 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
661 static void toc_send_im(struct gaim_connection *gc, char *name, char *message, int away) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
662 { |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
663 char buf[MSG_LEN - 7]; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
664 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
665 escape_text(message); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
666 g_snprintf(buf, MSG_LEN - 8, "toc_send_im %s \"%s\"%s", normalize(name), |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
667 message, ((away) ? " auto" : "")); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
668 sflap_send(gc, buf, -1, TYPE_DATA); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
669 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
670 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
671 static void toc_set_config(struct gaim_connection *gc) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
672 { |
1118
e1078ee286ba
[gaim-migrate @ 1128]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
673 char buf[MSG_LEN], snd[MSG_LEN]; |
e1078ee286ba
[gaim-migrate @ 1128]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
674 toc_build_config(gc, buf, MSG_LEN, FALSE); |
e1078ee286ba
[gaim-migrate @ 1128]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
675 g_snprintf(snd, MSG_LEN, "toc_set_config \"%s\"", buf); |
e1078ee286ba
[gaim-migrate @ 1128]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
676 sflap_send(gc, snd, -1, TYPE_DATA); |
e1078ee286ba
[gaim-migrate @ 1128]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
677 } |
e1078ee286ba
[gaim-migrate @ 1128]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
678 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
679 static void toc_get_info(struct gaim_connection *g, char *name) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
680 { |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
681 char buf[MSG_LEN]; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
682 g_snprintf(buf, MSG_LEN, "toc_get_info %s", normalize(name)); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
683 sflap_send(g, buf, -1, TYPE_DATA); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
684 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
685 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
686 static void toc_get_dir(struct gaim_connection *g, char *name) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
687 { |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
688 char buf[MSG_LEN]; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
689 g_snprintf(buf, MSG_LEN, "toc_get_dir %s", normalize(name)); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
690 sflap_send(g, buf, -1, TYPE_DATA); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
691 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
692 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
693 static void toc_set_dir(struct gaim_connection *g, char *first, char *middle, char *last, |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
694 char *maiden, char *city, char *state, char *country, int web) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
695 { |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
696 char buf2[BUF_LEN * 4], buf[BUF_LEN]; |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
697 g_snprintf(buf2, sizeof(buf2), "%s:%s:%s:%s:%s:%s:%s:%s", first, |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
698 middle, last, maiden, city, state, country, (web == 1) ? "Y" : ""); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
699 escape_text(buf2); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
700 g_snprintf(buf, sizeof(buf), "toc_set_dir %s", buf2); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
701 sflap_send(g, buf, -1, TYPE_DATA); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
702 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
703 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
704 static void toc_dir_search(struct gaim_connection *g, char *first, char *middle, char *last, |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
705 char *maiden, char *city, char *state, char *country, char *email) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
706 { |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
707 char buf[BUF_LONG]; |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
708 g_snprintf(buf, sizeof(buf) / 2, "toc_dir_search %s:%s:%s:%s:%s:%s:%s:%s", first, middle, |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
709 last, maiden, city, state, country, email); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1234
diff
changeset
|
710 debug_printf("Searching for: %s,%s,%s,%s,%s,%s,%s\n", first, middle, last, maiden, |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
711 city, state, country); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
712 sflap_send(g, buf, -1, TYPE_DATA); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
713 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
714 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
715 static void toc_set_away(struct gaim_connection *g, char *message) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
716 { |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
717 char buf[MSG_LEN]; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
718 if (message) { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
719 escape_text(message); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
720 g_snprintf(buf, MSG_LEN, "toc_set_away \"%s\"", message); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
721 } else |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
722 g_snprintf(buf, MSG_LEN, "toc_set_away \"\""); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
723 sflap_send(g, buf, -1, TYPE_DATA); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
724 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
725 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
726 static void toc_set_info(struct gaim_connection *g, char *info) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
727 { |
1368
12365cb601cb
[gaim-migrate @ 1378]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1333
diff
changeset
|
728 char buf[MSG_LEN], buf2[MSG_LEN]; |
12365cb601cb
[gaim-migrate @ 1378]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1333
diff
changeset
|
729 g_snprintf(buf2, sizeof buf2, "%s", info); |
12365cb601cb
[gaim-migrate @ 1378]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1333
diff
changeset
|
730 escape_text(buf2); |
12365cb601cb
[gaim-migrate @ 1378]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1333
diff
changeset
|
731 g_snprintf(buf, sizeof(buf), "toc_set_info \"%s\n\"", buf2); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
732 sflap_send(g, buf, -1, TYPE_DATA); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
733 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
734 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
735 static void toc_change_passwd(struct gaim_connection *g, char *orig, char *new) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
736 { |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
737 char buf[MSG_LEN]; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
738 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
|
739 sflap_send(g, buf, strlen(buf), TYPE_DATA); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
740 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
741 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
742 static void toc_add_buddy(struct gaim_connection *g, char *name) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
743 { |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
744 char buf[1024]; |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
745 g_snprintf(buf, sizeof(buf), "toc_add_buddy %s", normalize(name)); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
746 sflap_send(g, buf, -1, TYPE_DATA); |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
747 toc_set_config(g); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
748 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
749 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
750 static void toc_add_buddies(struct gaim_connection *g, GList * buddies) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
751 { |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
752 char buf[MSG_LEN]; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
753 int n; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
754 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
755 n = g_snprintf(buf, sizeof(buf), "toc_add_buddy"); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
756 while (buddies) { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
757 if (strlen(normalize(buddies->data)) > MSG_LEN - n - 16) { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
758 sflap_send(g, buf, -1, TYPE_DATA); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
759 n = g_snprintf(buf, sizeof(buf), "toc_add_buddy"); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
760 } |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
761 n += g_snprintf(buf + n, sizeof(buf) - n, " %s", normalize(buddies->data)); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
762 buddies = buddies->next; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
763 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
764 sflap_send(g, buf, -1, TYPE_DATA); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
765 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
766 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
767 static void toc_remove_buddy(struct gaim_connection *g, char *name) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
768 { |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
769 char buf[1024]; |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
770 g_snprintf(buf, sizeof(buf), "toc_remove_buddy %s", normalize(name)); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
771 sflap_send(g, buf, -1, TYPE_DATA); |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
772 toc_set_config(g); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
773 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
774 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
775 static void toc_set_idle(struct gaim_connection *g, int time) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
776 { |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
777 char buf[256]; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
778 g_snprintf(buf, sizeof(buf), "toc_set_idle %d", time); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
779 sflap_send(g, buf, -1, TYPE_DATA); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
780 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
781 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
782 static void toc_warn(struct gaim_connection *g, char *name, int anon) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
783 { |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
784 char send[256]; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
785 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
|
786 sflap_send(g, send, -1, TYPE_DATA); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
787 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
788 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
789 static void toc_accept_chat(struct gaim_connection *g, int i) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
790 { |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
791 char buf[256]; |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
792 g_snprintf(buf, 255, "toc_chat_accept %d", i); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
793 sflap_send(g, buf, -1, TYPE_DATA); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
794 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
795 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
796 static void toc_join_chat(struct gaim_connection *g, int exchange, char *name) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
797 { |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
798 char buf[BUF_LONG]; |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
799 g_snprintf(buf, sizeof(buf) / 2, "toc_chat_join %d \"%s\"", exchange, name); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
800 sflap_send(g, buf, -1, TYPE_DATA); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
801 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
802 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
803 static void toc_chat_invite(struct gaim_connection *g, int id, char *message, char *name) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
804 { |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
805 char buf[BUF_LONG]; |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
806 g_snprintf(buf, sizeof(buf) / 2, "toc_chat_invite %d \"%s\" %s", id, message, normalize(name)); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
807 sflap_send(g, buf, -1, TYPE_DATA); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
808 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
809 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
810 static void toc_chat_leave(struct gaim_connection *g, int id) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
811 { |
1182
bab9f3dc07f8
[gaim-migrate @ 1192]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
812 GSList *bcs = g->buddy_chats; |
bab9f3dc07f8
[gaim-migrate @ 1192]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
813 struct conversation *b = NULL; |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
814 char buf[256]; |
1182
bab9f3dc07f8
[gaim-migrate @ 1192]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
815 |
bab9f3dc07f8
[gaim-migrate @ 1192]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
816 while (bcs) { |
bab9f3dc07f8
[gaim-migrate @ 1192]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
817 b = (struct conversation *)bcs->data; |
bab9f3dc07f8
[gaim-migrate @ 1192]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
818 if (id == b->id) |
bab9f3dc07f8
[gaim-migrate @ 1192]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
819 break; |
bab9f3dc07f8
[gaim-migrate @ 1192]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
820 b = NULL; |
bab9f3dc07f8
[gaim-migrate @ 1192]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
821 bcs = bcs->next; |
bab9f3dc07f8
[gaim-migrate @ 1192]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
822 } |
bab9f3dc07f8
[gaim-migrate @ 1192]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
823 |
bab9f3dc07f8
[gaim-migrate @ 1192]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
824 if (!b) |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
825 return; /* can this happen? */ |
1182
bab9f3dc07f8
[gaim-migrate @ 1192]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
826 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
827 if (!b->gc) /* TOC already kicked us out of this room */ |
1182
bab9f3dc07f8
[gaim-migrate @ 1192]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
828 serv_got_chat_left(g, id); |
bab9f3dc07f8
[gaim-migrate @ 1192]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
829 else { |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
830 g_snprintf(buf, 255, "toc_chat_leave %d", id); |
1182
bab9f3dc07f8
[gaim-migrate @ 1192]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
831 sflap_send(g, buf, -1, TYPE_DATA); |
bab9f3dc07f8
[gaim-migrate @ 1192]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
832 } |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
833 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
834 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
835 static void toc_chat_whisper(struct gaim_connection *g, int id, char *who, char *message) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
836 { |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
837 char buf2[MSG_LEN]; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
838 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
|
839 sflap_send(g, buf2, -1, TYPE_DATA); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
840 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
841 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
842 static void toc_chat_send(struct gaim_connection *g, int id, char *message) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
843 { |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
844 char buf[MSG_LEN]; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
845 escape_text(message); |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
846 g_snprintf(buf, sizeof(buf), "toc_chat_send %d \"%s\"", id, message); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
847 sflap_send(g, buf, -1, TYPE_DATA); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
848 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
849 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
850 static void toc_keepalive(struct gaim_connection *gc) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
851 { |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
852 sflap_send(gc, "", 0, TYPE_KEEPALIVE); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
853 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
854 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
855 static char **toc_list_icon(int uc) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
856 { |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
857 if (uc & UC_UNAVAILABLE) |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
858 return (char **)away_icon_xpm; |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
859 if (uc & UC_AOL) |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
860 return (char **)aol_icon_xpm; |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
861 if (uc & UC_NORMAL) |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
862 return (char **)free_icon_xpm; |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
863 if (uc & UC_ADMIN) |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
864 return (char **)admin_icon_xpm; |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
865 if (uc & UC_UNCONFIRMED) |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
866 return (char **)dt_icon_xpm; |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
867 return NULL; |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
868 } |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
869 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
870 static void toc_info(GtkObject * obj, char *who) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
871 { |
1032
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
872 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
|
873 serv_get_info(gc, who); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
874 } |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
875 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
876 static void toc_dir_info(GtkObject * obj, char *who) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
877 { |
1032
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
878 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
|
879 serv_get_dir(gc, who); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
880 } |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
881 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
882 static void toc_action_menu(GtkWidget *menu, struct gaim_connection *gc, char *who) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
883 { |
1032
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
884 GtkWidget *button; |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
885 |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
886 button = gtk_menu_item_new_with_label(_("Get Info")); |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
887 gtk_signal_connect(GTK_OBJECT(button), "activate", GTK_SIGNAL_FUNC(toc_info), who); |
1032
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
888 gtk_object_set_user_data(GTK_OBJECT(button), gc); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
889 gtk_menu_append(GTK_MENU(menu), button); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
890 gtk_widget_show(button); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
891 |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
892 button = gtk_menu_item_new_with_label(_("Get Dir Info")); |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
893 gtk_signal_connect(GTK_OBJECT(button), "activate", GTK_SIGNAL_FUNC(toc_dir_info), who); |
1032
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
894 gtk_object_set_user_data(GTK_OBJECT(button), gc); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
895 gtk_menu_append(GTK_MENU(menu), button); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
896 gtk_widget_show(button); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
897 } |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
898 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
899 static void toc_print_option(GtkEntry * entry, struct aim_user *user) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
900 { |
1087
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
901 int entrynum; |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
902 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
903 entrynum = (int)gtk_object_get_user_data(GTK_OBJECT(entry)); |
1087
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
904 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
905 if (entrynum == USEROPT_AUTH) { |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
906 g_snprintf(user->proto_opt[USEROPT_AUTH], |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
907 sizeof(user->proto_opt[USEROPT_AUTH]), "%s", gtk_entry_get_text(entry)); |
1087
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
908 } else if (entrynum == USEROPT_AUTHPORT) { |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
909 g_snprintf(user->proto_opt[USEROPT_AUTHPORT], |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
910 sizeof(user->proto_opt[USEROPT_AUTHPORT]), "%s", gtk_entry_get_text(entry)); |
1087
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
911 } else if (entrynum == USEROPT_SOCKSHOST) { |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
912 g_snprintf(user->proto_opt[USEROPT_SOCKSHOST], |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
913 sizeof(user->proto_opt[USEROPT_SOCKSHOST]), "%s", gtk_entry_get_text(entry)); |
1087
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
914 } else if (entrynum == USEROPT_SOCKSPORT) { |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
915 g_snprintf(user->proto_opt[USEROPT_SOCKSPORT], |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
916 sizeof(user->proto_opt[USEROPT_SOCKSPORT]), "%s", gtk_entry_get_text(entry)); |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
917 } |
1087
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
918 } |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
919 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
920 static void toc_print_optionrad(GtkRadioButton * entry, struct aim_user *user) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
921 { |
1087
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
922 int entrynum; |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
923 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
924 entrynum = (int)gtk_object_get_user_data(GTK_OBJECT(entry)); |
1087
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
925 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
926 g_snprintf(user->proto_opt[USEROPT_PROXYTYPE], |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
927 sizeof(user->proto_opt[USEROPT_PROXYTYPE]), "%d", entrynum); |
1087
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
928 } |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
929 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
930 static void toc_user_opts(GtkWidget *book, struct aim_user *user) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
931 { |
1087
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
932 /* so here, we create the new notebook page */ |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
933 GtkWidget *vbox; |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
934 GtkWidget *hbox; |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
935 GtkWidget *label; |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
936 GtkWidget *entry; |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
937 GtkWidget *first, *opt; |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
938 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1234
diff
changeset
|
939 vbox = gtk_vbox_new(FALSE, 5); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1234
diff
changeset
|
940 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
941 gtk_notebook_append_page(GTK_NOTEBOOK(book), vbox, gtk_label_new("TOC Options")); |
1087
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
942 gtk_widget_show(vbox); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
943 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
944 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1234
diff
changeset
|
945 hbox = gtk_hbox_new(FALSE, 5); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1234
diff
changeset
|
946 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
1087
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
947 gtk_widget_show(hbox); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
948 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
949 label = gtk_label_new("TOC Host:"); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1234
diff
changeset
|
950 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
1087
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
951 gtk_widget_show(label); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
952 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
953 entry = gtk_entry_new(); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1234
diff
changeset
|
954 gtk_box_pack_end(GTK_BOX(hbox), entry, FALSE, FALSE, 0); |
1087
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
955 gtk_object_set_user_data(GTK_OBJECT(entry), (void *)USEROPT_AUTH); |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
956 gtk_signal_connect(GTK_OBJECT(entry), "changed", GTK_SIGNAL_FUNC(toc_print_option), user); |
1087
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
957 if (user->proto_opt[USEROPT_AUTH][0]) { |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
958 debug_printf("setting text %s\n", user->proto_opt[USEROPT_AUTH]); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
959 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
|
960 } else |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
961 gtk_entry_set_text(GTK_ENTRY(entry), "toc.oscar.aol.com"); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
962 gtk_widget_show(entry); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
963 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
964 hbox = gtk_hbox_new(FALSE, 0); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1234
diff
changeset
|
965 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
1087
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
966 gtk_widget_show(hbox); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
967 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
968 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
969 label = gtk_label_new("TOC Port:"); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1234
diff
changeset
|
970 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
1087
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
971 gtk_widget_show(label); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
972 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
973 entry = gtk_entry_new(); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1234
diff
changeset
|
974 gtk_box_pack_end(GTK_BOX(hbox), entry, FALSE, FALSE, 0); |
1087
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
975 gtk_object_set_user_data(GTK_OBJECT(entry), (void *)1); |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
976 gtk_signal_connect(GTK_OBJECT(entry), "changed", GTK_SIGNAL_FUNC(toc_print_option), user); |
1087
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
977 if (user->proto_opt[USEROPT_AUTHPORT][0]) { |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
978 debug_printf("setting text %s\n", user->proto_opt[USEROPT_AUTHPORT]); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
979 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
|
980 } else |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
981 gtk_entry_set_text(GTK_ENTRY(entry), "9898"); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
982 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
983 gtk_widget_show(entry); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
984 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
985 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
986 hbox = gtk_hbox_new(FALSE, 0); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1234
diff
changeset
|
987 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
1087
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
988 gtk_widget_show(hbox); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
989 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
990 label = gtk_label_new("Proxy Host:"); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1234
diff
changeset
|
991 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
1087
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
992 gtk_widget_show(label); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
993 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
994 entry = gtk_entry_new(); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1234
diff
changeset
|
995 gtk_box_pack_end(GTK_BOX(hbox), entry, FALSE, FALSE, 0); |
1087
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
996 gtk_object_set_user_data(GTK_OBJECT(entry), (void *)USEROPT_SOCKSHOST); |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
997 gtk_signal_connect(GTK_OBJECT(entry), "changed", GTK_SIGNAL_FUNC(toc_print_option), user); |
1087
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
998 if (user->proto_opt[USEROPT_SOCKSHOST][0]) { |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
999 debug_printf("setting text %s\n", user->proto_opt[USEROPT_SOCKSHOST]); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1000 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
|
1001 } |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1002 gtk_widget_show(entry); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1003 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1004 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1005 hbox = gtk_hbox_new(FALSE, 0); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1234
diff
changeset
|
1006 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
1087
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1007 gtk_widget_show(hbox); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1008 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1009 label = gtk_label_new("Proxy Port:"); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1234
diff
changeset
|
1010 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
1087
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1011 gtk_widget_show(label); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1012 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1013 entry = gtk_entry_new(); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1234
diff
changeset
|
1014 gtk_box_pack_end(GTK_BOX(hbox), entry, FALSE, FALSE, 0); |
1087
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1015 gtk_object_set_user_data(GTK_OBJECT(entry), (void *)USEROPT_SOCKSPORT); |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1016 gtk_signal_connect(GTK_OBJECT(entry), "changed", GTK_SIGNAL_FUNC(toc_print_option), user); |
1087
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1017 if (user->proto_opt[USEROPT_SOCKSPORT][0]) { |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1018 debug_printf("setting text %s\n", user->proto_opt[USEROPT_SOCKSPORT]); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1019 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
|
1020 } |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1021 gtk_widget_show(entry); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1022 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1023 |
1087
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1024 first = gtk_radio_button_new_with_label(NULL, "No proxy"); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1025 gtk_box_pack_start(GTK_BOX(vbox), first, FALSE, FALSE, 0); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1026 gtk_object_set_user_data(GTK_OBJECT(first), (void *)PROXY_NONE); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1027 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
|
1028 gtk_widget_show(first); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1029 if (atoi(user->proto_opt[USEROPT_PROXYTYPE]) == PROXY_NONE) |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1030 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(first), TRUE); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1031 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1032 opt = |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1033 gtk_radio_button_new_with_label(gtk_radio_button_group(GTK_RADIO_BUTTON(first)), "SOCKS 4"); |
1087
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1034 gtk_box_pack_start(GTK_BOX(vbox), opt, FALSE, FALSE, 0); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1035 gtk_object_set_user_data(GTK_OBJECT(opt), (void *)PROXY_SOCKS4); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1036 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
|
1037 gtk_widget_show(opt); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1038 if (atoi(user->proto_opt[USEROPT_PROXYTYPE]) == PROXY_SOCKS4) |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1039 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(opt), TRUE); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1040 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1041 opt = |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1042 gtk_radio_button_new_with_label(gtk_radio_button_group(GTK_RADIO_BUTTON(first)), "SOCKS 5"); |
1087
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1043 gtk_box_pack_start(GTK_BOX(vbox), opt, FALSE, FALSE, 0); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1044 gtk_object_set_user_data(GTK_OBJECT(opt), (void *)PROXY_SOCKS5); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1045 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
|
1046 gtk_widget_show(opt); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1047 if (atoi(user->proto_opt[USEROPT_PROXYTYPE]) == PROXY_SOCKS5) |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1048 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(opt), TRUE); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1049 |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1050 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
|
1051 gtk_box_pack_start(GTK_BOX(vbox), opt, FALSE, FALSE, 0); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1052 gtk_object_set_user_data(GTK_OBJECT(opt), (void *)PROXY_HTTP); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1053 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
|
1054 gtk_widget_show(opt); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1055 if (atoi(user->proto_opt[USEROPT_PROXYTYPE]) == PROXY_HTTP) |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1056 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(opt), TRUE); |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1057 } |
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1058 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1059 static void toc_add_permit(struct gaim_connection *gc, char *who) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1060 { |
1145
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1061 char buf2[MSG_LEN]; |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1062 if (gc->permdeny != 3) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1063 return; |
1145
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1064 g_snprintf(buf2, sizeof(buf2), "toc_add_permit %s", normalize(who)); |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1065 sflap_send(gc, buf2, -1, TYPE_DATA); |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1066 } |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1067 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1068 static void toc_add_deny(struct gaim_connection *gc, char *who) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1069 { |
1145
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1070 char buf2[MSG_LEN]; |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1071 if (gc->permdeny != 4) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1072 return; |
1208
66a70fbb2b09
[gaim-migrate @ 1218]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1182
diff
changeset
|
1073 g_snprintf(buf2, sizeof(buf2), "toc_add_deny %s", normalize(who)); |
1145
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1074 sflap_send(gc, buf2, -1, TYPE_DATA); |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1075 } |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1076 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1077 static void toc_set_permit_deny(struct gaim_connection *gc) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1078 { |
1145
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1079 char buf2[MSG_LEN]; |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1080 GSList *list; |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1081 int at; |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1082 |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1083 switch (gc->permdeny) { |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1084 case 1: |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1085 /* permit all, deny none. to get here reliably we need to have been in permit |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1086 * mode, and send an empty toc_add_deny message, which will switch us to deny none */ |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1087 g_snprintf(buf2, sizeof(buf2), "toc_add_permit "); |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1088 sflap_send(gc, buf2, -1, TYPE_DATA); |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1089 g_snprintf(buf2, sizeof(buf2), "toc_add_deny "); |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1090 sflap_send(gc, buf2, -1, TYPE_DATA); |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1091 break; |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1092 case 2: |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1093 /* deny all, permit none. to get here reliably we need to have been in deny |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1094 * mode, and send an empty toc_add_permit message, which will switch us to permit none */ |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1095 g_snprintf(buf2, sizeof(buf2), "toc_add_deny "); |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1096 sflap_send(gc, buf2, -1, TYPE_DATA); |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1097 g_snprintf(buf2, sizeof(buf2), "toc_add_permit "); |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1098 sflap_send(gc, buf2, -1, TYPE_DATA); |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1099 break; |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1100 case 3: |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1101 /* permit some. we want to switch to deny mode first, then send the toc_add_permit |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1102 * message, which will clear and set our permit list. toc sucks. */ |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1103 g_snprintf(buf2, sizeof(buf2), "toc_add_deny "); |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1104 sflap_send(gc, buf2, -1, TYPE_DATA); |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1105 |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1106 at = g_snprintf(buf2, sizeof(buf2), "toc_add_permit "); |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1107 list = gc->permit; |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1108 while (list) { |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1109 at += g_snprintf(buf2 + at, sizeof(buf2) - at, "%s ", normalize(list->data)); |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1110 if (at > MSG_LEN + 32) { /* from out my ass comes greatness */ |
1145
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1111 sflap_send(gc, buf2, -1, TYPE_DATA); |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1112 at = g_snprintf(buf2, sizeof(buf2), "toc_add_permit "); |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1113 } |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1114 list = list->next; |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1115 } |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1116 sflap_send(gc, buf2, -1, TYPE_DATA); |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1117 break; |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1118 case 4: |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1119 /* deny some. we want to switch to permit mode first, then send the toc_add_deny |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1120 * message, which will clear and set our deny list. toc sucks. */ |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1121 g_snprintf(buf2, sizeof(buf2), "toc_add_permit "); |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1122 sflap_send(gc, buf2, -1, TYPE_DATA); |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1123 |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1124 at = g_snprintf(buf2, sizeof(buf2), "toc_add_deny "); |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1125 list = gc->deny; |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1126 while (list) { |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1127 at += g_snprintf(buf2 + at, sizeof(buf2) - at, "%s ", normalize(list->data)); |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1128 if (at > MSG_LEN + 32) { /* from out my ass comes greatness */ |
1145
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1129 sflap_send(gc, buf2, -1, TYPE_DATA); |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1130 at = g_snprintf(buf2, sizeof(buf2), "toc_add_deny "); |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1131 } |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1132 list = list->next; |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1133 } |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1134 sflap_send(gc, buf2, -1, TYPE_DATA); |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1135 break; |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1136 default: |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1137 break; |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1138 } |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1139 } |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1140 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1141 static void toc_rem_permit(struct gaim_connection *gc, char *who) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1142 { |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1143 if (gc->permdeny != 3) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1144 return; |
1145
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1145 toc_set_permit_deny(gc); |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1146 } |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1147 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1148 static void toc_rem_deny(struct gaim_connection *gc, char *who) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1149 { |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1150 if (gc->permdeny != 4) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1151 return; |
1145
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1152 toc_set_permit_deny(gc); |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1153 } |
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1154 |
1333
b332d8f46b84
[gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1310
diff
changeset
|
1155 static void toc_draw_new_user(GtkWidget *box) |
b332d8f46b84
[gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1310
diff
changeset
|
1156 { |
b332d8f46b84
[gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1310
diff
changeset
|
1157 GtkWidget *label; |
b332d8f46b84
[gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1310
diff
changeset
|
1158 |
b332d8f46b84
[gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1310
diff
changeset
|
1159 label = gtk_label_new(_("Unfortunately, currently TOC only allows new user registration by " |
b332d8f46b84
[gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1310
diff
changeset
|
1160 "going to http://aim.aol.com/aimnew/Aim/register.adp?promo=106723&pageset=Aim&client=no" |
b332d8f46b84
[gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1310
diff
changeset
|
1161 ". Clicking the Register button will open the URL for you.")); |
b332d8f46b84
[gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1310
diff
changeset
|
1162 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); |
b332d8f46b84
[gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1310
diff
changeset
|
1163 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5); |
b332d8f46b84
[gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1310
diff
changeset
|
1164 gtk_widget_show(label); |
b332d8f46b84
[gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1310
diff
changeset
|
1165 } |
b332d8f46b84
[gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1310
diff
changeset
|
1166 |
b332d8f46b84
[gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1310
diff
changeset
|
1167 static void toc_do_new_user() |
b332d8f46b84
[gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1310
diff
changeset
|
1168 { |
b332d8f46b84
[gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1310
diff
changeset
|
1169 open_url(NULL, "http://aim.aol.com/aimnew/Aim/register.adp?promo=106723&pageset=Aim&client=no"); |
b332d8f46b84
[gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1310
diff
changeset
|
1170 } |
b332d8f46b84
[gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1310
diff
changeset
|
1171 |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1172 void toc_init(struct prpl *ret) |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1173 { |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1174 ret->protocol = PROTO_TOC; |
1370
776bb4c6c0b8
[gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1368
diff
changeset
|
1175 ret->options = OPT_PROTO_HTML; |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1176 ret->name = toc_name; |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1177 ret->list_icon = toc_list_icon; |
1032
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1178 ret->action_menu = toc_action_menu; |
1087
56c7ceb986a8
[gaim-migrate @ 1097]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1179 ret->user_opts = toc_user_opts; |
1333
b332d8f46b84
[gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1310
diff
changeset
|
1180 ret->draw_new_user = toc_draw_new_user; |
b332d8f46b84
[gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1310
diff
changeset
|
1181 ret->do_new_user = toc_do_new_user; |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1182 ret->login = toc_login; |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1183 ret->close = toc_close; |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1184 ret->send_im = toc_send_im; |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1185 ret->set_info = toc_set_info; |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1186 ret->get_info = toc_get_info; |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1187 ret->set_away = toc_set_away; |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1188 ret->get_away_msg = NULL; |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1189 ret->set_dir = toc_set_dir; |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1190 ret->get_dir = toc_get_dir; |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1191 ret->dir_search = toc_dir_search; |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1192 ret->set_idle = toc_set_idle; |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1193 ret->change_passwd = toc_change_passwd; |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1194 ret->add_buddy = toc_add_buddy; |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1195 ret->add_buddies = toc_add_buddies; |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1196 ret->remove_buddy = toc_remove_buddy; |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1197 ret->add_permit = toc_add_permit; |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1198 ret->add_deny = toc_add_deny; |
1145
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1199 ret->rem_permit = toc_rem_permit; |
1208
66a70fbb2b09
[gaim-migrate @ 1218]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1182
diff
changeset
|
1200 ret->rem_deny = toc_rem_deny; |
1145
cd96ca1aed02
[gaim-migrate @ 1155]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1132
diff
changeset
|
1201 ret->set_permit_deny = toc_set_permit_deny; |
1252
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1202 ret->warn = toc_warn; |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1203 ret->accept_chat = toc_accept_chat; |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1204 ret->join_chat = toc_join_chat; |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1205 ret->chat_invite = toc_chat_invite; |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1206 ret->chat_leave = toc_chat_leave; |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1207 ret->chat_whisper = toc_chat_whisper; |
46c09828e929
[gaim-migrate @ 1262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1208 ret->chat_send = toc_chat_send; |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1209 ret->keepalive = toc_keepalive; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1210 } |