Mercurial > pidgin.yaz
annotate src/oscar.c @ 1089:f0f5c10cce63
[gaim-migrate @ 1099]
added a cancel button to the progress meter
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Mon, 13 Nov 2000 02:58:00 +0000 |
parents | ce201056e7a6 |
children | a930439f29b1 |
rev | line source |
---|---|
1 | 1 /* |
2 * gaim | |
3 * | |
4 * Some code copyright (C) 1998-1999, Mark Spencer <markster@marko.net> | |
5 * libfaim code copyright 1998, 1999 Adam Fritzler <afritz@auk.cx> | |
6 * | |
7 * This program is free software; you can redistribute it and/or modify | |
8 * it under the terms of the GNU General Public License as published by | |
9 * the Free Software Foundation; either version 2 of the License, or | |
10 * (at your option) any later version. | |
11 * | |
12 * This program is distributed in the hope that it will be useful, | |
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 * GNU General Public License for more details. | |
16 * | |
17 * You should have received a copy of the GNU General Public License | |
18 * along with this program; if not, write to the Free Software | |
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
20 * | |
21 */ | |
22 | |
349
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
23 #ifdef HAVE_CONFIG_H |
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
24 #include "../config.h" |
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
25 #endif |
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
26 |
1 | 27 |
28 #include <netdb.h> | |
29 #include <gtk/gtk.h> | |
30 #include <unistd.h> | |
31 #include <errno.h> | |
32 #include <netinet/in.h> | |
33 #include <arpa/inet.h> | |
34 #include <string.h> | |
35 #include <stdlib.h> | |
36 #include <stdio.h> | |
37 #include <time.h> | |
38 #include <sys/socket.h> | |
39 #include <sys/stat.h> | |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
40 #include "multi.h" |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
41 #include "prpl.h" |
1 | 42 #include "gaim.h" |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
43 #include "aim.h" |
1 | 44 #include "gnome_applet_mgr.h" |
45 | |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
46 #include "pixmaps/admin_icon.xpm" |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
47 #include "pixmaps/aol_icon.xpm" |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
48 #include "pixmaps/away_icon.xpm" |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
49 #include "pixmaps/dt_icon.xpm" |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
50 #include "pixmaps/free_icon.xpm" |
526
5bf71b39cba2
[gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
51 |
1086
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
52 /* constants to identify proto_opts */ |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
53 #define USEROPT_AUTH 0 |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
54 #define USEROPT_AUTHPORT 1 |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
55 #define USEROPT_SOCKSHOST 2 |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
56 #define USEROPT_SOCKSPORT 3 |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
57 |
369
cf895313fc50
[gaim-migrate @ 379]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
58 int gaim_caps = AIM_CAPS_CHAT | AIM_CAPS_SENDFILE | AIM_CAPS_GETFILE | |
cf895313fc50
[gaim-migrate @ 379]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
59 AIM_CAPS_VOICE | AIM_CAPS_IMIMAGE | AIM_CAPS_BUDDYICON; |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
60 |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
61 struct oscar_data { |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
62 struct aim_session_t *sess; |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
63 struct aim_conn_t *conn; |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
64 |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
65 int cnpa; |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
66 int paspa; |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
67 |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
68 int create_exchange; |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
69 char *create_name; |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
70 |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
71 GSList *oscar_chats; |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
72 GSList *direct_ims; |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
73 }; |
1 | 74 |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
75 struct direct_im { |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
76 struct gaim_connection *gc; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
77 char name[80]; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
78 struct conversation *cnv; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
79 int watcher; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
80 struct aim_conn_t *conn; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
81 }; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
82 |
1064
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
83 struct ask_direct { |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
84 struct gaim_connection *gc; |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
85 char *sn; |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
86 struct aim_directim_priv *priv; |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
87 }; |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
88 |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
89 struct ask_getfile { |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
90 struct gaim_connection *gc; |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
91 char *sn; |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
92 char *cookie; |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
93 char *ip; |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
94 }; |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
95 |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
96 static struct direct_im *find_direct_im(struct oscar_data *od, char *who) { |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
97 GSList *d = od->direct_ims; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
98 char *n = g_strdup(normalize(who)); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
99 struct direct_im *m = NULL; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
100 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
101 while (d) { |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
102 m = (struct direct_im *)d->data; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
103 if (!strcmp(n, normalize(m->name))) |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
104 break; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
105 m = NULL; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
106 d = d->next; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
107 } |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
108 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
109 g_free(n); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
110 return m; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
111 } |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
112 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
113 struct chat_connection *find_oscar_chat(struct gaim_connection *gc, char *name) { |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
114 GSList *g = ((struct oscar_data *)gc->proto_data)->oscar_chats; |
312
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
115 struct chat_connection *c = NULL; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
116 if (gc->protocol != PROTO_OSCAR) return NULL; |
312
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
117 |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
118 while (g) { |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
119 c = (struct chat_connection *)g->data; |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
120 if (!strcmp(name, c->name)) |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
121 break; |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
122 g = g->next; |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
123 c = NULL; |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
124 } |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
125 |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
126 return c; |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
127 } |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
128 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
129 static struct chat_connection *find_oscar_chat_by_conn(struct gaim_connection *gc, |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
130 struct aim_conn_t *conn) { |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
131 GSList *g = ((struct oscar_data *)gc->proto_data)->oscar_chats; |
833
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
132 struct chat_connection *c = NULL; |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
133 |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
134 while (g) { |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
135 c = (struct chat_connection *)g->data; |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
136 if (c->conn == conn) |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
137 break; |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
138 g = g->next; |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
139 c = NULL; |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
140 } |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
141 |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
142 return c; |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
143 } |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
144 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
145 static struct gaim_connection *find_gaim_conn_by_aim_sess(struct aim_session_t *sess) { |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
146 GSList *g = connections; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
147 struct gaim_connection *gc = NULL; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
148 |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
149 while (g) { |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
150 gc = (struct gaim_connection *)g->data; |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
151 if (sess == ((struct oscar_data *)gc->proto_data)->sess) |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
152 break; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
153 g = g->next; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
154 gc = NULL; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
155 } |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
156 |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
157 return gc; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
158 } |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
159 |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
160 static struct gaim_connection *find_gaim_conn_by_oscar_conn(struct aim_conn_t *conn) { |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
161 GSList *g = connections; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
162 struct gaim_connection *c = NULL; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
163 struct aim_conn_t *s; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
164 while (g) { |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
165 c = (struct gaim_connection *)g->data; |
965
50f2977537d8
[gaim-migrate @ 975]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
964
diff
changeset
|
166 if (c->protocol != PROTO_OSCAR) { |
50f2977537d8
[gaim-migrate @ 975]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
964
diff
changeset
|
167 c = NULL; |
50f2977537d8
[gaim-migrate @ 975]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
964
diff
changeset
|
168 g = g->next; |
50f2977537d8
[gaim-migrate @ 975]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
964
diff
changeset
|
169 continue; |
50f2977537d8
[gaim-migrate @ 975]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
964
diff
changeset
|
170 } |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
171 s = ((struct oscar_data *)c->proto_data)->sess->connlist; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
172 while (s) { |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
173 if (conn == s) |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
174 break; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
175 s = s->next; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
176 } |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
177 if (s) break; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
178 g = g->next; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
179 c = NULL; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
180 } |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
181 |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
182 return c; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
183 } |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
184 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
185 static int gaim_parse_auth_resp (struct aim_session_t *, struct command_rx_struct *, ...); |
741
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
736
diff
changeset
|
186 static int gaim_parse_login (struct aim_session_t *, struct command_rx_struct *, ...); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
187 static int gaim_server_ready (struct aim_session_t *, struct command_rx_struct *, ...); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
188 static int gaim_handle_redirect (struct aim_session_t *, struct command_rx_struct *, ...); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
189 static int gaim_parse_oncoming (struct aim_session_t *, struct command_rx_struct *, ...); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
190 static int gaim_parse_offgoing (struct aim_session_t *, struct command_rx_struct *, ...); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
191 static int gaim_parse_incoming_im(struct aim_session_t *, struct command_rx_struct *, ...); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
192 static int gaim_parse_misses (struct aim_session_t *, struct command_rx_struct *, ...); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
193 static int gaim_parse_user_info (struct aim_session_t *, struct command_rx_struct *, ...); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
194 static int gaim_parse_motd (struct aim_session_t *, struct command_rx_struct *, ...); |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
195 static int gaim_chatnav_info (struct aim_session_t *, struct command_rx_struct *, ...); |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
196 static int gaim_chat_join (struct aim_session_t *, struct command_rx_struct *, ...); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
197 static int gaim_chat_leave (struct aim_session_t *, struct command_rx_struct *, ...); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
198 static int gaim_chat_info_update (struct aim_session_t *, struct command_rx_struct *, ...); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
199 static int gaim_chat_incoming_msg(struct aim_session_t *, struct command_rx_struct *, ...); |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
200 static int gaim_parse_msgack (struct aim_session_t *, struct command_rx_struct *, ...); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
201 static int gaim_parse_ratechange (struct aim_session_t *, struct command_rx_struct *, ...); |
771
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
202 static int gaim_parse_evilnotify (struct aim_session_t *, struct command_rx_struct *, ...); |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
203 static int gaim_bosrights (struct aim_session_t *, struct command_rx_struct *, ...); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
204 static int gaim_rateresp (struct aim_session_t *, struct command_rx_struct *, ...); |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
205 static int gaim_reportinterval (struct aim_session_t *, struct command_rx_struct *, ...); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
206 static int gaim_parse_msgerr (struct aim_session_t *, struct command_rx_struct *, ...); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
207 static int gaim_parse_buddyrights(struct aim_session_t *, struct command_rx_struct *, ...); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
208 static int gaim_parse_locerr (struct aim_session_t *, struct command_rx_struct *, ...); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
209 |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
210 static int gaim_directim_initiate (struct aim_session_t *, struct command_rx_struct *, ...); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
211 static int gaim_directim_incoming (struct aim_session_t *, struct command_rx_struct *, ...); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
212 static int gaim_directim_disconnect(struct aim_session_t *, struct command_rx_struct *, ...); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
213 static int gaim_directim_typing (struct aim_session_t *, struct command_rx_struct *, ...); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
214 |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
215 static char *msgerrreason[] = { |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
216 "Invalid error", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
217 "Invalid SNAC", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
218 "Rate to host", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
219 "Rate to client", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
220 "Not logged in", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
221 "Service unavailable", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
222 "Service not defined", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
223 "Obsolete SNAC", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
224 "Not supported by host", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
225 "Not supported by client", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
226 "Refused by client", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
227 "Reply too big", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
228 "Responses lost", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
229 "Request denied", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
230 "Busted SNAC payload", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
231 "Insufficient rights", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
232 "In local permit/deny", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
233 "Too evil (sender)", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
234 "Too evil (receiver)", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
235 "User temporarily unavailable", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
236 "No match", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
237 "List overflow", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
238 "Request ambiguous", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
239 "Queue full", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
240 "Not while on AOL" |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
241 }; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
242 static int msgerrreasonlen = 25; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
243 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
244 static void oscar_callback(gpointer data, gint source, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
245 GdkInputCondition condition) { |
288
6e609d42f767
[gaim-migrate @ 298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
246 struct aim_conn_t *conn = (struct aim_conn_t *)data; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
247 struct gaim_connection *gc = find_gaim_conn_by_oscar_conn(conn); |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
248 struct oscar_data *odata = (struct oscar_data *)gc->proto_data; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
249 if (!gc) { |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
250 /* oh boy. this is probably bad. i guess the only thing we can really do |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
251 * is return? */ |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
252 debug_print("oscar callback for closed connection.\n"); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
253 return; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
254 } |
1 | 255 |
259
e159ba2486fc
[gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
256 if (condition & GDK_INPUT_EXCEPTION) { |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
257 hide_login_progress(gc, _("Disconnected.")); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
258 signoff(gc); |
259
e159ba2486fc
[gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
259 return; |
e159ba2486fc
[gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
260 } |
e159ba2486fc
[gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
261 if (condition & GDK_INPUT_READ) { |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
262 if (conn->type == AIM_CONN_TYPE_RENDEZVOUS_OUT) { |
515
b33ed0a7f49b
[gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
513
diff
changeset
|
263 debug_print("got information on rendezvous\n"); |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
264 if (aim_handlerendconnect(odata->sess, conn) < 0) { |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
265 debug_print(_("connection error (rend)\n")); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
266 } |
259
e159ba2486fc
[gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
267 } else { |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
268 if (aim_get_command(odata->sess, conn) >= 0) { |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
269 aim_rxdispatch(odata->sess); |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
270 } else { |
1002
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1000
diff
changeset
|
271 if ((conn->type == AIM_CONN_TYPE_BOS) || |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
272 !(aim_getconn_type(odata->sess, AIM_CONN_TYPE_BOS))) { |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
273 debug_print(_("major connection error\n")); |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
274 hide_login_progress(gc, _("Disconnected.")); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
275 signoff(gc); |
747
eec93c5929b9
[gaim-migrate @ 757]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
746
diff
changeset
|
276 } else if (conn->type == AIM_CONN_TYPE_CHAT) { |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
277 struct chat_connection *c = find_oscar_chat_by_conn(gc, conn); |
833
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
278 char buf[BUF_LONG]; |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
279 sprintf(debug_buff, "disconnected from chat room %s\n", c->name); |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
280 debug_print(debug_buff); |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
281 c->conn = NULL; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
282 if (c->inpa > -1) |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
283 gdk_input_remove(c->inpa); |
833
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
284 c->inpa = -1; |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
285 c->fd = -1; |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
286 aim_conn_kill(odata->sess, &conn); |
833
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
287 sprintf(buf, _("You have been disconnected from chat room %s."), c->name); |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
288 do_error_dialog(buf, _("Chat Error!")); |
828
4c71c0e7f04e
[gaim-migrate @ 838]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
812
diff
changeset
|
289 } else if (conn->type == AIM_CONN_TYPE_CHATNAV) { |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
290 if (odata->cnpa > -1) |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
291 gdk_input_remove(odata->cnpa); |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
292 odata->cnpa = -1; |
828
4c71c0e7f04e
[gaim-migrate @ 838]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
812
diff
changeset
|
293 debug_print("removing chatnav input watcher\n"); |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
294 aim_conn_kill(odata->sess, &conn); |
695
d3db515e9a6e
[gaim-migrate @ 705]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
694
diff
changeset
|
295 } else { |
794
80274f969a09
[gaim-migrate @ 804]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
788
diff
changeset
|
296 sprintf(debug_buff, "holy crap! generic connection error! %d\n", |
80274f969a09
[gaim-migrate @ 804]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
788
diff
changeset
|
297 conn->type); |
80274f969a09
[gaim-migrate @ 804]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
788
diff
changeset
|
298 debug_print(debug_buff); |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
299 aim_conn_kill(odata->sess, &conn); |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
300 } |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
301 } |
259
e159ba2486fc
[gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
302 } |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
303 } |
1 | 304 } |
305 | |
980
82c5865f7cfe
[gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
975
diff
changeset
|
306 void oscar_login(struct aim_user *user) { |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
307 struct aim_session_t *sess; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
308 struct aim_conn_t *conn; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
309 char buf[256]; |
1086
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
310 char *finalauth = NULL; |
1089
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
311 struct gaim_connection *gc = new_gaim_conn(user); |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
312 struct oscar_data *odata = gc->proto_data = g_new0(struct oscar_data, 1); |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
313 gc->user = user; |
1 | 314 |
980
82c5865f7cfe
[gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
975
diff
changeset
|
315 sprintf(debug_buff, _("Logging in %s\n"), user->username); |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
316 debug_print(debug_buff); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
317 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
318 sess = g_new0(struct aim_session_t, 1); |
1086
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
319 |
1081
efcacae6acdb
[gaim-migrate @ 1091]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1072
diff
changeset
|
320 aim_session_init(sess, AIM_SESS_FLAGS_NONBLOCKCONNECT); |
1086
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
321 |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
322 if (user->proto_opt[USEROPT_SOCKSHOST][0]) { |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
323 char *finalproxy; |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
324 if (user->proto_opt[USEROPT_SOCKSPORT][0]) |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
325 finalproxy = g_strconcat(user->proto_opt[USEROPT_SOCKSHOST], ":", |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
326 user->proto_opt[USEROPT_SOCKSPORT], NULL); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
327 else |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
328 finalproxy = g_strdup(user->proto_opt[USEROPT_SOCKSHOST]); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
329 aim_setupproxy(sess, finalproxy, NULL, NULL); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
330 g_free(finalproxy); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
331 } |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
332 |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
333 if (user->proto_opt[USEROPT_AUTH][0]) { |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
334 if (user->proto_opt[USEROPT_AUTHPORT][0]) |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
335 finalauth = g_strconcat(user->proto_opt[USEROPT_AUTH], ":", |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
336 user->proto_opt[USEROPT_AUTHPORT], NULL); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
337 else |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
338 finalauth = g_strdup(user->proto_opt[USEROPT_AUTH]); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
339 } |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
340 |
279
501e09c51cbc
[gaim-migrate @ 289]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
277
diff
changeset
|
341 /* we need an immediate queue because we don't use a while-loop to |
501e09c51cbc
[gaim-migrate @ 289]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
277
diff
changeset
|
342 * see if things need to be sent. */ |
501e09c51cbc
[gaim-migrate @ 289]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
277
diff
changeset
|
343 sess->tx_enqueue = &aim_tx_enqueue__immediate; |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
344 odata->sess = sess; |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
345 |
1086
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
346 conn = aim_newconn(sess, AIM_CONN_TYPE_AUTH, finalauth ? finalauth : FAIM_LOGIN_SERVER); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
347 |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
348 if (finalauth) |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
349 g_free(finalauth); |
1 | 350 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
351 if (conn == NULL) { |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
352 debug_print(_("internal connection error\n")); |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
353 hide_login_progress(gc, _("Unable to login to AIM")); |
1089
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
354 serv_close(gc); |
980
82c5865f7cfe
[gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
975
diff
changeset
|
355 return; |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
356 } else if (conn->fd == -1) { |
975
a45991891aba
[gaim-migrate @ 985]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
971
diff
changeset
|
357 if (conn->status & AIM_CONN_STATUS_RESOLVERR) { |
a45991891aba
[gaim-migrate @ 985]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
971
diff
changeset
|
358 sprintf(debug_buff, _("couldn't resolve host")); |
a45991891aba
[gaim-migrate @ 985]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
971
diff
changeset
|
359 debug_print(debug_buff); debug_print("\n"); |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
360 hide_login_progress(gc, debug_buff); |
975
a45991891aba
[gaim-migrate @ 985]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
971
diff
changeset
|
361 } else if (conn->status & AIM_CONN_STATUS_CONNERR) { |
a45991891aba
[gaim-migrate @ 985]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
971
diff
changeset
|
362 sprintf(debug_buff, _("couldn't connect to host")); |
a45991891aba
[gaim-migrate @ 985]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
971
diff
changeset
|
363 debug_print(debug_buff); debug_print("\n"); |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
364 hide_login_progress(gc, debug_buff); |
975
a45991891aba
[gaim-migrate @ 985]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
971
diff
changeset
|
365 } |
1089
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
366 serv_close(gc); |
980
82c5865f7cfe
[gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
975
diff
changeset
|
367 return; |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
368 } |
980
82c5865f7cfe
[gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
975
diff
changeset
|
369 g_snprintf(buf, sizeof(buf), _("Signon: %s"), gc->username); |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
370 set_login_progress(gc, 2, buf); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
371 |
741
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
736
diff
changeset
|
372 aim_conn_addhandler(sess, conn, 0x0017, 0x0007, gaim_parse_login, 0); |
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
736
diff
changeset
|
373 aim_conn_addhandler(sess, conn, 0x0017, 0x0003, gaim_parse_auth_resp, 0); |
980
82c5865f7cfe
[gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
975
diff
changeset
|
374 aim_request_login(sess, conn, gc->username); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
375 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
376 gc->inpa = gdk_input_add(conn->fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION, |
288
6e609d42f767
[gaim-migrate @ 298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
377 oscar_callback, conn); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
378 |
980
82c5865f7cfe
[gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
975
diff
changeset
|
379 gc->options = user->options; |
82c5865f7cfe
[gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
975
diff
changeset
|
380 save_prefs(); /* is this necessary anymore? */ |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
381 |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
382 debug_print(_("Password sent, waiting for response\n")); |
1 | 383 } |
384 | |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
385 void oscar_close(struct gaim_connection *gc) { |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
386 struct oscar_data *odata = (struct oscar_data *)gc->proto_data; |
1015
c3579d03a0c1
[gaim-migrate @ 1025]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
387 GSList *c = odata->oscar_chats; |
c3579d03a0c1
[gaim-migrate @ 1025]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
388 struct chat_connection *n; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
389 if (gc->protocol != PROTO_OSCAR) return; |
1015
c3579d03a0c1
[gaim-migrate @ 1025]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
390 |
c3579d03a0c1
[gaim-migrate @ 1025]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
391 while (c) { |
c3579d03a0c1
[gaim-migrate @ 1025]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
392 n = (struct chat_connection *)c->data; |
c3579d03a0c1
[gaim-migrate @ 1025]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
393 gdk_input_remove(n->inpa); |
c3579d03a0c1
[gaim-migrate @ 1025]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
394 g_free(n->name); |
1016
661ac77ccd1b
[gaim-migrate @ 1026]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1015
diff
changeset
|
395 c = g_slist_remove(c, n); |
1015
c3579d03a0c1
[gaim-migrate @ 1025]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
396 g_free(n); |
c3579d03a0c1
[gaim-migrate @ 1025]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
397 } |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
398 if (gc->inpa > 0) |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
399 gdk_input_remove(gc->inpa); |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
400 if (odata->cnpa > 0) |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
401 gdk_input_remove(odata->cnpa); |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
402 if (odata->paspa > 0) |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
403 gdk_input_remove(odata->paspa); |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
404 aim_logoff(odata->sess); |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
405 g_free(odata->sess); |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
406 g_free(gc->proto_data); |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
407 debug_print(_("Signed off.\n")); |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
408 } |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
409 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
410 int gaim_parse_auth_resp(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
411 struct command_rx_struct *command, ...) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
412 struct aim_conn_t *bosconn = NULL; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
413 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
414 sprintf(debug_buff, "inside auth_resp (Screen name: %s)\n", |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
415 sess->logininfo.screen_name); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
416 debug_print(debug_buff); |
1 | 417 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
418 if (sess->logininfo.errorcode) { |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
419 switch (sess->logininfo.errorcode) { |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
420 case 0x18: |
392
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
388
diff
changeset
|
421 /* connecting too frequently */ |
1038
daad2440a642
[gaim-migrate @ 1048]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1032
diff
changeset
|
422 hide_login_progress(gc, _("You have been connecting and disconnecting too frequently. Wait ten minutes and try again. If you continue to try, you will need to wait even longer.")); |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
423 plugin_event(event_error, (void *)983, 0, 0, 0); |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
424 break; |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
425 case 0x05: |
392
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
388
diff
changeset
|
426 /* Incorrect nick/password */ |
1038
daad2440a642
[gaim-migrate @ 1048]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1032
diff
changeset
|
427 hide_login_progress(gc, _("Incorrect nickname or password.")); |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
428 plugin_event(event_error, (void *)980, 0, 0, 0); |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
429 break; |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
430 case 0x1c: |
392
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
388
diff
changeset
|
431 /* client too old */ |
1038
daad2440a642
[gaim-migrate @ 1048]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1032
diff
changeset
|
432 hide_login_progress(gc, _("The client version you are using is too old. Please upgrade at http://www.marko.net/gaim/")); |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
433 plugin_event(event_error, (void *)989, 0, 0, 0); |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
434 break; |
1038
daad2440a642
[gaim-migrate @ 1048]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1032
diff
changeset
|
435 default: |
daad2440a642
[gaim-migrate @ 1048]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1032
diff
changeset
|
436 hide_login_progress(gc, _("Authentication Failed")); |
daad2440a642
[gaim-migrate @ 1048]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1032
diff
changeset
|
437 break; |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
438 } |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
439 sprintf(debug_buff, "Login Error Code 0x%04x\n", |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
440 sess->logininfo.errorcode); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
441 debug_print(debug_buff); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
442 sprintf(debug_buff, "Error URL: %s\n", |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
443 sess->logininfo.errorurl); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
444 debug_print(debug_buff); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
445 #ifdef USE_APPLET |
746
5a908dd5cfc4
[gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
744
diff
changeset
|
446 set_user_state(offline); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
447 #endif |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
448 signoff(gc); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
449 return 0; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
450 } |
1 | 451 |
452 | |
946
acd4d81f2afc
[gaim-migrate @ 956]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
930
diff
changeset
|
453 if (sess->logininfo.email) { |
acd4d81f2afc
[gaim-migrate @ 956]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
930
diff
changeset
|
454 sprintf(debug_buff, "Email: %s\n", sess->logininfo.email); |
acd4d81f2afc
[gaim-migrate @ 956]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
930
diff
changeset
|
455 debug_print(debug_buff); |
acd4d81f2afc
[gaim-migrate @ 956]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
930
diff
changeset
|
456 } else { |
acd4d81f2afc
[gaim-migrate @ 956]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
930
diff
changeset
|
457 debug_print("Email is NULL\n"); |
acd4d81f2afc
[gaim-migrate @ 956]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
930
diff
changeset
|
458 } |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
459 sprintf(debug_buff, "Closing auth connection...\n"); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
460 debug_print(debug_buff); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
461 gdk_input_remove(gc->inpa); |
338
9d258a0aa560
[gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
335
diff
changeset
|
462 aim_conn_kill(sess, &command->conn); |
1 | 463 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
464 bosconn = aim_newconn(sess, AIM_CONN_TYPE_BOS, sess->logininfo.BOSIP); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
465 if (bosconn == NULL) { |
1 | 466 #ifdef USE_APPLET |
746
5a908dd5cfc4
[gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
744
diff
changeset
|
467 set_user_state(offline); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
468 #endif |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
469 hide_login_progress(gc, _("Internal Error")); |
1089
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
470 serv_close(gc); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
471 return -1; |
1081
efcacae6acdb
[gaim-migrate @ 1091]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1072
diff
changeset
|
472 } else if (bosconn->status & AIM_CONN_STATUS_CONNERR) { |
1 | 473 #ifdef USE_APPLET |
746
5a908dd5cfc4
[gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
744
diff
changeset
|
474 set_user_state(offline); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
475 #endif |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
476 hide_login_progress(gc, _("Could Not Connect")); |
1089
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
477 serv_close(gc); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
478 return -1; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
479 } |
1 | 480 |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
481 aim_conn_addhandler(sess, bosconn, 0x0009, 0x0003, gaim_bosrights, 0); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
482 aim_conn_addhandler(sess, bosconn, 0x0001, 0x0007, gaim_rateresp, 0); /* rate info */ |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
483 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_ACK, AIM_CB_ACK_ACK, NULL, 0); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
484 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_GEN, AIM_CB_GEN_SERVERREADY, gaim_server_ready, 0); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
485 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_GEN, AIM_CB_GEN_RATEINFO, NULL, 0); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
486 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_GEN, AIM_CB_GEN_REDIRECT, gaim_handle_redirect, 0); |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
487 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_STS, AIM_CB_STS_SETREPORTINTERVAL, gaim_reportinterval, 0); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
488 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_BUD, AIM_CB_BUD_RIGHTSINFO, gaim_parse_buddyrights, 0); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
489 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_BUD, AIM_CB_BUD_ONCOMING, gaim_parse_oncoming, 0); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
490 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_BUD, AIM_CB_BUD_OFFGOING, gaim_parse_offgoing, 0); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
491 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_MSG, AIM_CB_MSG_INCOMING, gaim_parse_incoming_im, 0); |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
492 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_LOC, AIM_CB_LOC_ERROR, gaim_parse_locerr, 0); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
493 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_MSG, AIM_CB_MSG_MISSEDCALL, gaim_parse_misses, 0); |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
494 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_GEN, AIM_CB_GEN_RATECHANGE, gaim_parse_ratechange, 0); |
771
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
495 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_GEN, AIM_CB_GEN_EVIL, gaim_parse_evilnotify, 0); |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
496 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_MSG, AIM_CB_MSG_ERROR, gaim_parse_msgerr, 0); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
497 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_LOC, AIM_CB_LOC_USERINFO, gaim_parse_user_info, 0); |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
498 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_MSG, AIM_CB_MSG_ACK, gaim_parse_msgack, 0); |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
499 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_CTN, AIM_CB_CTN_DEFAULT, aim_parse_unknown, 0); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
500 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_DEFAULT, aim_parse_unknown, 0); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
501 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_GEN, AIM_CB_GEN_MOTD, gaim_parse_motd, 0); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
502 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
503 aim_auth_sendcookie(sess, bosconn, sess->logininfo.cookie); |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
504 ((struct oscar_data *)gc->proto_data)->conn = bosconn; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
505 gc->inpa = gdk_input_add(bosconn->fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION, |
288
6e609d42f767
[gaim-migrate @ 298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
506 oscar_callback, bosconn); |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
507 set_login_progress(gc, 4, _("Connection established, cookie sent")); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
508 return 1; |
1 | 509 } |
510 | |
741
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
736
diff
changeset
|
511 int gaim_parse_login(struct aim_session_t *sess, |
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
736
diff
changeset
|
512 struct command_rx_struct *command, ...) { |
857
41bfae606d39
[gaim-migrate @ 867]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
840
diff
changeset
|
513 struct client_info_s info = {"AOL Instant Messenger (SM), version 4.1.2010/WIN32", 4, 30, 3141, "us", "en", 0x0004, 0x0001, 0x055}; |
840
595ac7759563
[gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
838
diff
changeset
|
514 char *key; |
741
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
736
diff
changeset
|
515 va_list ap; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
516 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess); |
741
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
736
diff
changeset
|
517 |
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
736
diff
changeset
|
518 va_start(ap, command); |
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
736
diff
changeset
|
519 key = va_arg(ap, char *); |
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
736
diff
changeset
|
520 va_end(ap); |
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
736
diff
changeset
|
521 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
522 aim_send_login(sess, command->conn, gc->username, gc->password, &info, key); |
747
eec93c5929b9
[gaim-migrate @ 757]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
746
diff
changeset
|
523 return 1; |
741
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
736
diff
changeset
|
524 } |
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
736
diff
changeset
|
525 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
526 int gaim_server_ready(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
527 struct command_rx_struct *command, ...) { |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
528 static int id = 1; |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
529 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
530 switch (command->conn->type) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
531 case AIM_CONN_TYPE_BOS: |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
532 aim_setversions(sess, command->conn); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
533 aim_bos_reqrate(sess, command->conn); /* request rate info */ |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
534 debug_print("done with BOS ServerReady\n"); |
1 | 535 break; |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
536 case AIM_CONN_TYPE_CHATNAV: |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
537 debug_print("chatnav: got server ready\n"); |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
538 aim_conn_addhandler(sess, command->conn, AIM_CB_FAM_CTN, AIM_CB_CTN_INFO, gaim_chatnav_info, 0); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
539 aim_bos_reqrate(sess, command->conn); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
540 aim_bos_ackrateresp(sess, command->conn); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
541 aim_chatnav_clientready(sess, command->conn); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
542 aim_chatnav_reqrights(sess, command->conn); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
543 break; |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
544 case AIM_CONN_TYPE_CHAT: |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
545 debug_print("chat: got server ready\n"); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
546 aim_conn_addhandler(sess, command->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_USERJOIN, gaim_chat_join, 0); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
547 aim_conn_addhandler(sess, command->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_USERLEAVE, gaim_chat_leave, 0); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
548 aim_conn_addhandler(sess, command->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_ROOMINFOUPDATE, gaim_chat_info_update, 0); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
549 aim_conn_addhandler(sess, command->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_INCOMINGMSG, gaim_chat_incoming_msg, 0); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
550 aim_bos_reqrate(sess, command->conn); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
551 aim_bos_ackrateresp(sess, command->conn); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
552 aim_chat_clientready(sess, command->conn); |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
553 serv_got_joined_chat(gc, id++, aim_chat_getname(command->conn)); |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
554 break; |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
555 case AIM_CONN_TYPE_RENDEZVOUS: |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
556 break; |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
557 default: /* huh? */ |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
558 sprintf(debug_buff, "server ready: got unexpected connection type %04x\n", command->conn->type); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
559 debug_print(debug_buff); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
560 break; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
561 } |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
562 return 1; |
1 | 563 } |
564 | |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
565 int gaim_handle_redirect(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
566 struct command_rx_struct *command, ...) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
567 va_list ap; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
568 int serviceid; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
569 char *ip; |
840
595ac7759563
[gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
838
diff
changeset
|
570 unsigned char *cookie; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
571 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess); |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
572 struct oscar_data *odata = (struct oscar_data *)gc->proto_data; |
1 | 573 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
574 va_start(ap, command); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
575 serviceid = va_arg(ap, int); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
576 ip = va_arg(ap, char *); |
840
595ac7759563
[gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
838
diff
changeset
|
577 cookie = va_arg(ap, unsigned char *); |
1 | 578 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
579 switch(serviceid) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
580 case 0x7: /* Authorizer */ |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
581 debug_print("Reconnecting with authorizor...\n"); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
582 { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
583 struct aim_conn_t *tstconn = aim_newconn(sess, AIM_CONN_TYPE_AUTH, ip); |
1081
efcacae6acdb
[gaim-migrate @ 1091]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1072
diff
changeset
|
584 if (tstconn == NULL || tstconn->status & AIM_CONN_STATUS_RESOLVERR) |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
585 debug_print("unable to reconnect with authorizer\n"); |
331
f3c8d79688db
[gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
319
diff
changeset
|
586 else { |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
587 odata->paspa = gdk_input_add(tstconn->fd, |
331
f3c8d79688db
[gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
319
diff
changeset
|
588 GDK_INPUT_READ | GDK_INPUT_EXCEPTION, |
f3c8d79688db
[gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
319
diff
changeset
|
589 oscar_callback, tstconn); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
590 aim_auth_sendcookie(sess, tstconn, cookie); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
591 } |
331
f3c8d79688db
[gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
319
diff
changeset
|
592 } |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
593 break; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
594 case 0xd: /* ChatNav */ |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
595 { |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
596 struct aim_conn_t *tstconn = aim_newconn(sess, AIM_CONN_TYPE_CHATNAV, ip); |
1081
efcacae6acdb
[gaim-migrate @ 1091]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1072
diff
changeset
|
597 if (tstconn == NULL || tstconn->status & AIM_CONN_STATUS_RESOLVERR) { |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
598 debug_print("unable to connect to chatnav server\n"); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
599 return 1; |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
600 } |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
601 aim_conn_addhandler(sess, tstconn, 0x0001, 0x0003, gaim_server_ready, 0); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
602 aim_auth_sendcookie(sess, tstconn, cookie); |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
603 odata->cnpa = gdk_input_add(tstconn->fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION, |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
604 oscar_callback, tstconn); |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
605 } |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
606 debug_print("chatnav: connected\n"); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
607 break; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
608 case 0xe: /* Chat */ |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
609 { |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
610 struct aim_conn_t *tstconn = aim_newconn(sess, AIM_CONN_TYPE_CHAT, ip); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
611 char *roomname = va_arg(ap, char *); |
312
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
612 struct chat_connection *ccon; |
1082
13df4e342cff
[gaim-migrate @ 1092]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1081
diff
changeset
|
613 if (tstconn == NULL || tstconn->status & AIM_CONN_STATUS_RESOLVERR) { |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
614 debug_print("unable to connect to chat server\n"); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
615 return 1; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
616 } |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
617 sprintf(debug_buff, "Connected to chat room %s\n", roomname); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
618 debug_print(debug_buff); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
619 |
312
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
620 ccon = g_new0(struct chat_connection, 1); |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
621 ccon->conn = tstconn; |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
622 ccon->fd = tstconn->fd; |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
623 ccon->name = g_strdup(roomname); |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
624 |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
625 ccon->inpa = gdk_input_add(tstconn->fd, |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
626 GDK_INPUT_READ | GDK_INPUT_EXCEPTION, |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
627 oscar_callback, tstconn); |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
628 |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
629 odata->oscar_chats = g_slist_append(odata->oscar_chats, ccon); |
312
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
630 |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
631 aim_chat_attachname(tstconn, roomname); |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
632 aim_conn_addhandler(sess, tstconn, 0x0001, 0x0003, gaim_server_ready, 0); |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
633 aim_auth_sendcookie(sess, tstconn, cookie); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
634 } |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
635 break; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
636 default: /* huh? */ |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
637 sprintf(debug_buff, "got redirect for unknown service 0x%04x\n", |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
638 serviceid); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
639 debug_print(debug_buff); |
1 | 640 break; |
641 } | |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
642 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
643 va_end(ap); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
644 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
645 return 1; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
646 } |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
647 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
648 int gaim_parse_oncoming(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
649 struct command_rx_struct *command, ...) { |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
650 struct aim_userinfo_s *info; |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
651 time_t time_idle; |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
652 int type = 0; |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
653 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess); |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
654 |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
655 va_list ap; |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
656 va_start(ap, command); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
657 info = va_arg(ap, struct aim_userinfo_s *); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
658 va_end(ap); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
659 |
900
e18815f5a4e9
[gaim-migrate @ 910]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
660 if (info->flags & AIM_FLAG_UNCONFIRMED) |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
661 type |= UC_UNCONFIRMED; |
900
e18815f5a4e9
[gaim-migrate @ 910]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
662 else if (info->flags & AIM_FLAG_ADMINISTRATOR) |
771
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
663 type |= UC_ADMIN; |
900
e18815f5a4e9
[gaim-migrate @ 910]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
664 else if (info->flags & AIM_FLAG_AOL) |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
665 type |= UC_AOL; |
900
e18815f5a4e9
[gaim-migrate @ 910]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
666 else if (info->flags & AIM_FLAG_FREE) |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
667 type |= UC_NORMAL; |
900
e18815f5a4e9
[gaim-migrate @ 910]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
668 if (info->flags & AIM_FLAG_AWAY) |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
669 type |= UC_UNAVAILABLE; |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
670 |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
671 if (info->idletime) { |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
672 time(&time_idle); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
673 time_idle -= info->idletime*60; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
674 } else |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
675 time_idle = 0; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
676 |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
677 serv_got_update(gc, info->sn, 1, info->warnlevel/10, info->onlinesince, |
513
eaddaa0dbbcb
[gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
512
diff
changeset
|
678 time_idle, type, info->capabilities); |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
679 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
680 return 1; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
681 } |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
682 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
683 int gaim_parse_offgoing(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
684 struct command_rx_struct *command, ...) { |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
685 char *sn; |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
686 va_list ap; |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
687 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess); |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
688 |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
689 va_start(ap, command); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
690 sn = va_arg(ap, char *); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
691 va_end(ap); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
692 |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
693 serv_got_update(gc, sn, 0, 0, 0, 0, 0, 0); |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
694 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
695 return 1; |
1 | 696 } |
697 | |
1064
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
698 static void cancel_direct_im(gpointer w, struct ask_direct *d) { |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
699 debug_printf("Freeing DirectIM prompts.\n"); |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
700 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
701 g_free(d->sn); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
702 g_free(d); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
703 } |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
704 |
1064
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
705 static void delete_direct_im(gpointer w, struct direct_im *d) { |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
706 struct oscar_data *od = (struct oscar_data *)d->gc->proto_data; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
707 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
708 od->direct_ims = g_slist_remove(od->direct_ims, d); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
709 gdk_input_remove(d->watcher); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
710 aim_conn_kill(od->sess, &d->conn); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
711 g_free(d); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
712 } |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
713 |
1064
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
714 static int accept_direct_im(gpointer w, struct ask_direct *d) { |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
715 struct gaim_connection *gc = d->gc; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
716 struct oscar_data *od = (struct oscar_data *)gc->proto_data; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
717 struct direct_im *dim; |
1072
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1064
diff
changeset
|
718 char buf[256]; |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
719 |
1064
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
720 debug_printf("Accepted DirectIM.\n"); |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
721 |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
722 dim = find_direct_im(od, d->sn); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
723 if (dim) { |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
724 cancel_direct_im(w, d); /* 40 */ |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
725 return; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
726 } |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
727 dim = g_new0(struct direct_im, 1); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
728 dim->gc = d->gc; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
729 g_snprintf(dim->name, sizeof dim->name, "%s", d->sn); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
730 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
731 if ((dim->conn = aim_directim_connect(od->sess, od->conn, d->priv)) == NULL) { |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
732 g_free(dim); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
733 cancel_direct_im(w, d); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
734 return; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
735 } |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
736 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
737 if (!(dim->cnv = find_conversation(d->sn))) dim->cnv = new_conversation(d->sn); |
1072
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1064
diff
changeset
|
738 g_snprintf(buf, sizeof buf, _("<B>Direct IM with %s established</B>"), d->sn); |
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1064
diff
changeset
|
739 write_to_conv(dim->cnv, buf, WFLAG_SYSTEM, NULL); |
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1064
diff
changeset
|
740 |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
741 gtk_signal_connect(GTK_OBJECT(dim->cnv->window), "destroy", |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
742 GTK_SIGNAL_FUNC(delete_direct_im), dim); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
743 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
744 od->direct_ims = g_slist_append(od->direct_ims, dim); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
745 dim->watcher = gdk_input_add(dim->conn->fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION, |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
746 oscar_callback, dim->conn); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
747 aim_conn_addhandler(od->sess, dim->conn, AIM_CB_FAM_OFT, AIM_CB_OFT_DIRECTIMINCOMING, |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
748 gaim_directim_incoming, 0); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
749 aim_conn_addhandler(od->sess, dim->conn, AIM_CB_FAM_OFT, AIM_CB_OFT_DIRECTIMDISCONNECT, |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
750 gaim_directim_disconnect, 0); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
751 aim_conn_addhandler(od->sess, dim->conn, AIM_CB_FAM_OFT, AIM_CB_OFT_DIRECTIMTYPING, |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
752 gaim_directim_typing, 0); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
753 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
754 cancel_direct_im(w, d); |
1064
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
755 |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
756 return TRUE; |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
757 } |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
758 |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
759 static void cancel_getfile(gpointer w, struct ask_getfile *g) { |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
760 g_free(g->ip); |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
761 g_free(g->cookie); |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
762 g_free(g->sn); |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
763 g_free(g); |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
764 } |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
765 |
1064
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
766 static int accept_getfile(gpointer w, struct ask_getfile *g) { |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
767 struct gaim_connection *gc = g->gc; |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
768 struct oscar_data *od = (struct oscar_data *)gc->proto_data; |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
769 struct aim_conn_t *newconn; |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
770 |
1064
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
771 /* |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
772 if ((newconn = aim_accepttransfer(od->sess, od->conn, g->sn, g->cookie, g->ip, od->sess->oft.listing, AIM_CAPS_GETFILE)) == NULL) { |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
773 cancel_getfile(w, g); |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
774 return; |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
775 } |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
776 */ |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
777 |
1064
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
778 do_error_dialog("getfile FIXME", "ha"); |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
779 |
1064
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
780 cancel_getfile(w, g); |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
781 |
1064
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
782 return TRUE; |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
783 } |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
784 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
785 int gaim_parse_incoming_im(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
786 struct command_rx_struct *command, ...) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
787 int channel; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
788 va_list ap; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
789 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess); |
1 | 790 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
791 va_start(ap, command); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
792 channel = va_arg(ap, int); |
1 | 793 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
794 /* channel 1: standard message */ |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
795 if (channel == 1) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
796 struct aim_userinfo_s *userinfo; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
797 char *msg = NULL; |
744
f53e8f48628d
[gaim-migrate @ 754]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
741
diff
changeset
|
798 char *tmp = g_malloc(BUF_LONG); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
799 u_int icbmflags = 0; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
800 u_short flag1, flag2; |
1 | 801 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
802 userinfo = va_arg(ap, struct aim_userinfo_s *); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
803 msg = va_arg(ap, char *); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
804 icbmflags = va_arg(ap, u_int); |
464 | 805 flag1 = (u_short)va_arg(ap, u_int); |
806 flag2 = (u_short)va_arg(ap, u_int); | |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
807 va_end(ap); |
1 | 808 |
744
f53e8f48628d
[gaim-migrate @ 754]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
741
diff
changeset
|
809 g_snprintf(tmp, BUF_LONG, "%s", msg); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
810 serv_got_im(gc, userinfo->sn, tmp, icbmflags & AIM_IMFLAGS_AWAY); |
744
f53e8f48628d
[gaim-migrate @ 754]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
741
diff
changeset
|
811 g_free(tmp); |
252
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
812 } else if (channel == 2) { |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
813 struct aim_userinfo_s *userinfo; |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
814 int rendtype = va_arg(ap, int); |
445
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
423
diff
changeset
|
815 if (rendtype & AIM_CAPS_CHAT) { |
252
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
816 char *msg, *encoding, *lang; |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
817 struct aim_chat_roominfo *roominfo; |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
818 |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
819 userinfo = va_arg(ap, struct aim_userinfo_s *); |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
820 roominfo = va_arg(ap, struct aim_chat_roominfo *); |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
821 msg = va_arg(ap, char *); |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
822 encoding = va_arg(ap, char *); |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
823 lang = va_arg(ap, char *); |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
824 va_end(ap); |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
825 |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
826 serv_got_chat_invite(gc, |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
827 roominfo->name, |
693
30a8e386849d
[gaim-migrate @ 703]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
692
diff
changeset
|
828 roominfo->exchange, |
252
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
829 userinfo->sn, |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
830 msg); |
445
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
423
diff
changeset
|
831 } else if (rendtype & AIM_CAPS_SENDFILE) { |
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
423
diff
changeset
|
832 } else if (rendtype & AIM_CAPS_GETFILE) { |
1064
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
833 char *ip, *cookie; |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
834 struct aim_conn_t *newconn; |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
835 struct ask_getfile *g = g_new0(struct ask_getfile, 1); |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
836 char buf[256]; |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
837 |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
838 userinfo = va_arg(ap, struct aim_userinfo_s *); |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
839 ip = va_arg(ap, char *); |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
840 cookie = va_arg(ap, char *); |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
841 va_end(ap); |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
842 |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
843 debug_printf("%s received getfile request from %s (%s)\n", |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
844 gc->username, userinfo->sn, ip); |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
845 |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
846 g->gc = gc; |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
847 g->sn = g_strdup(userinfo->sn); |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
848 g->cookie = g_strdup(cookie); |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
849 g->ip = g_strdup(ip); |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
850 g_snprintf(buf, sizeof buf, "%s has just asked to get a file from %s.", |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
851 userinfo->sn, gc->username); |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
852 do_ask_dialog(buf, g, accept_getfile, cancel_getfile); |
445
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
423
diff
changeset
|
853 } else if (rendtype & AIM_CAPS_VOICE) { |
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
423
diff
changeset
|
854 } else if (rendtype & AIM_CAPS_BUDDYICON) { |
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
423
diff
changeset
|
855 } else if (rendtype & AIM_CAPS_IMIMAGE) { |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
856 struct aim_directim_priv *priv; |
1064
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
857 struct ask_direct *d = g_new0(struct ask_direct, 1); |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
858 char buf[256]; |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
859 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
860 userinfo = va_arg(ap, struct aim_userinfo_s *); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
861 priv = va_arg(ap, struct aim_directim_priv *); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
862 va_end(ap); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
863 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
864 debug_printf("%s received direct im request from %s (%s)\n", |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
865 gc->username, userinfo->sn, priv->ip); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
866 |
1064
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
867 d->gc = gc; |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
868 d->sn = g_strdup(userinfo->sn); |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
869 d->priv = priv; |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
870 g_snprintf(buf, sizeof buf, "%s has just asked to directly connect to %s.", |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
871 userinfo->sn, gc->username); |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
872 do_ask_dialog(buf, d, accept_direct_im, cancel_direct_im); |
283
0f14e6d8a51b
[gaim-migrate @ 293]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
282
diff
changeset
|
873 } else { |
0f14e6d8a51b
[gaim-migrate @ 293]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
282
diff
changeset
|
874 sprintf(debug_buff, "Unknown rendtype %d\n", rendtype); |
0f14e6d8a51b
[gaim-migrate @ 293]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
282
diff
changeset
|
875 debug_print(debug_buff); |
252
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
876 } |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
877 } |
1 | 878 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
879 return 1; |
1 | 880 } |
881 | |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
882 int gaim_parse_misses(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
883 struct command_rx_struct *command, ...) { |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
884 va_list ap; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
885 u_short chan, nummissed, reason; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
886 struct aim_userinfo_s *userinfo; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
887 char buf[1024]; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
888 |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
889 va_start(ap, command); |
838
7714587cd1f9
[gaim-migrate @ 848]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
836
diff
changeset
|
890 chan = (u_short)va_arg(ap, u_int); |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
891 userinfo = va_arg(ap, struct aim_userinfo_s *); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
892 nummissed = (u_short)va_arg(ap, u_int); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
893 reason = (u_short)va_arg(ap, u_int); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
894 va_end(ap); |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
895 |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
896 switch(reason) { |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
897 case 1: |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
898 /* message too large */ |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
899 sprintf(buf, _("You missed a message from %s because it was too large."), userinfo->sn); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
900 do_error_dialog(buf, _("Gaim - Error")); |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
901 plugin_event(event_error, (void *)961, 0, 0, 0); |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
902 break; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
903 default: |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
904 sprintf(buf, _("You missed a message from %s for unknown reasons."), userinfo->sn); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
905 do_error_dialog(buf, _("Gaim - Error")); |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
906 plugin_event(event_error, (void *)970, 0, 0, 0); |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
907 break; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
908 } |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
909 |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
910 return 1; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
911 } |
709
957957d0dc2c
[gaim-migrate @ 719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
704
diff
changeset
|
912 |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
913 int gaim_parse_msgerr(struct aim_session_t *sess, |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
914 struct command_rx_struct *command, ...) { |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
915 va_list ap; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
916 char *destn; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
917 u_short reason; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
918 char buf[1024]; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
919 |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
920 va_start(ap, command); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
921 destn = va_arg(ap, char *); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
922 reason = (u_short)va_arg(ap, u_int); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
923 va_end(ap); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
924 |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
925 sprintf(buf, _("Your message to %s did not get sent: %s"), destn, |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
926 (reason < msgerrreasonlen) ? msgerrreason[reason] : _("Reason unknown")); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
927 do_error_dialog(buf, _("Gaim - Error")); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
928 |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
929 return 1; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
930 } |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
931 |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
932 int gaim_parse_locerr(struct aim_session_t *sess, |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
933 struct command_rx_struct *command, ...) { |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
934 va_list ap; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
935 char *destn; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
936 u_short reason; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
937 char buf[1024]; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
938 |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
939 va_start(ap, command); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
940 destn = va_arg(ap, char *); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
941 reason = (u_short)va_arg(ap, u_int); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
942 va_end(ap); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
943 |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
944 sprintf(buf, _("User information for %s unavailable: %s"), destn, |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
945 (reason < msgerrreasonlen) ? msgerrreason[reason] : _("Reason unknown")); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
946 do_error_dialog(buf, _("Gaim - Error")); |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
947 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
948 return 1; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
949 } |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
950 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
951 int gaim_parse_user_info(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
952 struct command_rx_struct *command, ...) { |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
953 struct aim_userinfo_s *info; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
954 char *prof_enc = NULL, *prof = NULL; |
249
810c595258c8
[gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
248
diff
changeset
|
955 u_short infotype; |
247
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
956 char buf[BUF_LONG]; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
957 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess); |
247
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
958 va_list ap; |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
959 |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
960 va_start(ap, command); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
961 info = va_arg(ap, struct aim_userinfo_s *); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
962 prof_enc = va_arg(ap, char *); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
963 prof = va_arg(ap, char *); |
464 | 964 infotype = (u_short)va_arg(ap, u_int); |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
965 va_end(ap); |
247
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
966 |
249
810c595258c8
[gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
248
diff
changeset
|
967 if (prof == NULL || !strlen(prof)) { |
392
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
388
diff
changeset
|
968 /* no info/away message */ |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
969 char buf[1024]; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
970 sprintf(buf, _("%s has no info/away message."), info->sn); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
971 do_error_dialog(buf, _("Gaim - Error")); |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
972 plugin_event(event_error, (void *)977, 0, 0, 0); |
249
810c595258c8
[gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
248
diff
changeset
|
973 return 1; |
810c595258c8
[gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
248
diff
changeset
|
974 } |
810c595258c8
[gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
248
diff
changeset
|
975 |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
976 snprintf(buf, sizeof buf, _("Username : <B>%s</B>\n<BR>" |
247
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
977 "Warning Level : <B>%d %%</B>\n<BR>" |
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
978 "Online Since : <B>%s</B><BR>" |
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
979 "Idle Minutes : <B>%d</B>\n<BR><HR><BR>" |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
980 "%s\n"), |
247
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
981 info->sn, |
601
e670cdb5fb2f
[gaim-migrate @ 611]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
592
diff
changeset
|
982 info->warnlevel/10, |
247
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
983 asctime(localtime(&info->onlinesince)), |
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
984 info->idletime, |
592
7c75d69a1129
[gaim-migrate @ 602]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
535
diff
changeset
|
985 infotype == AIM_GETINFO_GENERALINFO ? prof : |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
986 away_subs(prof, gc->username)); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
987 g_show_info_text(away_subs(buf, gc->username)); |
247
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
988 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
989 return 1; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
990 } |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
991 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
992 int gaim_parse_motd(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
993 struct command_rx_struct *command, ...) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
994 char *msg; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
995 u_short id; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
996 va_list ap; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
997 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
998 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
999 va_start(ap, command); |
464 | 1000 id = (u_short)va_arg(ap, u_int); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1001 msg = va_arg(ap, char *); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1002 va_end(ap); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1003 |
771
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1004 sprintf(debug_buff, "MOTD: %s (%d)\n", msg, id); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1005 debug_print(debug_buff); |
282
918db59d3814
[gaim-migrate @ 292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
279
diff
changeset
|
1006 sprintf(debug_buff, "Gaim %s / Libfaim %s\n", |
918db59d3814
[gaim-migrate @ 292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
279
diff
changeset
|
1007 VERSION, aim_getbuildstring()); |
918db59d3814
[gaim-migrate @ 292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
279
diff
changeset
|
1008 debug_print(debug_buff); |
771
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1009 if (id != 4) |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1010 do_error_dialog(_("Your connection may be lost."), |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1011 _("AOL error")); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1012 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
1013 if (gc->keepalive < 0) |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
1014 update_keepalive(gc, gc->keepalive); |
891
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
857
diff
changeset
|
1015 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1016 return 1; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1017 } |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1018 |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
1019 int gaim_chatnav_info(struct aim_session_t *sess, |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
1020 struct command_rx_struct *command, ...) { |
445
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
423
diff
changeset
|
1021 va_list ap; |
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
423
diff
changeset
|
1022 u_short type; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
1023 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess); |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1024 struct oscar_data *odata = (struct oscar_data *)gc->proto_data; |
445
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
423
diff
changeset
|
1025 |
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
423
diff
changeset
|
1026 va_start(ap, command); |
464 | 1027 type = (u_short)va_arg(ap, u_int); |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1028 |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1029 switch(type) { |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1030 case 0x0002: { |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1031 int maxrooms; |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1032 struct aim_chat_exchangeinfo *exchanges; |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1033 int exchangecount, i = 0; |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1034 |
466 | 1035 maxrooms = (u_char)va_arg(ap, u_int); |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1036 exchangecount = va_arg(ap, int); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1037 exchanges = va_arg(ap, struct aim_chat_exchangeinfo *); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1038 va_end(ap); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1039 |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1040 debug_print("chat info: Chat Rights:\n"); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1041 sprintf(debug_buff, "chat info: \tMax Concurrent Rooms: %d\n", maxrooms); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1042 debug_print(debug_buff); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1043 sprintf(debug_buff, "chat info: \tExchange List: (%d total)\n", exchangecount); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1044 debug_print(debug_buff); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1045 while (i < exchangecount) { |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1046 sprintf(debug_buff, "chat info: \t\t%x: %s (%s/%s)\n", |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1047 exchanges[i].number, |
1039
67ed2ee5be9f
[gaim-migrate @ 1049]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1038
diff
changeset
|
1048 exchanges[i].name ? exchanges[i].name : "NULL", |
67ed2ee5be9f
[gaim-migrate @ 1049]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1038
diff
changeset
|
1049 exchanges[i].charset1 ? exchanges[i].charset1 : "NULL", |
67ed2ee5be9f
[gaim-migrate @ 1049]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1038
diff
changeset
|
1050 exchanges[i].lang1 ? exchanges[i].lang1 : "NULL"); |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1051 debug_print(debug_buff); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1052 i++; |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1053 } |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1054 if (odata->create_exchange) { |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1055 sprintf(debug_buff, "creating room %s\n", odata->create_name); |
904
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1056 debug_print(debug_buff); |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1057 aim_chatnav_createroom(sess, command->conn, odata->create_name, |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1058 odata->create_exchange); |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1059 odata->create_exchange = 0; |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1060 g_free(odata->create_name); |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1061 odata->create_name = NULL; |
904
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1062 } |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1063 } |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1064 break; |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1065 case 0x0008: { |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1066 char *fqcn, *name, *ck; |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1067 u_short instance, flags, maxmsglen, maxoccupancy, unknown; |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1068 unsigned char createperms; |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1069 unsigned long createtime; |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1070 |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1071 fqcn = va_arg(ap, char *); |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1072 instance = (u_short)va_arg(ap, u_int); |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1073 flags = (u_short)va_arg(ap, u_int); |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1074 createtime = va_arg(ap, unsigned long); |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1075 maxmsglen = (u_short)va_arg(ap, u_int); |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1076 maxoccupancy = (u_short)va_arg(ap, u_int); |
906
7b976e5e1c3a
[gaim-migrate @ 916]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
905
diff
changeset
|
1077 createperms = (unsigned char)va_arg(ap, int); |
904
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1078 unknown = (u_short)va_arg(ap, u_int); |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1079 name = va_arg(ap, char *); |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1080 ck = va_arg(ap, char *); |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1081 va_end(ap); |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1082 |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1083 sprintf(debug_buff, "created room: %s %d %d %lu %d %d %d %d %s %s\n", fqcn, instance, flags, createtime, maxmsglen, maxoccupancy, createperms, unknown, name, ck); |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1084 debug_print(debug_buff); |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1085 if (flags & 0x4) { |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1086 sprintf(debug_buff, "joining %s on exchange 5\n", name); |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1087 debug_print(debug_buff); |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1088 aim_chat_join(odata->sess, odata->conn, 5, ck); |
904
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1089 } else |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1090 sprintf(debug_buff, "joining %s on exchange 4\n", name);{ |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1091 debug_print(debug_buff); |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1092 aim_chat_join(odata->sess, odata->conn, 4, ck); |
904
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1093 } |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1094 } |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1095 break; |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1096 default: |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1097 va_end(ap); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1098 sprintf(debug_buff, "chatnav info: unknown type (%04x)\n", type); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1099 debug_print(debug_buff); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1100 break; |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1101 } |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
1102 return 1; |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
1103 } |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1104 |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1105 int gaim_chat_join(struct aim_session_t *sess, |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1106 struct command_rx_struct *command, ...) { |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1107 va_list ap; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1108 int count, i = 0; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1109 struct aim_userinfo_s *info; |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
1110 struct gaim_connection *g = find_gaim_conn_by_aim_sess(sess); |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1111 |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
1112 GSList *bcs = g->buddy_chats; |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
466
diff
changeset
|
1113 struct conversation *b = NULL; |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1114 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1115 va_start(ap, command); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1116 count = va_arg(ap, int); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1117 info = va_arg(ap, struct aim_userinfo_s *); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1118 va_end(ap); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1119 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1120 while(bcs) { |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
466
diff
changeset
|
1121 b = (struct conversation *)bcs->data; |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1122 if (!strcasecmp(b->name, (char *)command->conn->priv)) |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1123 break; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1124 bcs = bcs->next; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1125 b = NULL; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1126 } |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1127 if (!b) |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1128 return 1; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1129 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1130 while (i < count) |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1131 add_chat_buddy(b, info[i++].sn); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1132 |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1133 return 1; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1134 } |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1135 |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1136 int gaim_chat_leave(struct aim_session_t *sess, |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1137 struct command_rx_struct *command, ...) { |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1138 va_list ap; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1139 int count, i = 0; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1140 struct aim_userinfo_s *info; |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
1141 struct gaim_connection *g = find_gaim_conn_by_aim_sess(sess); |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1142 |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
1143 GSList *bcs = g->buddy_chats; |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
466
diff
changeset
|
1144 struct conversation *b = NULL; |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1145 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1146 va_start(ap, command); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1147 count = va_arg(ap, int); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1148 info = va_arg(ap, struct aim_userinfo_s *); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1149 va_end(ap); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1150 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1151 while(bcs) { |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
466
diff
changeset
|
1152 b = (struct conversation *)bcs->data; |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1153 if (!strcasecmp(b->name, (char *)command->conn->priv)) |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1154 break; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1155 bcs = bcs->next; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1156 b = NULL; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1157 } |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1158 if (!b) |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1159 return 1; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1160 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1161 while (i < count) |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1162 remove_chat_buddy(b, info[i++].sn); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1163 |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1164 return 1; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1165 } |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1166 |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1167 int gaim_chat_info_update(struct aim_session_t *sess, |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1168 struct command_rx_struct *command, ...) { |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1169 debug_print("inside chat_info_update\n"); |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1170 return 1; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1171 } |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1172 |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1173 int gaim_chat_incoming_msg(struct aim_session_t *sess, |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1174 struct command_rx_struct *command, ...) { |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1175 va_list ap; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1176 struct aim_userinfo_s *info; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1177 char *msg; |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
1178 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess); |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1179 |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
1180 GSList *bcs = gc->buddy_chats; |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
466
diff
changeset
|
1181 struct conversation *b = NULL; |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1182 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1183 va_start(ap, command); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1184 info = va_arg(ap, struct aim_userinfo_s *); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1185 msg = va_arg(ap, char *); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1186 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1187 while(bcs) { |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
466
diff
changeset
|
1188 b = (struct conversation *)bcs->data; |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1189 if (!strcasecmp(b->name, (char *)command->conn->priv)) |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1190 break; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1191 bcs = bcs->next; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1192 b = NULL; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1193 } |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1194 if (!b) |
270
cfa39d39dec6
[gaim-migrate @ 280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
267
diff
changeset
|
1195 return 0; |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1196 |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
1197 serv_got_chat_in(gc, b->id, info->sn, 0, msg); |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1198 |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1199 return 1; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1200 } |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1201 |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1202 /* |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1203 * Recieved in response to an IM sent with the AIM_IMFLAGS_ACK option. |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1204 */ |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1205 int gaim_parse_msgack(struct aim_session_t *sess, struct command_rx_struct *command, ...) { |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1206 va_list ap; |
505
3bd51b3f07c3
[gaim-migrate @ 515]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
503
diff
changeset
|
1207 u_short type; |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1208 char *sn = NULL; |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1209 |
505
3bd51b3f07c3
[gaim-migrate @ 515]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
503
diff
changeset
|
1210 va_start(ap, command); |
3bd51b3f07c3
[gaim-migrate @ 515]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
503
diff
changeset
|
1211 type = (u_short)va_arg(ap, u_int); |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1212 sn = va_arg(ap, char *); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1213 va_end(ap); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1214 |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1215 sprintf(debug_buff, "Sent message to %s.\n", sn); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1216 debug_print(debug_buff); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1217 |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1218 return 1; |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1219 } |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1220 |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1221 int gaim_parse_ratechange(struct aim_session_t *sess, struct command_rx_struct *command, ...) { |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1222 va_list ap; |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1223 unsigned long newrate; |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1224 |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1225 va_start(ap, command); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1226 newrate = va_arg(ap, unsigned long); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1227 va_end(ap); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1228 |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1229 sprintf(debug_buff, "ratechange: %lu\n", newrate); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1230 debug_print(debug_buff); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1231 |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1232 return 1; |
840
595ac7759563
[gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
838
diff
changeset
|
1233 } |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1234 |
771
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1235 int gaim_parse_evilnotify(struct aim_session_t *sess, struct command_rx_struct *command, ...) { |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1236 va_list ap; |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1237 char *sn; |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1238 |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1239 va_start(ap, command); |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1240 sn = va_arg(ap, char *); |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1241 va_end(ap); |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1242 |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1243 serv_got_eviled(sn, 0); |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1244 |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1245 return 1; |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1246 } |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1247 |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1248 int gaim_rateresp(struct aim_session_t *sess, struct command_rx_struct *command, ...) { |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
1249 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess); |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1250 switch (command->conn->type) { |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1251 case AIM_CONN_TYPE_BOS: |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1252 aim_bos_ackrateresp(sess, command->conn); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1253 aim_bos_reqpersonalinfo(sess, command->conn); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1254 aim_bos_reqlocaterights(sess, command->conn); |
1051
713b0e14e0a9
[gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
1255 aim_bos_setprofile(sess, command->conn, gc->user->user_info, NULL, gaim_caps); |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1256 aim_bos_reqbuddyrights(sess, command->conn); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1257 |
1089
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
1258 account_online(gc); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
1259 serv_finish_login(gc); |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1260 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
1261 if (bud_list_cache_exists(gc)) |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
1262 do_import(NULL, gc); |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1263 |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1264 debug_print("buddy list loaded\n"); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1265 |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1266 aim_addicbmparam(sess, command->conn); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1267 aim_bos_reqicbmparaminfo(sess, command->conn); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1268 |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1269 aim_bos_reqrights(sess, command->conn); |
900
e18815f5a4e9
[gaim-migrate @ 910]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
1270 aim_bos_setgroupperm(sess, command->conn, AIM_FLAG_ALLUSERS); |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1271 aim_bos_setprivacyflags(sess, command->conn, AIM_PRIVFLAGS_ALLOWIDLE | |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1272 AIM_PRIVFLAGS_ALLOWMEMBERSINCE); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1273 |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1274 break; |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1275 default: |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1276 sprintf(debug_buff, "got rate response for unhandled connection type %04x\n", |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1277 command->conn->type); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1278 debug_print(debug_buff); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1279 break; |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1280 } |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1281 |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1282 return 1; |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1283 } |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1284 |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1285 int gaim_reportinterval(struct aim_session_t *sess, struct command_rx_struct *command, ...) { |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1286 if (command->data) { |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1287 sprintf(debug_buff, "minimum report interval: %d (seconds?)\n", aimutil_get16(command->data+10)); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1288 debug_print(debug_buff); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1289 } else |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1290 debug_print("NULL minimum report interval!\n"); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1291 return 1; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1292 } |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1293 |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1294 int gaim_parse_buddyrights(struct aim_session_t *sess, struct command_rx_struct *command, ...) { |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1295 va_list ap; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1296 u_short maxbuddies, maxwatchers; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1297 |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1298 va_start(ap, command); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1299 maxbuddies = (u_short)va_arg(ap, u_int); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1300 maxwatchers = (u_short)va_arg(ap, u_int); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1301 va_end(ap); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1302 |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1303 sprintf(debug_buff, "buddy list rights: Max buddies = %d / Max watchers = %d\n", maxbuddies, maxwatchers); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1304 debug_print(debug_buff); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1305 |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1306 return 1; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1307 } |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1308 |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1309 int gaim_bosrights(struct aim_session_t *sess, struct command_rx_struct *command, ...) { |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1310 u_short maxpermits, maxdenies; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1311 va_list ap; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1312 |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1313 va_start(ap, command); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1314 maxpermits = (u_short)va_arg(ap, u_int); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1315 maxdenies = (u_short)va_arg(ap, u_int); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1316 va_end(ap); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1317 |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1318 sprintf(debug_buff, "BOS rights: Max permit = %d / Max deny = %d\n", maxpermits, maxdenies); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1319 debug_print(debug_buff); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1320 |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1321 aim_bos_clientready(sess, command->conn); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1322 |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1323 aim_bos_reqservice(sess, command->conn, AIM_CONN_TYPE_CHATNAV); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1324 |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1325 return 1; |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1326 } |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1327 |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1328 static void oscar_keepalive(struct gaim_connection *gc) { |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1329 struct oscar_data *odata = (struct oscar_data *)gc->proto_data; |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1330 aim_flap_nop(odata->sess, odata->conn); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1331 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1332 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1333 static char *oscar_name() { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1334 return "Oscar"; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1335 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1336 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1337 static void oscar_send_im(struct gaim_connection *gc, char *name, char *message, int away) { |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1338 struct oscar_data *odata = (struct oscar_data *)gc->proto_data; |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1339 struct direct_im *dim = find_direct_im(odata, name); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1340 if (dim) { |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1341 aim_send_im_direct(odata->sess, dim->conn, message); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1342 } else { |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1343 if (away) |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1344 aim_send_im(odata->sess, odata->conn, name, AIM_IMFLAGS_AWAY, message); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1345 else |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1346 aim_send_im(odata->sess, odata->conn, name, AIM_IMFLAGS_ACK, message); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1347 } |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1348 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1349 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1350 static void oscar_get_info(struct gaim_connection *g, char *name) { |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1351 struct oscar_data *odata = (struct oscar_data *)g->proto_data; |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1352 aim_getinfo(odata->sess, odata->conn, name, AIM_GETINFO_GENERALINFO); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1353 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1354 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1355 static void oscar_get_away_msg(struct gaim_connection *g, char *name) { |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1356 struct oscar_data *odata = (struct oscar_data *)g->proto_data; |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1357 aim_getinfo(odata->sess, odata->conn, name, AIM_GETINFO_AWAYMESSAGE); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1358 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1359 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1360 static void oscar_set_dir(struct gaim_connection *g, char *first, char *middle, char *last, |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1361 char *maiden, char *city, char *state, char *country, int web) { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1362 /* FIXME : some of these things are wrong, but i'm lazy */ |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1363 struct oscar_data *odata = (struct oscar_data *)g->proto_data; |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1364 aim_setdirectoryinfo(odata->sess, odata->conn, first, middle, last, |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1365 maiden, NULL, NULL, city, state, NULL, 0, web); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1366 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1367 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1368 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1369 static void oscar_set_idle(struct gaim_connection *g, int time) { |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1370 struct oscar_data *odata = (struct oscar_data *)g->proto_data; |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1371 aim_bos_setidle(odata->sess, odata->conn, time); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1372 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1373 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1374 static void oscar_set_info(struct gaim_connection *g, char *info) { |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1375 struct oscar_data *odata = (struct oscar_data *)g->proto_data; |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1376 if (awaymessage) |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1377 aim_bos_setprofile(odata->sess, odata->conn, info, |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1378 awaymessage->message, gaim_caps); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1379 else |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1380 aim_bos_setprofile(odata->sess, odata->conn, info, |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1381 NULL, gaim_caps); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1382 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1383 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1384 static void oscar_set_away(struct gaim_connection *g, char *message) { |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1385 struct oscar_data *odata = (struct oscar_data *)g->proto_data; |
1051
713b0e14e0a9
[gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
1386 aim_bos_setprofile(odata->sess, odata->conn, g->user->user_info, message, gaim_caps); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1387 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1388 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1389 static void oscar_warn(struct gaim_connection *g, char *name, int anon) { |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1390 struct oscar_data *odata = (struct oscar_data *)g->proto_data; |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1391 aim_send_warning(odata->sess, odata->conn, name, anon); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1392 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1393 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1394 static void oscar_dir_search(struct gaim_connection *g, char *first, char *middle, char *last, |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1395 char *maiden, char *city, char *state, char *country, char *email) { |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1396 struct oscar_data *odata = (struct oscar_data *)g->proto_data; |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1397 if (strlen(email)) |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1398 aim_usersearch_address(odata->sess, odata->conn, email); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1399 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1400 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1401 static void oscar_add_buddy(struct gaim_connection *g, char *name) { |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1402 struct oscar_data *odata = (struct oscar_data *)g->proto_data; |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1403 aim_add_buddy(odata->sess, odata->conn, name); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1404 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1405 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1406 static void oscar_add_buddies(struct gaim_connection *g, GList *buddies) { |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1407 struct oscar_data *odata = (struct oscar_data *)g->proto_data; |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1408 char buf[MSG_LEN]; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1409 int n = 0; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1410 while (buddies) { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1411 if (n > MSG_LEN - 18) { |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1412 aim_bos_setbuddylist(odata->sess, odata->conn, buf); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1413 n = 0; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1414 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1415 n += g_snprintf(buf + n, sizeof(buf) - n, "%s&", (char *)buddies->data); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1416 buddies = buddies->next; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1417 } |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1418 aim_bos_setbuddylist(odata->sess, odata->conn, buf); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1419 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1420 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1421 static void oscar_remove_buddy(struct gaim_connection *g, char *name) { |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1422 struct oscar_data *odata = (struct oscar_data *)g->proto_data; |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1423 aim_remove_buddy(odata->sess, odata->conn, name); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1424 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1425 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1426 static void oscar_join_chat(struct gaim_connection *g, int exchange, char *name) { |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1427 struct oscar_data *odata = (struct oscar_data *)g->proto_data; |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1428 struct aim_conn_t *cur = NULL; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1429 sprintf(debug_buff, "Attempting to join chat room %s.\n", name); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1430 debug_print(debug_buff); |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1431 if ((cur = aim_getconn_type(odata->sess, AIM_CONN_TYPE_CHATNAV))) { |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1432 debug_print("chatnav exists, creating room\n"); |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1433 aim_chatnav_createroom(odata->sess, cur, name, exchange); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1434 } else { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1435 /* this gets tricky */ |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1436 debug_print("chatnav does not exist, opening chatnav\n"); |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1437 odata->create_exchange = exchange; |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1438 odata->create_name = g_strdup(name); |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1439 aim_bos_reqservice(odata->sess, odata->conn, AIM_CONN_TYPE_CHATNAV); |
891
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
857
diff
changeset
|
1440 } |
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
857
diff
changeset
|
1441 } |
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
857
diff
changeset
|
1442 |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1443 static void oscar_chat_invite(struct gaim_connection *g, int id, char *message, char *name) { |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1444 struct oscar_data *odata = (struct oscar_data *)g->proto_data; |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1445 GSList *bcs = g->buddy_chats; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1446 struct conversation *b = NULL; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1447 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1448 while (bcs) { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1449 b = (struct conversation *)bcs->data; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1450 if (id == b->id) |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1451 break; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1452 bcs = bcs->next; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1453 b = NULL; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1454 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1455 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1456 if (!b) |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1457 return; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1458 |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1459 aim_chat_invite(odata->sess, odata->conn, name, |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1460 message ? message : "", 0x4, b->name, 0x0); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1461 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1462 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1463 static void oscar_chat_leave(struct gaim_connection *g, int id) { |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1464 struct oscar_data *odata = g ? (struct oscar_data *)g->proto_data : NULL; |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1465 GSList *bcs = g->buddy_chats; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1466 struct conversation *b = NULL; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1467 struct chat_connection *c = NULL; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1468 int count = 0; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1469 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1470 while (bcs) { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1471 count++; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1472 b = (struct conversation *)bcs->data; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1473 if (id == b->id) |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1474 break; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1475 bcs = bcs->next; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1476 b = NULL; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1477 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1478 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1479 if (!b) |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1480 return; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1481 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1482 sprintf(debug_buff, "Attempting to leave room %s (currently in %d rooms)\n", |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1483 b->name, count); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1484 debug_print(debug_buff); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1485 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1486 c = find_oscar_chat(g, b->name); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1487 if (c != NULL) { |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1488 if (odata) |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1489 odata->oscar_chats = g_slist_remove(odata->oscar_chats, c); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1490 gdk_input_remove(c->inpa); |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1491 if (g && odata->sess) |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1492 aim_conn_kill(odata->sess, &c->conn); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1493 g_free(c->name); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1494 g_free(c); |
891
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
857
diff
changeset
|
1495 } |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1496 /* we do this because with Oscar it doesn't tell us we left */ |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1497 serv_got_chat_left(g, b->id); |
891
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
857
diff
changeset
|
1498 } |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1499 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1500 static void oscar_chat_whisper(struct gaim_connection *g, int id, char *who, char *message) { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1501 do_error_dialog("Sorry, Oscar doesn't whisper. Send an IM. (The last message was not received.)", |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1502 "Gaim - Chat"); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1503 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1504 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1505 static void oscar_chat_send(struct gaim_connection *g, int id, char *message) { |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1506 struct oscar_data *odata = (struct oscar_data *)g->proto_data; |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1507 struct aim_conn_t *cn; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1508 GSList *bcs = g->buddy_chats; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1509 struct conversation *b = NULL; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1510 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1511 while (bcs) { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1512 b = (struct conversation *)bcs->data; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1513 if (id == b->id) |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1514 break; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1515 bcs = bcs->next; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1516 b = NULL; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1517 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1518 if (!b) |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1519 return; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1520 |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1521 cn = aim_chat_getconn(odata->sess, b->name); |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1522 aim_chat_send_im(odata->sess, cn, message); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1523 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1524 |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1525 static char **oscar_list_icon(int uc) { |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1526 if (uc & UC_UNAVAILABLE) |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1527 return (char **)away_icon_xpm; |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1528 if (uc & UC_AOL) |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1529 return (char **)aol_icon_xpm; |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1530 if (uc & UC_NORMAL) |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1531 return (char **)free_icon_xpm; |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1532 if (uc & UC_ADMIN) |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1533 return (char **)admin_icon_xpm; |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1534 if (uc & UC_UNCONFIRMED) |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1535 return (char **)dt_icon_xpm; |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1536 return NULL; |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1537 } |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1538 |
1032
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1539 static void oscar_info(GtkObject *obj, char *who) { |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1540 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
|
1541 serv_get_info(gc, who); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1542 } |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1543 |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1544 static void oscar_away_msg(GtkObject *obj, char *who) { |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1545 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
|
1546 serv_get_away_msg(gc, who); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1547 } |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1548 |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1549 static int gaim_directim_initiate(struct aim_session_t *sess, struct command_rx_struct *command, ...) { |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1550 va_list ap; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1551 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1552 struct oscar_data *od = (struct oscar_data *)gc->proto_data; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1553 struct aim_directim_priv *priv; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1554 struct aim_conn_t *newconn; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1555 struct direct_im *dim; |
1072
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1064
diff
changeset
|
1556 char buf[256]; |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1557 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1558 va_start(ap, command); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1559 newconn = va_arg(ap, struct aim_conn_t *); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1560 va_end(ap); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1561 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1562 priv = (struct aim_directim_priv *)newconn->priv; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1563 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1564 debug_printf("DirectIM: initiate success to %s\n", priv->sn); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1565 dim = find_direct_im(od, priv->sn); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1566 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1567 dim->cnv = find_conversation(priv->sn); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1568 if (!dim->cnv) dim->cnv = new_conversation(priv->sn); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1569 gtk_signal_connect(GTK_OBJECT(dim->cnv->window), "destroy", |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1570 GTK_SIGNAL_FUNC(delete_direct_im), dim); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1571 gdk_input_remove(dim->watcher); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1572 dim->conn = newconn; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1573 dim->watcher = gdk_input_add(dim->conn->fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION, |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1574 oscar_callback, dim->conn); |
1072
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1064
diff
changeset
|
1575 g_snprintf(buf, sizeof buf, _("<B>Direct IM with %s established</B>"), priv->sn); |
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1064
diff
changeset
|
1576 write_to_conv(dim->cnv, buf, WFLAG_SYSTEM, NULL); |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1577 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1578 aim_conn_addhandler(sess, newconn, AIM_CB_FAM_OFT, AIM_CB_OFT_DIRECTIMINCOMING, |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1579 gaim_directim_incoming, 0); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1580 aim_conn_addhandler(sess, newconn, AIM_CB_FAM_OFT, AIM_CB_OFT_DIRECTIMDISCONNECT, |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1581 gaim_directim_disconnect, 0); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1582 aim_conn_addhandler(sess, newconn, AIM_CB_FAM_OFT, AIM_CB_OFT_DIRECTIMTYPING, |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1583 gaim_directim_typing, 0); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1584 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1585 return 1; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1586 } |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1587 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1588 static int gaim_directim_incoming(struct aim_session_t *sess, struct command_rx_struct *command, ...) { |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1589 va_list ap; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1590 char *sn = NULL, *msg = NULL; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1591 struct aim_conn_t *conn; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1592 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1593 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1594 va_start(ap, command); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1595 conn = va_arg(ap, struct aim_conn_t *); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1596 sn = va_arg(ap, char *); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1597 msg = va_arg(ap, char *); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1598 va_end(ap); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1599 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1600 debug_printf("Got DirectIM message from %s\n", sn); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1601 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1602 serv_got_im(gc, sn, msg, 0); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1603 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1604 return 1; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1605 } |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1606 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1607 static int gaim_directim_disconnect(struct aim_session_t *sess, struct command_rx_struct *command, ...) { |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1608 va_list ap; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1609 struct aim_conn_t *conn; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1610 char *sn; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1611 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1612 struct oscar_data *od = (struct oscar_data *)gc->proto_data; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1613 struct direct_im *dim; |
1072
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1064
diff
changeset
|
1614 char buf[256]; |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1615 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1616 va_start(ap, command); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1617 conn = va_arg(ap, struct aim_conn_t *); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1618 sn = va_arg(ap, char *); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1619 va_end(ap); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1620 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1621 debug_printf("%s disconnected Direct IM.\n", sn); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1622 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1623 dim = find_direct_im(od, sn); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1624 od->direct_ims = g_slist_remove(od->direct_ims, dim); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1625 gdk_input_remove(dim->watcher); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1626 gtk_signal_disconnect_by_data(GTK_OBJECT(dim->cnv->window), dim); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1627 |
1072
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1064
diff
changeset
|
1628 g_snprintf(buf, sizeof buf, _("<B>Direct IM with %s closed</B>"), sn); |
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1064
diff
changeset
|
1629 if (dim->cnv) |
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1064
diff
changeset
|
1630 write_to_conv(dim->cnv, buf, WFLAG_SYSTEM, NULL); |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1631 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1632 aim_conn_kill(sess, &conn); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1633 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1634 return 1; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1635 } |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1636 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1637 static int gaim_directim_typing(struct aim_session_t *sess, struct command_rx_struct *command, ...) { |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1638 va_list ap; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1639 char *sn; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1640 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1641 va_start(ap, command); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1642 sn = va_arg(ap, char *); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1643 va_end(ap); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1644 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1645 /* I had to leave this. It's just too funny. It reminds me of my sister. */ |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1646 debug_printf("ohmigod! %s has started typing (DirectIM). He's going to send you a message! *squeal*\n", sn); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1647 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1648 return 1; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1649 } |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1650 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1651 static void oscar_direct_im(GtkObject *obj, char *who) { |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1652 struct gaim_connection *gc = (struct gaim_connection *)gtk_object_get_user_data(obj); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1653 struct oscar_data *od = (struct oscar_data *)gc->proto_data; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1654 struct direct_im *dim; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1655 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1656 dim = find_direct_im(od, who); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1657 if (dim) { |
1064
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
1658 do_error_dialog("Direct IM request already pending.", "Unable"); |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1659 return; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1660 } |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1661 dim = g_new0(struct direct_im, 1); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1662 dim->gc = gc; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1663 g_snprintf(dim->name, sizeof dim->name, "%s", who); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1664 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1665 dim->conn = aim_directim_initiate(od->sess, od->conn, NULL, who); |
1072
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1064
diff
changeset
|
1666 if (dim->conn != NULL) { |
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1064
diff
changeset
|
1667 od->direct_ims = g_slist_append(od->direct_ims, dim); |
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1064
diff
changeset
|
1668 dim->watcher = gdk_input_add(dim->conn->fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION, |
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1064
diff
changeset
|
1669 oscar_callback, dim->conn); |
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1064
diff
changeset
|
1670 aim_conn_addhandler(od->sess, dim->conn, AIM_CB_FAM_OFT, AIM_CB_OFT_DIRECTIMINITIATE, |
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1064
diff
changeset
|
1671 gaim_directim_initiate, 0); |
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1064
diff
changeset
|
1672 } else { |
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1064
diff
changeset
|
1673 do_error_dialog(_("Unable to open Direct IM"), _("Error")); |
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1064
diff
changeset
|
1674 g_free(dim); |
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1064
diff
changeset
|
1675 } |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1676 } |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1677 |
1032
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1678 static void oscar_action_menu(GtkWidget *menu, struct gaim_connection *gc, char *who) { |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1679 GtkWidget *button; |
1060
2c4f958c596e
[gaim-migrate @ 1070]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1059
diff
changeset
|
1680 char *n = g_strdup(normalize(gc->username)); |
1032
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1681 |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1682 button = gtk_menu_item_new_with_label(_("Get Info")); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1683 gtk_signal_connect(GTK_OBJECT(button), "activate", |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1684 GTK_SIGNAL_FUNC(oscar_info), who); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1685 gtk_object_set_user_data(GTK_OBJECT(button), gc); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1686 gtk_menu_append(GTK_MENU(menu), button); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1687 gtk_widget_show(button); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1688 |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1689 button = gtk_menu_item_new_with_label(_("Get Away Msg")); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1690 gtk_signal_connect(GTK_OBJECT(button), "activate", |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1691 GTK_SIGNAL_FUNC(oscar_away_msg), who); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1692 gtk_object_set_user_data(GTK_OBJECT(button), gc); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1693 gtk_menu_append(GTK_MENU(menu), button); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1694 gtk_widget_show(button); |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1695 |
1060
2c4f958c596e
[gaim-migrate @ 1070]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1059
diff
changeset
|
1696 if (strcmp(n, normalize(who))) { |
2c4f958c596e
[gaim-migrate @ 1070]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1059
diff
changeset
|
1697 button = gtk_menu_item_new_with_label(_("Direct IM")); |
2c4f958c596e
[gaim-migrate @ 1070]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1059
diff
changeset
|
1698 gtk_signal_connect(GTK_OBJECT(button), "activate", |
2c4f958c596e
[gaim-migrate @ 1070]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1059
diff
changeset
|
1699 GTK_SIGNAL_FUNC(oscar_direct_im), who); |
2c4f958c596e
[gaim-migrate @ 1070]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1059
diff
changeset
|
1700 gtk_object_set_user_data(GTK_OBJECT(button), gc); |
2c4f958c596e
[gaim-migrate @ 1070]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1059
diff
changeset
|
1701 gtk_menu_append(GTK_MENU(menu), button); |
2c4f958c596e
[gaim-migrate @ 1070]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1059
diff
changeset
|
1702 gtk_widget_show(button); |
2c4f958c596e
[gaim-migrate @ 1070]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1059
diff
changeset
|
1703 } |
2c4f958c596e
[gaim-migrate @ 1070]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1059
diff
changeset
|
1704 g_free(n); |
1032
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1705 } |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1706 |
1086
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1707 |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1708 /* weeee */ |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1709 static void oscar_print_option(GtkEntry *entry, struct aim_user *user) { |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1710 int entrynum; |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1711 |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1712 entrynum = (int) gtk_object_get_user_data(GTK_OBJECT(entry)); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1713 |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1714 if (entrynum == USEROPT_AUTH) { |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1715 g_snprintf(user->proto_opt[USEROPT_AUTH], |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1716 sizeof(user->proto_opt[USEROPT_AUTH]), |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1717 "%s", gtk_entry_get_text(entry)); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1718 } else if (entrynum == USEROPT_AUTHPORT) { |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1719 g_snprintf(user->proto_opt[USEROPT_AUTHPORT], |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1720 sizeof(user->proto_opt[USEROPT_AUTHPORT]), |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1721 "%s", gtk_entry_get_text(entry)); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1722 } else if (entrynum == USEROPT_SOCKSHOST) { |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1723 g_snprintf(user->proto_opt[USEROPT_SOCKSHOST], |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1724 sizeof(user->proto_opt[USEROPT_SOCKSHOST]), |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1725 "%s", gtk_entry_get_text(entry)); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1726 } else if (entrynum == USEROPT_SOCKSPORT) { |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1727 g_snprintf(user->proto_opt[USEROPT_SOCKSPORT], |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1728 sizeof(user->proto_opt[USEROPT_SOCKSPORT]), |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1729 "%s", gtk_entry_get_text(entry)); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1730 } |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1731 } |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1732 |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1733 static void oscar_user_opts(GtkWidget *book, struct aim_user *user) { |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1734 /* so here, we create the new notebook page */ |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1735 GtkWidget *vbox; |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1736 GtkWidget *hbox; |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1737 GtkWidget *label; |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1738 GtkWidget *entry; |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1739 |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1740 vbox = gtk_vbox_new(FALSE, 0); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1741 gtk_notebook_append_page(GTK_NOTEBOOK(book), vbox, |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1742 gtk_label_new("OSCAR Options")); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1743 gtk_widget_show(vbox); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1744 |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1745 hbox = gtk_hbox_new(FALSE, 0); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1746 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1747 gtk_widget_show(hbox); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1748 |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1749 label = gtk_label_new("Authorizer:"); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1750 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1751 gtk_widget_show(label); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1752 |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1753 entry = gtk_entry_new(); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1754 gtk_box_pack_end(GTK_BOX(hbox), entry, FALSE, FALSE, 5); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1755 gtk_object_set_user_data(GTK_OBJECT(entry), (void *)USEROPT_AUTH); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1756 gtk_signal_connect(GTK_OBJECT(entry), "changed", |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1757 GTK_SIGNAL_FUNC(oscar_print_option), user); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1758 if (user->proto_opt[USEROPT_AUTH][0]) { |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1759 debug_printf("setting text %s\n", user->proto_opt[USEROPT_AUTH]); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1760 gtk_entry_set_text(GTK_ENTRY(entry), user->proto_opt[USEROPT_AUTH]); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1761 } else |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1762 gtk_entry_set_text(GTK_ENTRY(entry), "login.oscar.aol.com"); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1763 gtk_widget_show(entry); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1764 |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1765 hbox = gtk_hbox_new(FALSE, 0); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1766 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1767 gtk_widget_show(hbox); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1768 |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1769 label = gtk_label_new("Authorizer Port:"); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1770 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1771 gtk_widget_show(label); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1772 |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1773 entry = gtk_entry_new(); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1774 gtk_box_pack_end(GTK_BOX(hbox), entry, FALSE, FALSE, 5); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1775 gtk_object_set_user_data(GTK_OBJECT(entry), (void *)1); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1776 gtk_signal_connect(GTK_OBJECT(entry), "changed", |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1777 GTK_SIGNAL_FUNC(oscar_print_option), user); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1778 if (user->proto_opt[USEROPT_AUTHPORT][0]) { |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1779 debug_printf("setting text %s\n", user->proto_opt[USEROPT_AUTHPORT]); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1780 gtk_entry_set_text(GTK_ENTRY(entry), user->proto_opt[USEROPT_AUTHPORT]); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1781 } else |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1782 gtk_entry_set_text(GTK_ENTRY(entry), "5190"); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1783 gtk_widget_show(entry); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1784 |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1785 hbox = gtk_hbox_new(FALSE, 0); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1786 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1787 gtk_widget_show(hbox); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1788 |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1789 label = gtk_label_new("SOCKS5 Host:"); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1790 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1791 gtk_widget_show(label); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1792 |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1793 entry = gtk_entry_new(); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1794 gtk_box_pack_end(GTK_BOX(hbox), entry, FALSE, FALSE, 5); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1795 gtk_object_set_user_data(GTK_OBJECT(entry), (void *)USEROPT_SOCKSHOST); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1796 gtk_signal_connect(GTK_OBJECT(entry), "changed", |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1797 GTK_SIGNAL_FUNC(oscar_print_option), user); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1798 if (user->proto_opt[USEROPT_SOCKSHOST][0]) { |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1799 debug_printf("setting text %s\n", user->proto_opt[USEROPT_SOCKSHOST]); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1800 gtk_entry_set_text(GTK_ENTRY(entry), user->proto_opt[USEROPT_SOCKSHOST]); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1801 } |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1802 gtk_widget_show(entry); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1803 |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1804 hbox = gtk_hbox_new(FALSE, 0); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1805 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1806 gtk_widget_show(hbox); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1807 |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1808 label = gtk_label_new("SOCKS5 Port:"); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1809 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1810 gtk_widget_show(label); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1811 |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1812 entry = gtk_entry_new(); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1813 gtk_box_pack_end(GTK_BOX(hbox), entry, FALSE, FALSE, 5); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1814 gtk_object_set_user_data(GTK_OBJECT(entry), (void *)USEROPT_SOCKSPORT); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1815 gtk_signal_connect(GTK_OBJECT(entry), "changed", |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1816 GTK_SIGNAL_FUNC(oscar_print_option), user); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1817 if (user->proto_opt[USEROPT_SOCKSPORT][0]) { |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1818 debug_printf("setting text %s\n", user->proto_opt[USEROPT_SOCKSPORT]); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1819 gtk_entry_set_text(GTK_ENTRY(entry), user->proto_opt[USEROPT_SOCKSPORT]); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1820 } |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1821 gtk_widget_show(entry); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1822 } |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1823 |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
1824 void oscar_init(struct prpl *ret) { |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1825 ret->protocol = PROTO_OSCAR; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1826 ret->name = oscar_name; |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1827 ret->list_icon = oscar_list_icon; |
1032
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1828 ret->action_menu = oscar_action_menu; |
1086
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
1829 ret->user_opts = oscar_user_opts; |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1830 ret->login = oscar_login; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1831 ret->close = oscar_close; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1832 ret->send_im = oscar_send_im; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1833 ret->set_info = oscar_set_info; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1834 ret->get_info = oscar_get_info; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1835 ret->set_away = oscar_set_away; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1836 ret->get_away_msg = oscar_get_away_msg; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1837 ret->set_dir = oscar_set_dir; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1838 ret->get_dir = NULL; /* Oscar really doesn't have this */ |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1839 ret->dir_search = oscar_dir_search; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1840 ret->set_idle = oscar_set_idle; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1841 ret->change_passwd = NULL; /* Oscar doesn't have this either */ |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1842 ret->add_buddy = oscar_add_buddy; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1843 ret->add_buddies = oscar_add_buddies; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1844 ret->remove_buddy = oscar_remove_buddy; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1845 ret->add_permit = NULL; /* Oscar's permit/deny stuff is messed up */ |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1846 ret->add_deny = NULL; /* at least, i can't figure it out :-P */ |
1038
daad2440a642
[gaim-migrate @ 1048]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1032
diff
changeset
|
1847 ret->rem_permit = NULL; |
daad2440a642
[gaim-migrate @ 1048]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1032
diff
changeset
|
1848 ret->rem_deny = NULL; |
daad2440a642
[gaim-migrate @ 1048]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1032
diff
changeset
|
1849 ret->set_permit_deny = NULL; |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1850 ret->warn = oscar_warn; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1851 ret->accept_chat = NULL; /* oscar doesn't have accept, it just joins */ |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1852 ret->join_chat = oscar_join_chat; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1853 ret->chat_invite = oscar_chat_invite; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1854 ret->chat_leave = oscar_chat_leave; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1855 ret->chat_whisper = oscar_chat_whisper; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1856 ret->chat_send = oscar_chat_send; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1857 ret->keepalive = oscar_keepalive; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1858 } |