Mercurial > pidgin
annotate src/oscar.c @ 1288:d8eaf65ca9c3
[gaim-migrate @ 1298]
libfaim changes, clean up warn dialog
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Fri, 15 Dec 2000 13:04:55 +0000 |
parents | 07f0bb41bbe1 |
children | 4c5c2fcb83cd |
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 |
1161
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
45 #include "pixmaps/cancel.xpm" |
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; |
1156
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
73 GSList *getfiles; |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
74 }; |
1 | 75 |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
76 struct chat_connection { |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
77 char *name; |
1186
c00fc3adfd66
[gaim-migrate @ 1196]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1161
diff
changeset
|
78 int exchange; |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
79 int fd; /* this is redundant since we have the conn below */ |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
80 struct aim_conn_t *conn; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
81 int inpa; |
1186
c00fc3adfd66
[gaim-migrate @ 1196]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1161
diff
changeset
|
82 int id; |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
83 }; |
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
84 |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
85 struct direct_im { |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
86 struct gaim_connection *gc; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
87 char name[80]; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
88 struct conversation *cnv; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
89 int watcher; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
90 struct aim_conn_t *conn; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
91 }; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
92 |
1064
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
93 struct ask_direct { |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
94 struct gaim_connection *gc; |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
95 char *sn; |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
96 struct aim_directim_priv *priv; |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
97 }; |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
98 |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
99 struct ask_getfile { |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
100 struct gaim_connection *gc; |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
101 char *sn; |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
102 char *cookie; |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
103 char *ip; |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
104 }; |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
105 |
1156
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
106 struct getfile_transfer { |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
107 struct gaim_connection *gc; |
1161
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
108 char *receiver; |
1156
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
109 char *filename; |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
110 struct aim_conn_t *conn; |
1161
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
111 struct aim_fileheader_t *fh; |
1156
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
112 int gip; |
1161
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
113 int gop; |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
114 FILE *listing; |
1156
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
115 FILE *file; |
1161
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
116 GtkWidget *window; |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
117 GtkWidget *meter; |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
118 GtkWidget *label; |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
119 long pos; |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
120 long size; |
1156
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
121 }; |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
122 |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
123 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
|
124 GSList *d = od->direct_ims; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
125 char *n = g_strdup(normalize(who)); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
126 struct direct_im *m = NULL; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
127 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
128 while (d) { |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
129 m = (struct direct_im *)d->data; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
130 if (!strcmp(n, normalize(m->name))) |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
131 break; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
132 m = NULL; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
133 d = d->next; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
134 } |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
135 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
136 g_free(n); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
137 return m; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
138 } |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
139 |
1156
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
140 static struct getfile_transfer *find_getfile_transfer(struct oscar_data *od, struct aim_conn_t *conn) { |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
141 GSList *g = od->getfiles; |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
142 struct getfile_transfer *n = NULL; |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
143 |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
144 while (g) { |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
145 n = (struct getfile_transfer *)g->data; |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
146 if (n->conn == conn) |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
147 return n; |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
148 n = NULL; |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
149 g = g->next; |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
150 } |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
151 |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
152 return n; |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
153 } |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
154 |
1186
c00fc3adfd66
[gaim-migrate @ 1196]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1161
diff
changeset
|
155 struct chat_connection *find_oscar_chat(struct gaim_connection *gc, int id) { |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
156 GSList *g = ((struct oscar_data *)gc->proto_data)->oscar_chats; |
312
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
157 struct chat_connection *c = NULL; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
158 if (gc->protocol != PROTO_OSCAR) return NULL; |
312
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
159 |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
160 while (g) { |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
161 c = (struct chat_connection *)g->data; |
1186
c00fc3adfd66
[gaim-migrate @ 1196]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1161
diff
changeset
|
162 if (c->id == id) |
312
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
163 break; |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
164 g = g->next; |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
165 c = NULL; |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
166 } |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
167 |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
168 return c; |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
169 } |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
170 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
171 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
|
172 struct aim_conn_t *conn) { |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
173 GSList *g = ((struct oscar_data *)gc->proto_data)->oscar_chats; |
833
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
174 struct chat_connection *c = NULL; |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
175 |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
176 while (g) { |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
177 c = (struct chat_connection *)g->data; |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
178 if (c->conn == conn) |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
179 break; |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
180 g = g->next; |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
181 c = NULL; |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
182 } |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
183 |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
184 return c; |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
185 } |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
186 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
187 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
|
188 GSList *g = connections; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
189 struct gaim_connection *gc = NULL; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
190 |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
191 while (g) { |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
192 gc = (struct gaim_connection *)g->data; |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
193 if (sess == ((struct oscar_data *)gc->proto_data)->sess) |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
194 break; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
195 g = g->next; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
196 gc = NULL; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
197 } |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
198 |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
199 return gc; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
200 } |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
201 |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
202 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
|
203 GSList *g = connections; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
204 struct gaim_connection *c = NULL; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
205 struct aim_conn_t *s; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
206 while (g) { |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
207 c = (struct gaim_connection *)g->data; |
965
50f2977537d8
[gaim-migrate @ 975]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
964
diff
changeset
|
208 if (c->protocol != PROTO_OSCAR) { |
50f2977537d8
[gaim-migrate @ 975]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
964
diff
changeset
|
209 c = NULL; |
50f2977537d8
[gaim-migrate @ 975]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
964
diff
changeset
|
210 g = g->next; |
50f2977537d8
[gaim-migrate @ 975]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
964
diff
changeset
|
211 continue; |
50f2977537d8
[gaim-migrate @ 975]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
964
diff
changeset
|
212 } |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
213 s = ((struct oscar_data *)c->proto_data)->sess->connlist; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
214 while (s) { |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
215 if (conn == s) |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
216 break; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
217 s = s->next; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
218 } |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
219 if (s) break; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
220 g = g->next; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
221 c = NULL; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
222 } |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
223 |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
224 return c; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
225 } |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
226 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
227 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
|
228 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
|
229 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
|
230 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
|
231 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
|
232 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
|
233 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
|
234 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
|
235 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
|
236 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
|
237 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
|
238 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
|
239 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
|
240 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
|
241 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
|
242 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
|
243 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
|
244 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
|
245 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
|
246 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
|
247 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
|
248 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
|
249 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
|
250 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
|
251 |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
252 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
|
253 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
|
254 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
|
255 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
|
256 |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
257 static char *msgerrreason[] = { |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
258 "Invalid error", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
259 "Invalid SNAC", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
260 "Rate to host", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
261 "Rate to client", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
262 "Not logged in", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
263 "Service unavailable", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
264 "Service not defined", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
265 "Obsolete SNAC", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
266 "Not supported by host", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
267 "Not supported by client", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
268 "Refused by client", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
269 "Reply too big", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
270 "Responses lost", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
271 "Request denied", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
272 "Busted SNAC payload", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
273 "Insufficient rights", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
274 "In local permit/deny", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
275 "Too evil (sender)", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
276 "Too evil (receiver)", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
277 "User temporarily unavailable", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
278 "No match", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
279 "List overflow", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
280 "Request ambiguous", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
281 "Queue full", |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
282 "Not while on AOL" |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
283 }; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
284 static int msgerrreasonlen = 25; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
285 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
286 static void oscar_callback(gpointer data, gint source, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
287 GdkInputCondition condition) { |
288
6e609d42f767
[gaim-migrate @ 298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
288 struct aim_conn_t *conn = (struct aim_conn_t *)data; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
289 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
|
290 struct oscar_data *odata = (struct oscar_data *)gc->proto_data; |
1149
22bf2c3ec2e3
[gaim-migrate @ 1159]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1148
diff
changeset
|
291 if (!g_slist_find(connections, gc)) { |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
292 /* 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
|
293 * is return? */ |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
294 debug_printf("oscar callback for closed connection.\n"); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
295 return; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
296 } |
1 | 297 |
259
e159ba2486fc
[gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
298 if (condition & GDK_INPUT_EXCEPTION) { |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
299 hide_login_progress(gc, _("Disconnected.")); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
300 signoff(gc); |
259
e159ba2486fc
[gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
301 return; |
e159ba2486fc
[gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
302 } |
e159ba2486fc
[gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
303 if (condition & GDK_INPUT_READ) { |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
304 if (conn->type == AIM_CONN_TYPE_RENDEZVOUS_OUT) { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
305 debug_printf("got information on rendezvous\n"); |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
306 if (aim_handlerendconnect(odata->sess, conn) < 0) { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
307 debug_printf(_("connection error (rend)\n")); |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
308 } |
259
e159ba2486fc
[gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
309 } else { |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
310 if (aim_get_command(odata->sess, conn) >= 0) { |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
311 aim_rxdispatch(odata->sess); |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
312 } else { |
1002
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1000
diff
changeset
|
313 if ((conn->type == AIM_CONN_TYPE_BOS) || |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
314 !(aim_getconn_type(odata->sess, AIM_CONN_TYPE_BOS))) { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
315 debug_printf(_("major connection error\n")); |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
316 hide_login_progress(gc, _("Disconnected.")); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
317 signoff(gc); |
747
eec93c5929b9
[gaim-migrate @ 757]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
746
diff
changeset
|
318 } else if (conn->type == AIM_CONN_TYPE_CHAT) { |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
319 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
|
320 char buf[BUF_LONG]; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
321 debug_printf("disconnected from chat room %s\n", c->name); |
833
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
322 c->conn = NULL; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
323 if (c->inpa > -1) |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
324 gdk_input_remove(c->inpa); |
833
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
325 c->inpa = -1; |
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
326 c->fd = -1; |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
327 aim_conn_kill(odata->sess, &conn); |
833
8d8ef8c3afe2
[gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
328 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
|
329 do_error_dialog(buf, _("Chat Error!")); |
828
4c71c0e7f04e
[gaim-migrate @ 838]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
812
diff
changeset
|
330 } else if (conn->type == AIM_CONN_TYPE_CHATNAV) { |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
331 if (odata->cnpa > -1) |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
332 gdk_input_remove(odata->cnpa); |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
333 odata->cnpa = -1; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
334 debug_printf("removing chatnav input watcher\n"); |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
335 aim_conn_kill(odata->sess, &conn); |
1156
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
336 } else if (conn->type == AIM_CONN_TYPE_RENDEZVOUS) { |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
337 debug_printf("No handler for rendezvous disconnect (%d).\n", |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
338 source); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
339 aim_conn_kill(odata->sess, &conn); |
695
d3db515e9a6e
[gaim-migrate @ 705]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
694
diff
changeset
|
340 } else { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
341 debug_printf("holy crap! generic connection error! %d\n", |
794
80274f969a09
[gaim-migrate @ 804]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
788
diff
changeset
|
342 conn->type); |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
343 aim_conn_kill(odata->sess, &conn); |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
344 } |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
345 } |
259
e159ba2486fc
[gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
253
diff
changeset
|
346 } |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
347 } |
1 | 348 } |
349 | |
980
82c5865f7cfe
[gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
975
diff
changeset
|
350 void oscar_login(struct aim_user *user) { |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
351 struct aim_session_t *sess; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
352 struct aim_conn_t *conn; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
353 char buf[256]; |
1086
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
354 char *finalauth = NULL; |
1089
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
355 struct gaim_connection *gc = new_gaim_conn(user); |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
356 struct oscar_data *odata = gc->proto_data = g_new0(struct oscar_data, 1); |
1148
0a14a9a844cb
[gaim-migrate @ 1158]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1147
diff
changeset
|
357 odata->create_exchange = 0; |
1 | 358 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
359 debug_printf(_("Logging in %s\n"), user->username); |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
360 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
361 sess = g_new0(struct aim_session_t, 1); |
1086
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
362 |
1081
efcacae6acdb
[gaim-migrate @ 1091]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1072
diff
changeset
|
363 aim_session_init(sess, AIM_SESS_FLAGS_NONBLOCKCONNECT); |
1086
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
364 |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
365 if (user->proto_opt[USEROPT_SOCKSHOST][0]) { |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
366 char *finalproxy; |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
367 if (user->proto_opt[USEROPT_SOCKSPORT][0]) |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
368 finalproxy = g_strconcat(user->proto_opt[USEROPT_SOCKSHOST], ":", |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
369 user->proto_opt[USEROPT_SOCKSPORT], NULL); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
370 else |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
371 finalproxy = g_strdup(user->proto_opt[USEROPT_SOCKSHOST]); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
372 aim_setupproxy(sess, finalproxy, NULL, NULL); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
373 g_free(finalproxy); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
374 } |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
375 |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
376 if (user->proto_opt[USEROPT_AUTH][0]) { |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
377 if (user->proto_opt[USEROPT_AUTHPORT][0]) |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
378 finalauth = g_strconcat(user->proto_opt[USEROPT_AUTH], ":", |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
379 user->proto_opt[USEROPT_AUTHPORT], NULL); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
380 else |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
381 finalauth = g_strdup(user->proto_opt[USEROPT_AUTH]); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
382 } |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
383 |
279
501e09c51cbc
[gaim-migrate @ 289]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
277
diff
changeset
|
384 /* 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
|
385 * see if things need to be sent. */ |
501e09c51cbc
[gaim-migrate @ 289]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
277
diff
changeset
|
386 sess->tx_enqueue = &aim_tx_enqueue__immediate; |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
387 odata->sess = sess; |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
388 |
1086
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
389 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
|
390 |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
391 if (finalauth) |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
392 g_free(finalauth); |
1 | 393 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
394 if (conn == NULL) { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
395 debug_printf(_("internal connection error\n")); |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
396 hide_login_progress(gc, _("Unable to login to AIM")); |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
397 signoff(gc); |
980
82c5865f7cfe
[gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
975
diff
changeset
|
398 return; |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
399 } else if (conn->fd == -1) { |
975
a45991891aba
[gaim-migrate @ 985]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
971
diff
changeset
|
400 if (conn->status & AIM_CONN_STATUS_RESOLVERR) { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
401 char *crh = _("couldn't resolve host"); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
402 debug_printf("%s\n", crh); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
403 hide_login_progress(gc, crh); |
975
a45991891aba
[gaim-migrate @ 985]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
971
diff
changeset
|
404 } else if (conn->status & AIM_CONN_STATUS_CONNERR) { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
405 char *cch = _("couldn't connect to host"); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
406 debug_printf("%s\n", cch); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
407 hide_login_progress(gc, cch); |
975
a45991891aba
[gaim-migrate @ 985]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
971
diff
changeset
|
408 } |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
409 signoff(gc); |
980
82c5865f7cfe
[gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
975
diff
changeset
|
410 return; |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
411 } |
980
82c5865f7cfe
[gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
975
diff
changeset
|
412 g_snprintf(buf, sizeof(buf), _("Signon: %s"), gc->username); |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
413 set_login_progress(gc, 2, buf); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
414 |
741
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
736
diff
changeset
|
415 aim_conn_addhandler(sess, conn, 0x0017, 0x0007, gaim_parse_login, 0); |
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
736
diff
changeset
|
416 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
|
417 aim_request_login(sess, conn, gc->username); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
418 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
419 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
|
420 oscar_callback, conn); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
421 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
422 debug_printf(_("Password sent, waiting for response\n")); |
1 | 423 } |
424 | |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
425 void oscar_close(struct gaim_connection *gc) { |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
426 struct oscar_data *odata = (struct oscar_data *)gc->proto_data; |
1015
c3579d03a0c1
[gaim-migrate @ 1025]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
427 GSList *c = odata->oscar_chats; |
c3579d03a0c1
[gaim-migrate @ 1025]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
428 struct chat_connection *n; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
429 if (gc->protocol != PROTO_OSCAR) return; |
1015
c3579d03a0c1
[gaim-migrate @ 1025]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
430 |
c3579d03a0c1
[gaim-migrate @ 1025]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
431 while (c) { |
c3579d03a0c1
[gaim-migrate @ 1025]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
432 n = (struct chat_connection *)c->data; |
c3579d03a0c1
[gaim-migrate @ 1025]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
433 gdk_input_remove(n->inpa); |
c3579d03a0c1
[gaim-migrate @ 1025]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
434 g_free(n->name); |
1016
661ac77ccd1b
[gaim-migrate @ 1026]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1015
diff
changeset
|
435 c = g_slist_remove(c, n); |
1015
c3579d03a0c1
[gaim-migrate @ 1025]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
436 g_free(n); |
c3579d03a0c1
[gaim-migrate @ 1025]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
437 } |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
438 if (gc->inpa > 0) |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
439 gdk_input_remove(gc->inpa); |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
440 if (odata->cnpa > 0) |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
441 gdk_input_remove(odata->cnpa); |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
442 if (odata->paspa > 0) |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
443 gdk_input_remove(odata->paspa); |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
444 aim_logoff(odata->sess); |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
445 g_free(odata->sess); |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
446 g_free(gc->proto_data); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
447 debug_printf(_("Signed off.\n")); |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
448 } |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
449 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
450 int gaim_parse_auth_resp(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
451 struct command_rx_struct *command, ...) { |
1245
2ac6ccb94229
[gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
452 va_list ap; |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
453 struct aim_conn_t *bosconn = NULL; |
1245
2ac6ccb94229
[gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
454 char *sn = NULL, *bosip = NULL, *errurl = NULL, *email = NULL; |
2ac6ccb94229
[gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
455 unsigned char *cookie = NULL; |
2ac6ccb94229
[gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
456 int errorcode = 0, regstatus = 0; |
1247
f50146ce818e
[gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1246
diff
changeset
|
457 int latestbuild = 0, latestbetabuild = 0; |
f50146ce818e
[gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1246
diff
changeset
|
458 char *latestrelease = NULL, *latestbeta = NULL; |
f50146ce818e
[gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1246
diff
changeset
|
459 char *latestreleaseurl = NULL, *latestbetaurl = NULL; |
f50146ce818e
[gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1246
diff
changeset
|
460 char *latestreleaseinfo = NULL, *latestbetainfo = NULL; |
1245
2ac6ccb94229
[gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
461 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
462 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess); |
1245
2ac6ccb94229
[gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
463 |
2ac6ccb94229
[gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
464 va_start(ap, command); |
2ac6ccb94229
[gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
465 sn = va_arg(ap, char *); |
2ac6ccb94229
[gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
466 errorcode = va_arg(ap, int); |
2ac6ccb94229
[gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
467 errurl = va_arg(ap, char *); |
2ac6ccb94229
[gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
468 regstatus = va_arg(ap, int); |
2ac6ccb94229
[gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
469 email = va_arg(ap, char *); |
2ac6ccb94229
[gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
470 bosip = va_arg(ap, char *); |
2ac6ccb94229
[gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
471 cookie = va_arg(ap, unsigned char *); |
1247
f50146ce818e
[gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1246
diff
changeset
|
472 |
f50146ce818e
[gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1246
diff
changeset
|
473 latestrelease = va_arg(ap, char *); |
f50146ce818e
[gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1246
diff
changeset
|
474 latestbuild = va_arg(ap, int); |
f50146ce818e
[gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1246
diff
changeset
|
475 latestreleaseurl = va_arg(ap, char *); |
f50146ce818e
[gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1246
diff
changeset
|
476 latestreleaseinfo = va_arg(ap, char *); |
f50146ce818e
[gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1246
diff
changeset
|
477 |
f50146ce818e
[gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1246
diff
changeset
|
478 latestbeta = va_arg(ap, char *); |
f50146ce818e
[gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1246
diff
changeset
|
479 latestbetabuild = va_arg(ap, int); |
f50146ce818e
[gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1246
diff
changeset
|
480 latestbetaurl = va_arg(ap, char *); |
f50146ce818e
[gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1246
diff
changeset
|
481 latestbetainfo = va_arg(ap, char *); |
f50146ce818e
[gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1246
diff
changeset
|
482 |
1245
2ac6ccb94229
[gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
483 va_end(ap); |
2ac6ccb94229
[gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
484 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
485 debug_printf("inside auth_resp (Screen name: %s)\n", sn); |
1 | 486 |
1245
2ac6ccb94229
[gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
487 if (errorcode || !bosip || !cookie) { |
2ac6ccb94229
[gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
488 switch (errorcode) { |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
489 case 0x18: |
392
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
388
diff
changeset
|
490 /* connecting too frequently */ |
1038
daad2440a642
[gaim-migrate @ 1048]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1032
diff
changeset
|
491 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
|
492 plugin_event(event_error, (void *)983, 0, 0, 0); |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
493 break; |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
494 case 0x05: |
392
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
388
diff
changeset
|
495 /* Incorrect nick/password */ |
1038
daad2440a642
[gaim-migrate @ 1048]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1032
diff
changeset
|
496 hide_login_progress(gc, _("Incorrect nickname or password.")); |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
497 plugin_event(event_error, (void *)980, 0, 0, 0); |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
498 break; |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
499 case 0x1c: |
392
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
388
diff
changeset
|
500 /* client too old */ |
1038
daad2440a642
[gaim-migrate @ 1048]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1032
diff
changeset
|
501 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
|
502 plugin_event(event_error, (void *)989, 0, 0, 0); |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
503 break; |
1038
daad2440a642
[gaim-migrate @ 1048]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1032
diff
changeset
|
504 default: |
daad2440a642
[gaim-migrate @ 1048]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1032
diff
changeset
|
505 hide_login_progress(gc, _("Authentication Failed")); |
daad2440a642
[gaim-migrate @ 1048]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1032
diff
changeset
|
506 break; |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
507 } |
1245
2ac6ccb94229
[gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
508 debug_printf("Login Error Code 0x%04x\n", errorcode); |
2ac6ccb94229
[gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
509 debug_printf("Error URL: %s\n", errurl); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
510 signoff(gc); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
511 return 0; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
512 } |
1 | 513 |
514 | |
1247
f50146ce818e
[gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1246
diff
changeset
|
515 debug_printf("Reg status: %2d\n", regstatus); |
1245
2ac6ccb94229
[gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
516 if (email) { |
2ac6ccb94229
[gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
517 debug_printf("Email: %s\n", email); |
946
acd4d81f2afc
[gaim-migrate @ 956]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
930
diff
changeset
|
518 } else { |
1245
2ac6ccb94229
[gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
519 debug_printf("Email is NULL\n"); |
946
acd4d81f2afc
[gaim-migrate @ 956]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
930
diff
changeset
|
520 } |
1247
f50146ce818e
[gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1246
diff
changeset
|
521 debug_printf("BOSIP: %s\n", bosip); |
f50146ce818e
[gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1246
diff
changeset
|
522 if (latestbeta) |
f50146ce818e
[gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1246
diff
changeset
|
523 debug_printf("Latest WinAIM beta version %s, build %d, at %s (%s)\n", |
f50146ce818e
[gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1246
diff
changeset
|
524 latestbeta, latestbetabuild, latestbetaurl, latestbetainfo); |
f50146ce818e
[gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1246
diff
changeset
|
525 if (latestrelease) |
f50146ce818e
[gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1246
diff
changeset
|
526 debug_printf("Latest WinAIM released version %s, build %d, at %s (%s)\n", |
f50146ce818e
[gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1246
diff
changeset
|
527 latestrelease, latestbuild, latestreleaseurl, latestreleaseinfo); |
f50146ce818e
[gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1246
diff
changeset
|
528 debug_printf("Closing auth connection...\n"); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
529 gdk_input_remove(gc->inpa); |
338
9d258a0aa560
[gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
335
diff
changeset
|
530 aim_conn_kill(sess, &command->conn); |
1 | 531 |
1245
2ac6ccb94229
[gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
532 bosconn = aim_newconn(sess, AIM_CONN_TYPE_BOS, bosip); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
533 if (bosconn == NULL) { |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
534 hide_login_progress(gc, _("Internal Error")); |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
535 signoff(gc); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
536 return -1; |
1081
efcacae6acdb
[gaim-migrate @ 1091]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1072
diff
changeset
|
537 } else if (bosconn->status & AIM_CONN_STATUS_CONNERR) { |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
538 hide_login_progress(gc, _("Could Not Connect")); |
1106
5bc8fdacd2cb
[gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
539 signoff(gc); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
540 return -1; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
541 } |
1 | 542 |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
543 aim_conn_addhandler(sess, bosconn, 0x0009, 0x0003, gaim_bosrights, 0); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
544 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
|
545 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
|
546 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
|
547 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
|
548 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
|
549 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
|
550 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
|
551 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
|
552 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
|
553 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
|
554 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
|
555 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
|
556 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
|
557 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
|
558 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
|
559 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
|
560 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
|
561 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
|
562 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
|
563 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
|
564 |
1245
2ac6ccb94229
[gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1233
diff
changeset
|
565 aim_auth_sendcookie(sess, bosconn, cookie); |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
566 ((struct oscar_data *)gc->proto_data)->conn = bosconn; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
567 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
|
568 oscar_callback, bosconn); |
988
9523b772e546
[gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
569 set_login_progress(gc, 4, _("Connection established, cookie sent")); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
570 return 1; |
1 | 571 } |
572 | |
741
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
736
diff
changeset
|
573 int gaim_parse_login(struct aim_session_t *sess, |
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
736
diff
changeset
|
574 struct command_rx_struct *command, ...) { |
857
41bfae606d39
[gaim-migrate @ 867]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
840
diff
changeset
|
575 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
|
576 char *key; |
741
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
736
diff
changeset
|
577 va_list ap; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
578 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
|
579 |
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
736
diff
changeset
|
580 va_start(ap, command); |
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
736
diff
changeset
|
581 key = va_arg(ap, char *); |
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
736
diff
changeset
|
582 va_end(ap); |
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
736
diff
changeset
|
583 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
584 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
|
585 return 1; |
741
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
736
diff
changeset
|
586 } |
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
736
diff
changeset
|
587 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
588 int gaim_server_ready(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
589 struct command_rx_struct *command, ...) { |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
590 static int id = 1; |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
591 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess); |
1186
c00fc3adfd66
[gaim-migrate @ 1196]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1161
diff
changeset
|
592 struct chat_connection *chatcon; |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
593 switch (command->conn->type) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
594 case AIM_CONN_TYPE_BOS: |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
595 aim_setversions(sess, command->conn); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
596 aim_bos_reqrate(sess, command->conn); /* request rate info */ |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
597 debug_printf("done with BOS ServerReady\n"); |
1 | 598 break; |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
599 case AIM_CONN_TYPE_CHATNAV: |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
600 debug_printf("chatnav: got server ready\n"); |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
601 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
|
602 aim_bos_reqrate(sess, command->conn); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
603 aim_bos_ackrateresp(sess, command->conn); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
604 aim_chatnav_clientready(sess, command->conn); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
605 aim_chatnav_reqrights(sess, command->conn); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
606 break; |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
607 case AIM_CONN_TYPE_CHAT: |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
608 debug_printf("chat: got server ready\n"); |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
609 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
|
610 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
|
611 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
|
612 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
|
613 aim_bos_reqrate(sess, command->conn); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
614 aim_bos_ackrateresp(sess, command->conn); |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
615 aim_chat_clientready(sess, command->conn); |
1186
c00fc3adfd66
[gaim-migrate @ 1196]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1161
diff
changeset
|
616 chatcon = find_oscar_chat_by_conn(gc, command->conn); |
c00fc3adfd66
[gaim-migrate @ 1196]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1161
diff
changeset
|
617 chatcon->id = id; |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
618 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
|
619 break; |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
620 case AIM_CONN_TYPE_RENDEZVOUS: |
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
621 break; |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
622 default: /* huh? */ |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
623 debug_printf("server ready: got unexpected connection type %04x\n", command->conn->type); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
624 break; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
625 } |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
626 return 1; |
1 | 627 } |
628 | |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
629 int gaim_handle_redirect(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
630 struct command_rx_struct *command, ...) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
631 va_list ap; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
632 int serviceid; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
633 char *ip; |
840
595ac7759563
[gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
838
diff
changeset
|
634 unsigned char *cookie; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
635 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
|
636 struct oscar_data *odata = (struct oscar_data *)gc->proto_data; |
1 | 637 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
638 va_start(ap, command); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
639 serviceid = va_arg(ap, int); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
640 ip = va_arg(ap, char *); |
840
595ac7759563
[gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
838
diff
changeset
|
641 cookie = va_arg(ap, unsigned char *); |
1 | 642 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
643 switch(serviceid) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
644 case 0x7: /* Authorizer */ |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
645 debug_printf("Reconnecting with authorizor...\n"); |
237
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 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
|
648 if (tstconn == NULL || tstconn->status & AIM_CONN_STATUS_RESOLVERR) |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
649 debug_printf("unable to reconnect with authorizer\n"); |
331
f3c8d79688db
[gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
319
diff
changeset
|
650 else { |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
651 odata->paspa = gdk_input_add(tstconn->fd, |
331
f3c8d79688db
[gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
319
diff
changeset
|
652 GDK_INPUT_READ | GDK_INPUT_EXCEPTION, |
f3c8d79688db
[gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
319
diff
changeset
|
653 oscar_callback, tstconn); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
654 aim_auth_sendcookie(sess, tstconn, cookie); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
655 } |
331
f3c8d79688db
[gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
319
diff
changeset
|
656 } |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
657 break; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
658 case 0xd: /* ChatNav */ |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
659 { |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
660 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
|
661 if (tstconn == NULL || tstconn->status & AIM_CONN_STATUS_RESOLVERR) { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
662 debug_printf("unable to connect to chatnav server\n"); |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
663 return 1; |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
664 } |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
665 aim_conn_addhandler(sess, tstconn, 0x0001, 0x0003, gaim_server_ready, 0); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
666 aim_auth_sendcookie(sess, tstconn, cookie); |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
667 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
|
668 oscar_callback, tstconn); |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
669 } |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
670 debug_printf("chatnav: connected\n"); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
671 break; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
672 case 0xe: /* Chat */ |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
673 { |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
674 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
|
675 char *roomname = va_arg(ap, char *); |
1186
c00fc3adfd66
[gaim-migrate @ 1196]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1161
diff
changeset
|
676 int exchange = va_arg(ap, int); |
312
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
677 struct chat_connection *ccon; |
1082
13df4e342cff
[gaim-migrate @ 1092]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1081
diff
changeset
|
678 if (tstconn == NULL || tstconn->status & AIM_CONN_STATUS_RESOLVERR) { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
679 debug_printf("unable to connect to chat server\n"); |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
680 return 1; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
681 } |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
682 debug_printf("Connected to chat room %s exchange %d\n", roomname, exchange); |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
683 |
312
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
684 ccon = g_new0(struct chat_connection, 1); |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
685 ccon->conn = tstconn; |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
686 ccon->fd = tstconn->fd; |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
687 ccon->name = g_strdup(roomname); |
1186
c00fc3adfd66
[gaim-migrate @ 1196]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1161
diff
changeset
|
688 ccon->exchange = exchange; |
312
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
689 |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
690 ccon->inpa = gdk_input_add(tstconn->fd, |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
691 GDK_INPUT_READ | GDK_INPUT_EXCEPTION, |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
692 oscar_callback, tstconn); |
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
693 |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
694 odata->oscar_chats = g_slist_append(odata->oscar_chats, ccon); |
312
3069be4c291e
[gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
302
diff
changeset
|
695 |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
696 aim_chat_attachname(tstconn, roomname); |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
697 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
|
698 aim_auth_sendcookie(sess, tstconn, cookie); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
699 } |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
700 break; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
701 default: /* huh? */ |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
702 debug_printf("got redirect for unknown service 0x%04x\n", serviceid); |
1 | 703 break; |
704 } | |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
705 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
706 va_end(ap); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
707 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
708 return 1; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
709 } |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
710 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
711 int gaim_parse_oncoming(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
712 struct command_rx_struct *command, ...) { |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
713 struct aim_userinfo_s *info; |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
714 time_t time_idle; |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
715 int type = 0; |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
716 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
|
717 |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
718 va_list ap; |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
719 va_start(ap, command); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
720 info = va_arg(ap, struct aim_userinfo_s *); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
721 va_end(ap); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
722 |
900
e18815f5a4e9
[gaim-migrate @ 910]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
723 if (info->flags & AIM_FLAG_UNCONFIRMED) |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
724 type |= UC_UNCONFIRMED; |
900
e18815f5a4e9
[gaim-migrate @ 910]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
725 else if (info->flags & AIM_FLAG_ADMINISTRATOR) |
771
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
726 type |= UC_ADMIN; |
900
e18815f5a4e9
[gaim-migrate @ 910]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
727 else if (info->flags & AIM_FLAG_AOL) |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
728 type |= UC_AOL; |
900
e18815f5a4e9
[gaim-migrate @ 910]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
729 else if (info->flags & AIM_FLAG_FREE) |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
730 type |= UC_NORMAL; |
900
e18815f5a4e9
[gaim-migrate @ 910]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
731 if (info->flags & AIM_FLAG_AWAY) |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
732 type |= UC_UNAVAILABLE; |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
733 |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
734 if (info->idletime) { |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
735 time(&time_idle); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
736 time_idle -= info->idletime*60; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
737 } else |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
738 time_idle = 0; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
739 |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
740 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
|
741 time_idle, type, info->capabilities); |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
742 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
743 return 1; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
744 } |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
745 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
746 int gaim_parse_offgoing(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
747 struct command_rx_struct *command, ...) { |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
748 char *sn; |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
749 va_list ap; |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
750 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
|
751 |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
752 va_start(ap, command); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
753 sn = va_arg(ap, char *); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
754 va_end(ap); |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
755 |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
756 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
|
757 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
758 return 1; |
1 | 759 } |
760 | |
1064
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
761 static void cancel_direct_im(gpointer w, struct ask_direct *d) { |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
762 debug_printf("Freeing DirectIM prompts.\n"); |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
763 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
764 g_free(d->sn); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
765 g_free(d); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
766 } |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
767 |
1064
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
768 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
|
769 struct oscar_data *od = (struct oscar_data *)d->gc->proto_data; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
770 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
771 od->direct_ims = g_slist_remove(od->direct_ims, d); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
772 gdk_input_remove(d->watcher); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
773 aim_conn_kill(od->sess, &d->conn); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
774 g_free(d); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
775 } |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
776 |
1064
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
777 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
|
778 struct gaim_connection *gc = d->gc; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
779 struct oscar_data *od = (struct oscar_data *)gc->proto_data; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
780 struct direct_im *dim; |
1072
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1064
diff
changeset
|
781 char buf[256]; |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
782 |
1064
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
783 debug_printf("Accepted DirectIM.\n"); |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
784 |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
785 dim = find_direct_im(od, d->sn); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
786 if (dim) { |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
787 cancel_direct_im(w, d); /* 40 */ |
1092
a930439f29b1
[gaim-migrate @ 1102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1089
diff
changeset
|
788 return TRUE; |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
789 } |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
790 dim = g_new0(struct direct_im, 1); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
791 dim->gc = d->gc; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
792 g_snprintf(dim->name, sizeof dim->name, "%s", d->sn); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
793 |
1231
11d67bbda8ae
[gaim-migrate @ 1241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1206
diff
changeset
|
794 od->sess->flags ^= AIM_SESS_FLAGS_NONBLOCKCONNECT; |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
795 if ((dim->conn = aim_directim_connect(od->sess, od->conn, d->priv)) == NULL) { |
1231
11d67bbda8ae
[gaim-migrate @ 1241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1206
diff
changeset
|
796 od->sess->flags ^= AIM_SESS_FLAGS_NONBLOCKCONNECT; |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
797 g_free(dim); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
798 cancel_direct_im(w, d); |
1092
a930439f29b1
[gaim-migrate @ 1102]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1089
diff
changeset
|
799 return TRUE; |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
800 } |
1231
11d67bbda8ae
[gaim-migrate @ 1241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1206
diff
changeset
|
801 od->sess->flags ^= AIM_SESS_FLAGS_NONBLOCKCONNECT; |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
802 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
803 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
|
804 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
|
805 write_to_conv(dim->cnv, buf, WFLAG_SYSTEM, NULL); |
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1064
diff
changeset
|
806 |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
807 gtk_signal_connect(GTK_OBJECT(dim->cnv->window), "destroy", |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
808 GTK_SIGNAL_FUNC(delete_direct_im), dim); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
809 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
810 od->direct_ims = g_slist_append(od->direct_ims, dim); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
811 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
|
812 oscar_callback, dim->conn); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
813 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
|
814 gaim_directim_incoming, 0); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
815 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
|
816 gaim_directim_disconnect, 0); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
817 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
|
818 gaim_directim_typing, 0); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
819 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
820 cancel_direct_im(w, d); |
1064
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
821 |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
822 return TRUE; |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
823 } |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
824 |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
825 static void cancel_getfile(gpointer w, struct ask_getfile *g) { |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
826 g_free(g->ip); |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
827 g_free(g->cookie); |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
828 g_free(g->sn); |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
829 g_free(g); |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
830 } |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
831 |
1156
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
832 static void cancel_getfile_file(GtkObject *obj, struct ask_getfile *g) { |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
833 GtkWidget *w = gtk_object_get_user_data(obj); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
834 gtk_widget_destroy(w); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
835 cancel_getfile(w, g); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
836 } |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
837 |
1246
42ca87108cd1
[gaim-migrate @ 1256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1245
diff
changeset
|
838 static void cancel_getfile_cancel(GtkObject *obj, struct ask_getfile *g) { |
42ca87108cd1
[gaim-migrate @ 1256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1245
diff
changeset
|
839 GtkWidget *w = gtk_object_get_user_data(obj); |
42ca87108cd1
[gaim-migrate @ 1256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1245
diff
changeset
|
840 gtk_widget_destroy(w); |
42ca87108cd1
[gaim-migrate @ 1256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1245
diff
changeset
|
841 } |
42ca87108cd1
[gaim-migrate @ 1256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1245
diff
changeset
|
842 |
1161
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
843 static void interrupt_getfile(GtkObject *obj, struct getfile_transfer *gt) { |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
844 struct gaim_connection *gc = gt->gc; |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
845 struct oscar_data *od = (struct oscar_data *)gc->proto_data; |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
846 |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
847 gtk_widget_destroy(gt->window); |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
848 gdk_input_remove(gt->gip); |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
849 if (gt->gop > 0) |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
850 gdk_input_remove(gt->gop); |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
851 aim_conn_kill(od->sess, >->conn); |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
852 od->getfiles = g_slist_remove(od->getfiles, gt); |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
853 g_free(gt->receiver); |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
854 g_free(gt->filename); |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
855 fclose(gt->listing); |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
856 g_free(gt); |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
857 } |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
858 |
1156
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
859 static int gaim_getfile_filereq(struct aim_session_t *sess, struct command_rx_struct *command, ...) { |
1161
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
860 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess); |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
861 struct oscar_data *od = (struct oscar_data *)gc->proto_data; |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
862 struct getfile_transfer *gt; |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
863 char buf[2048]; |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
864 GtkWidget *label; |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
865 GtkWidget *button; |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
866 |
1156
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
867 va_list ap; |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
868 struct aim_conn_t *oftconn; |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
869 struct aim_fileheader_t *fh; |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
870 char *cookie; |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
871 |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
872 va_start(ap, command); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
873 oftconn = va_arg(ap, struct aim_conn_t *); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
874 fh = va_arg(ap, struct aim_fileheader_t *); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
875 cookie = va_arg(ap, char *); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
876 va_end(ap); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
877 |
1161
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
878 gt = find_getfile_transfer(od, oftconn); |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
879 |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
880 if (gt->window) |
1233
728a90516211
[gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1231
diff
changeset
|
881 return 1; |
1161
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
882 |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
883 gt->window = gtk_dialog_new(); |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
884 gtk_window_set_title(GTK_WINDOW(gt->window), _("Gaim - File Transfer")); |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
885 gtk_widget_realize(gt->window); |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
886 aol_icon(gt->window->window); |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
887 |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
888 g_snprintf(buf, sizeof buf, _("Sending %s to %s"), fh->name, gt->receiver); |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
889 label = gtk_label_new(buf); |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
890 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(gt->window)->vbox), label, FALSE, FALSE, 5); |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
891 gtk_widget_show(label); |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
892 |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
893 gt->meter = gtk_progress_bar_new(); |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
894 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(gt->window)->action_area), gt->meter, FALSE, FALSE, 5); |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
895 gtk_widget_show(gt->meter); |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
896 |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
897 gt->label = gtk_label_new("0 %"); |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
898 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(gt->window)->action_area), gt->label, FALSE, FALSE, 5); |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
899 gtk_widget_show(gt->label); |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
900 |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
901 button = picture_button(gt->window, _("Cancel"), cancel_xpm); |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
902 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(gt->window)->action_area), button, FALSE, FALSE, 5); |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
903 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(interrupt_getfile), gt); |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
904 |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
905 gtk_widget_show(gt->window); |
1156
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
906 |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
907 return 1; |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
908 } |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
909 |
1161
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
910 static void getfile_send_callback(gpointer data, gint source, GdkInputCondition condition) { |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
911 struct getfile_transfer *gt = (struct getfile_transfer *)data; |
1188
004d472be8a3
[gaim-migrate @ 1198]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1186
diff
changeset
|
912 int result; |
1161
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
913 |
1188
004d472be8a3
[gaim-migrate @ 1198]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1186
diff
changeset
|
914 result = aim_getfile_send_chunk(gt->conn, gt->file, gt->fh, -1, 1024); |
004d472be8a3
[gaim-migrate @ 1198]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1186
diff
changeset
|
915 gt->pos += result; |
004d472be8a3
[gaim-migrate @ 1198]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1186
diff
changeset
|
916 if (result == 0) { |
004d472be8a3
[gaim-migrate @ 1198]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1186
diff
changeset
|
917 gdk_input_remove(gt->gop); gt->gop = 0; |
004d472be8a3
[gaim-migrate @ 1198]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1186
diff
changeset
|
918 } else if (result == -1) { |
004d472be8a3
[gaim-migrate @ 1198]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1186
diff
changeset
|
919 do_error_dialog(_("Error in transfer"), "Gaim"); |
004d472be8a3
[gaim-migrate @ 1198]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1186
diff
changeset
|
920 gdk_input_remove(gt->gop); gt->gop = 0; |
004d472be8a3
[gaim-migrate @ 1198]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1186
diff
changeset
|
921 interrupt_getfile(NULL, gt); |
004d472be8a3
[gaim-migrate @ 1198]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1186
diff
changeset
|
922 } |
1161
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
923 } |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
924 |
1156
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
925 static int gaim_getfile_filesend(struct aim_session_t *sess, struct command_rx_struct *command, ...) { |
1161
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
926 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess); |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
927 struct oscar_data *od = (struct oscar_data *)gc->proto_data; |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
928 struct getfile_transfer *gt; |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
929 |
1156
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
930 va_list ap; |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
931 struct aim_conn_t *oftconn; |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
932 struct aim_fileheader_t *fh; |
1233
728a90516211
[gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1231
diff
changeset
|
933 char *cookie; |
1156
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
934 |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
935 va_start(ap, command); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
936 oftconn = va_arg(ap, struct aim_conn_t *); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
937 fh = va_arg(ap, struct aim_fileheader_t *); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
938 cookie = va_arg(ap, char *); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
939 va_end(ap); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
940 |
1161
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
941 gt = find_getfile_transfer(od, oftconn); |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
942 |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
943 if (gt->gop > 0) { |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
944 debug_printf("already have output watcher?\n"); |
1233
728a90516211
[gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1231
diff
changeset
|
945 return 1; |
1161
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
946 } |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
947 |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
948 if ((gt->file = fopen(gt->filename, "r")) == NULL) { |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
949 interrupt_getfile(NULL, gt); |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
950 return 1; |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
951 } |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
952 gt->pos = 0; |
1188
004d472be8a3
[gaim-migrate @ 1198]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1186
diff
changeset
|
953 gt->fh = g_memdup(fh, sizeof(struct aim_fileheader_t)); |
004d472be8a3
[gaim-migrate @ 1198]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1186
diff
changeset
|
954 fseek(gt->file, 0, SEEK_SET); |
1161
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
955 |
1188
004d472be8a3
[gaim-migrate @ 1198]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1186
diff
changeset
|
956 gt->gop = gdk_input_add(gt->conn->fd, GDK_INPUT_WRITE, getfile_send_callback, gt); |
1156
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
957 |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
958 return 1; |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
959 } |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
960 |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
961 static int gaim_getfile_complete(struct aim_session_t *sess, struct command_rx_struct *command, ...) { |
1161
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
962 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess); |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
963 struct oscar_data *od = (struct oscar_data *)gc->proto_data; |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
964 struct getfile_transfer *gt; |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
965 |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
966 va_list ap; |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
967 struct aim_conn_t *conn; |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
968 struct aim_fileheader_t *fh; |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
969 |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
970 va_start(ap, command); |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
971 conn = va_arg(ap, struct aim_conn_t *); |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
972 fh = va_arg(ap, struct aim_fileheader_t *); |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
973 va_end(ap); |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
974 |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
975 gt = find_getfile_transfer(od, conn); |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
976 |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
977 gtk_widget_destroy(gt->window); |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
978 gt->window = NULL; |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
979 do_error_dialog(_("Transfer complete."), "Gaim"); |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
980 |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
981 return 1; |
1156
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
982 } |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
983 |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
984 static int gaim_getfile_disconnect(struct aim_session_t *sess, struct command_rx_struct *command, ...) { |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
985 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
986 struct oscar_data *od = (struct oscar_data *)gc->proto_data; |
1161
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
987 struct getfile_transfer *gt; |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
988 |
1156
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
989 va_list ap; |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
990 struct aim_conn_t *conn; |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
991 char *sn; |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
992 |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
993 va_start(ap, command); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
994 conn = va_arg(ap, struct aim_conn_t *); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
995 sn = va_arg(ap, char *); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
996 va_end(ap); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
997 |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
998 gt = find_getfile_transfer(od, conn); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
999 od->getfiles = g_slist_remove(od->getfiles, gt); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1000 gdk_input_remove(gt->gip); |
1161
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
1001 if (gt->gop > 0) |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
1002 gdk_input_remove(gt->gop); |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
1003 g_free(gt->receiver); |
1156
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1004 g_free(gt->filename); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1005 aim_conn_kill(sess, &conn); |
1161
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
1006 fclose(gt->listing); |
1156
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1007 g_free(gt); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1008 |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1009 debug_printf("getfile disconnect\n"); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1010 |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1011 return 1; |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1012 } |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1013 |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1014 static void do_getfile(GtkObject *obj, struct ask_getfile *g) { |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1015 GtkWidget *w = gtk_object_get_user_data(obj); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1016 char *filename = gtk_file_selection_get_filename(GTK_FILE_SELECTION(w)); |
1064
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
1017 struct gaim_connection *gc = g->gc; |
1156
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1018 struct oscar_data *od = (struct oscar_data *)gc->proto_data; |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1019 struct getfile_transfer *gf; |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1020 struct stat st; |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1021 struct tm *ft; |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1022 char tmppath[256]; |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1023 FILE *file; |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1024 static int current = 0; |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1025 struct aim_conn_t *newconn; |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1026 |
1156
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1027 if (file_is_dir(filename, w)) |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1028 return; |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1029 |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1030 if (stat(filename, &st) != 0) { |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1031 gtk_widget_destroy(w); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1032 do_error_dialog(_("Error examining file"), _("GetFile Error")); |
1064
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
1033 cancel_getfile(w, g); |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
1034 return; |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
1035 } |
1156
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1036 |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1037 g_snprintf(tmppath, sizeof tmppath, "/%s/gaim%d%d", g_get_tmp_dir(), getpid(), current++); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1038 if ((file = fopen(tmppath, "w+")) == NULL) { |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1039 gtk_widget_destroy(w); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1040 do_error_dialog(_("Could not open temporary file, aborting"), _("GetFile Error")); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1041 cancel_getfile(w, g); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1042 return; |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1043 } |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1044 |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1045 gf = g_new0(struct getfile_transfer, 1); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1046 gf->gc = gc; |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1047 gf->filename = g_strdup(filename); |
1161
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
1048 gf->listing = file; |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
1049 gf->receiver = g_strdup(g->sn); |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
1050 gf->size = st.st_size; |
1156
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1051 |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1052 ft = localtime(&st.st_ctime); |
1161
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
1053 fprintf(file, "%2d/%2d/%4d %2d:%2d %8ld ", |
1156
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1054 ft->tm_mon + 1, ft->tm_mday, ft->tm_year + 1900, |
1233
728a90516211
[gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1231
diff
changeset
|
1055 ft->tm_hour + 1, ft->tm_min + 1, (long)st.st_size); |
1161
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
1056 fprintf(file, "%s\r\n", g_basename(filename)); |
1156
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1057 rewind(file); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1058 |
1161
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
1059 aim_oft_registerlisting(od->sess, file, ""); |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
1060 od->sess->flags ^= AIM_SESS_FLAGS_NONBLOCKCONNECT; |
1156
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1061 if ((newconn = aim_accepttransfer(od->sess, od->conn, g->sn, g->cookie, g->ip, file, AIM_CAPS_GETFILE)) == NULL) { |
1161
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
1062 od->sess->flags ^= AIM_SESS_FLAGS_NONBLOCKCONNECT; |
1156
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1063 do_error_dialog(_("Error connecting for transfer"), _("GetFile Error")); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1064 g_free(gf->filename); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1065 fclose(file); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1066 g_free(gf); |
1161
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
1067 gtk_widget_destroy(w); |
1156
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1068 return; |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1069 } |
1161
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
1070 od->sess->flags ^= AIM_SESS_FLAGS_NONBLOCKCONNECT; |
1156
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1071 |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1072 gtk_widget_destroy(w); |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1073 |
1156
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1074 gf->gip = gdk_input_add(newconn->fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION, oscar_callback, newconn); |
1161
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
1075 od->getfiles = g_slist_append(od->getfiles, gf); |
984cbc219724
[gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1156
diff
changeset
|
1076 gf->conn = newconn; |
1156
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1077 aim_conn_addhandler(od->sess, newconn, AIM_CB_FAM_OFT, AIM_CB_OFT_GETFILEFILEREQ, gaim_getfile_filereq, 0); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1078 aim_conn_addhandler(od->sess, newconn, AIM_CB_FAM_OFT, AIM_CB_OFT_GETFILEFILESEND, gaim_getfile_filesend, 0); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1079 aim_conn_addhandler(od->sess, newconn, AIM_CB_FAM_OFT, AIM_CB_OFT_GETFILECOMPLETE, gaim_getfile_complete, 0); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1080 aim_conn_addhandler(od->sess, newconn, AIM_CB_FAM_OFT, AIM_CB_OFT_GETFILEDISCONNECT, gaim_getfile_disconnect, 0); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1081 } |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1082 |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1083 static int accept_getfile(gpointer w, struct ask_getfile *g) { |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1084 GtkWidget *window; |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1085 window = gtk_file_selection_new(_("Gaim - Send File...")); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1086 gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(window)); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1087 gtk_object_set_user_data(GTK_OBJECT(window), window); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1088 gtk_signal_connect(GTK_OBJECT(window), "destroy", |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1089 GTK_SIGNAL_FUNC(cancel_getfile_file), g); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1090 gtk_object_set_user_data(GTK_OBJECT(GTK_FILE_SELECTION(window)->ok_button), window); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1091 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(window)->ok_button), "clicked", |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1092 GTK_SIGNAL_FUNC(do_getfile), g); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1093 gtk_object_set_user_data(GTK_OBJECT(GTK_FILE_SELECTION(window)->cancel_button), window); |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1094 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(window)->cancel_button), "clicked", |
1246
42ca87108cd1
[gaim-migrate @ 1256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1245
diff
changeset
|
1095 GTK_SIGNAL_FUNC(cancel_getfile_cancel), g); |
1156
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1096 gtk_widget_show(window); |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1097 |
1064
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
1098 return TRUE; |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1099 } |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1100 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1101 int gaim_parse_incoming_im(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1102 struct command_rx_struct *command, ...) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1103 int channel; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1104 va_list ap; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
1105 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess); |
1 | 1106 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1107 va_start(ap, command); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1108 channel = va_arg(ap, int); |
1 | 1109 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1110 /* channel 1: standard message */ |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1111 if (channel == 1) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1112 struct aim_userinfo_s *userinfo; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1113 char *msg = NULL; |
744
f53e8f48628d
[gaim-migrate @ 754]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
741
diff
changeset
|
1114 char *tmp = g_malloc(BUF_LONG); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1115 u_int icbmflags = 0; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1116 u_short flag1, flag2; |
1 | 1117 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1118 userinfo = va_arg(ap, struct aim_userinfo_s *); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1119 msg = va_arg(ap, char *); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1120 icbmflags = va_arg(ap, u_int); |
464 | 1121 flag1 = (u_short)va_arg(ap, u_int); |
1122 flag2 = (u_short)va_arg(ap, u_int); | |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1123 va_end(ap); |
1 | 1124 |
744
f53e8f48628d
[gaim-migrate @ 754]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
741
diff
changeset
|
1125 g_snprintf(tmp, BUF_LONG, "%s", msg); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
1126 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
|
1127 g_free(tmp); |
252
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
1128 } else if (channel == 2) { |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
1129 struct aim_userinfo_s *userinfo; |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
1130 int rendtype = va_arg(ap, int); |
445
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
423
diff
changeset
|
1131 if (rendtype & AIM_CAPS_CHAT) { |
252
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
1132 char *msg, *encoding, *lang; |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
1133 struct aim_chat_roominfo *roominfo; |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
1134 |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
1135 userinfo = va_arg(ap, struct aim_userinfo_s *); |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
1136 roominfo = va_arg(ap, struct aim_chat_roominfo *); |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
1137 msg = va_arg(ap, char *); |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
1138 encoding = va_arg(ap, char *); |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
1139 lang = va_arg(ap, char *); |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
1140 va_end(ap); |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
1141 |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
1142 serv_got_chat_invite(gc, |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
1143 roominfo->name, |
693
30a8e386849d
[gaim-migrate @ 703]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
692
diff
changeset
|
1144 roominfo->exchange, |
252
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
1145 userinfo->sn, |
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
1146 msg); |
445
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
423
diff
changeset
|
1147 } else if (rendtype & AIM_CAPS_SENDFILE) { |
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
423
diff
changeset
|
1148 } else if (rendtype & AIM_CAPS_GETFILE) { |
1064
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
1149 char *ip, *cookie; |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
1150 struct ask_getfile *g = g_new0(struct ask_getfile, 1); |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
1151 char buf[256]; |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
1152 |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
1153 userinfo = va_arg(ap, struct aim_userinfo_s *); |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
1154 ip = va_arg(ap, char *); |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
1155 cookie = va_arg(ap, char *); |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
1156 va_end(ap); |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
1157 |
1156
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1158 debug_printf("%s received getfile request from %s (%s), cookie = %s\n", |
b6b2d26a4e2f
[gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1153
diff
changeset
|
1159 gc->username, userinfo->sn, ip, cookie); |
1064
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
1160 |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
1161 g->gc = gc; |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
1162 g->sn = g_strdup(userinfo->sn); |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
1163 g->cookie = g_strdup(cookie); |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
1164 g->ip = g_strdup(ip); |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
1165 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
|
1166 userinfo->sn, gc->username); |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
1167 do_ask_dialog(buf, g, accept_getfile, cancel_getfile); |
445
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
423
diff
changeset
|
1168 } else if (rendtype & AIM_CAPS_VOICE) { |
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
423
diff
changeset
|
1169 } else if (rendtype & AIM_CAPS_BUDDYICON) { |
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
423
diff
changeset
|
1170 } else if (rendtype & AIM_CAPS_IMIMAGE) { |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1171 struct aim_directim_priv *priv; |
1064
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
1172 struct ask_direct *d = g_new0(struct ask_direct, 1); |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
1173 char buf[256]; |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1174 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1175 userinfo = va_arg(ap, struct aim_userinfo_s *); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1176 priv = va_arg(ap, struct aim_directim_priv *); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1177 va_end(ap); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1178 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1179 debug_printf("%s received direct im request from %s (%s)\n", |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1180 gc->username, userinfo->sn, priv->ip); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1181 |
1064
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
1182 d->gc = gc; |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
1183 d->sn = g_strdup(userinfo->sn); |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
1184 d->priv = priv; |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
1185 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
|
1186 userinfo->sn, gc->username); |
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
1187 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
|
1188 } else { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
1189 debug_printf("Unknown rendtype %d\n", rendtype); |
252
4a41f8323022
[gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
250
diff
changeset
|
1190 } |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1191 } |
1 | 1192 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1193 return 1; |
1 | 1194 } |
1195 | |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1196 int gaim_parse_misses(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1197 struct command_rx_struct *command, ...) { |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1198 va_list ap; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1199 u_short chan, nummissed, reason; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1200 struct aim_userinfo_s *userinfo; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1201 char buf[1024]; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1202 |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1203 va_start(ap, command); |
838
7714587cd1f9
[gaim-migrate @ 848]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
836
diff
changeset
|
1204 chan = (u_short)va_arg(ap, u_int); |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1205 userinfo = va_arg(ap, struct aim_userinfo_s *); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1206 nummissed = (u_short)va_arg(ap, u_int); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1207 reason = (u_short)va_arg(ap, u_int); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1208 va_end(ap); |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1209 |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1210 switch(reason) { |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1211 case 1: |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1212 /* message too large */ |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1213 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
|
1214 do_error_dialog(buf, _("Gaim - Error")); |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
1215 plugin_event(event_error, (void *)961, 0, 0, 0); |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1216 break; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1217 default: |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1218 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
|
1219 do_error_dialog(buf, _("Gaim - Error")); |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
1220 plugin_event(event_error, (void *)970, 0, 0, 0); |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1221 break; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1222 } |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1223 |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1224 return 1; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1225 } |
709
957957d0dc2c
[gaim-migrate @ 719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
704
diff
changeset
|
1226 |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1227 int gaim_parse_msgerr(struct aim_session_t *sess, |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1228 struct command_rx_struct *command, ...) { |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1229 va_list ap; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1230 char *destn; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1231 u_short reason; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1232 char buf[1024]; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1233 |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1234 va_start(ap, command); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1235 destn = va_arg(ap, char *); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1236 reason = (u_short)va_arg(ap, u_int); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1237 va_end(ap); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1238 |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1239 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
|
1240 (reason < msgerrreasonlen) ? msgerrreason[reason] : _("Reason unknown")); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1241 do_error_dialog(buf, _("Gaim - Error")); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1242 |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1243 return 1; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1244 } |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1245 |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1246 int gaim_parse_locerr(struct aim_session_t *sess, |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1247 struct command_rx_struct *command, ...) { |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1248 va_list ap; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1249 char *destn; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1250 u_short reason; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1251 char buf[1024]; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1252 |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1253 va_start(ap, command); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1254 destn = va_arg(ap, char *); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1255 reason = (u_short)va_arg(ap, u_int); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1256 va_end(ap); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1257 |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1258 sprintf(buf, _("User information for %s unavailable: %s"), destn, |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1259 (reason < msgerrreasonlen) ? msgerrreason[reason] : _("Reason unknown")); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1260 do_error_dialog(buf, _("Gaim - Error")); |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1261 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1262 return 1; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1263 } |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1264 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1265 int gaim_parse_user_info(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1266 struct command_rx_struct *command, ...) { |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1267 struct aim_userinfo_s *info; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1268 char *prof_enc = NULL, *prof = NULL; |
249
810c595258c8
[gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
248
diff
changeset
|
1269 u_short infotype; |
247
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
1270 char buf[BUF_LONG]; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
1271 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
|
1272 va_list ap; |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1273 |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1274 va_start(ap, command); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1275 info = va_arg(ap, struct aim_userinfo_s *); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1276 prof_enc = va_arg(ap, char *); |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1277 prof = va_arg(ap, char *); |
464 | 1278 infotype = (u_short)va_arg(ap, u_int); |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1279 va_end(ap); |
247
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
1280 |
249
810c595258c8
[gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
248
diff
changeset
|
1281 if (prof == NULL || !strlen(prof)) { |
392
df5127560034
[gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
388
diff
changeset
|
1282 /* no info/away message */ |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1283 char buf[1024]; |
1206
0d19ddd6f11e
[gaim-migrate @ 1216]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1201
diff
changeset
|
1284 sprintf(buf, _("%s has no %s."), info->sn, |
0d19ddd6f11e
[gaim-migrate @ 1216]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1201
diff
changeset
|
1285 (infotype == AIM_GETINFO_GENERALINFO) ? "information" : "away message"); |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1286 do_error_dialog(buf, _("Gaim - Error")); |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
1287 plugin_event(event_error, (void *)977, 0, 0, 0); |
249
810c595258c8
[gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
248
diff
changeset
|
1288 return 1; |
810c595258c8
[gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
248
diff
changeset
|
1289 } |
810c595258c8
[gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
248
diff
changeset
|
1290 |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
1291 snprintf(buf, sizeof buf, _("Username : <B>%s</B>\n<BR>" |
247
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
1292 "Warning Level : <B>%d %%</B>\n<BR>" |
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
1293 "Online Since : <B>%s</B><BR>" |
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
1294 "Idle Minutes : <B>%d</B>\n<BR><HR><BR>" |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
1295 "%s\n"), |
247
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
1296 info->sn, |
601
e670cdb5fb2f
[gaim-migrate @ 611]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
592
diff
changeset
|
1297 info->warnlevel/10, |
247
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
1298 asctime(localtime(&info->onlinesince)), |
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
1299 info->idletime, |
592
7c75d69a1129
[gaim-migrate @ 602]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
535
diff
changeset
|
1300 infotype == AIM_GETINFO_GENERALINFO ? prof : |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
1301 away_subs(prof, gc->username)); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
1302 g_show_info_text(away_subs(buf, gc->username)); |
247
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
243
diff
changeset
|
1303 |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1304 return 1; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1305 } |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1306 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1307 int gaim_parse_motd(struct aim_session_t *sess, |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1308 struct command_rx_struct *command, ...) { |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1309 char *msg; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1310 u_short id; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1311 va_list ap; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1312 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1313 va_start(ap, command); |
464 | 1314 id = (u_short)va_arg(ap, u_int); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1315 msg = va_arg(ap, char *); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1316 va_end(ap); |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1317 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
1318 debug_printf("MOTD: %s (%d)\n", msg, id); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
1319 debug_printf("Gaim %s / Libfaim %s\n", VERSION, aim_getbuildstring()); |
771
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1320 if (id != 4) |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1321 do_error_dialog(_("Your connection may be lost."), |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1322 _("AOL error")); |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1323 |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1324 return 1; |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1325 } |
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
79
diff
changeset
|
1326 |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
1327 int gaim_chatnav_info(struct aim_session_t *sess, |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
1328 struct command_rx_struct *command, ...) { |
445
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
423
diff
changeset
|
1329 va_list ap; |
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
423
diff
changeset
|
1330 u_short type; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
1331 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
|
1332 struct oscar_data *odata = (struct oscar_data *)gc->proto_data; |
445
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
423
diff
changeset
|
1333 |
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
423
diff
changeset
|
1334 va_start(ap, command); |
464 | 1335 type = (u_short)va_arg(ap, u_int); |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1336 |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1337 switch(type) { |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1338 case 0x0002: { |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1339 int maxrooms; |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1340 struct aim_chat_exchangeinfo *exchanges; |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1341 int exchangecount, i = 0; |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1342 |
466 | 1343 maxrooms = (u_char)va_arg(ap, u_int); |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1344 exchangecount = va_arg(ap, int); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1345 exchanges = va_arg(ap, struct aim_chat_exchangeinfo *); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1346 va_end(ap); |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1347 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
1348 debug_printf("chat info: Chat Rights:\n"); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
1349 debug_printf("chat info: \tMax Concurrent Rooms: %d\n", maxrooms); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
1350 debug_printf("chat info: \tExchange List: (%d total)\n", exchangecount); |
1148
0a14a9a844cb
[gaim-migrate @ 1158]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1147
diff
changeset
|
1351 while (i < exchangecount) |
0a14a9a844cb
[gaim-migrate @ 1158]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1147
diff
changeset
|
1352 debug_printf("chat info: \t\t%d\n", exchanges[i++].number); |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1353 if (odata->create_exchange) { |
1149
22bf2c3ec2e3
[gaim-migrate @ 1159]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1148
diff
changeset
|
1354 debug_printf("creating room %s\n", odata->create_name); |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1355 aim_chatnav_createroom(sess, command->conn, odata->create_name, |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1356 odata->create_exchange); |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1357 odata->create_exchange = 0; |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1358 g_free(odata->create_name); |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1359 odata->create_name = NULL; |
904
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1360 } |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1361 } |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1362 break; |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1363 case 0x0008: { |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1364 char *fqcn, *name, *ck; |
1201
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1188
diff
changeset
|
1365 u_short instance, flags, maxmsglen, maxoccupancy, unknown, exchange; |
904
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1366 unsigned char createperms; |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1367 unsigned long createtime; |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1368 |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1369 fqcn = va_arg(ap, char *); |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1370 instance = (u_short)va_arg(ap, u_int); |
1201
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1188
diff
changeset
|
1371 exchange = (u_short)va_arg(ap, u_int); |
904
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1372 flags = (u_short)va_arg(ap, u_int); |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1373 createtime = va_arg(ap, unsigned long); |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1374 maxmsglen = (u_short)va_arg(ap, u_int); |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1375 maxoccupancy = (u_short)va_arg(ap, u_int); |
906
7b976e5e1c3a
[gaim-migrate @ 916]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
905
diff
changeset
|
1376 createperms = (unsigned char)va_arg(ap, int); |
904
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1377 unknown = (u_short)va_arg(ap, u_int); |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1378 name = va_arg(ap, char *); |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1379 ck = va_arg(ap, char *); |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1380 va_end(ap); |
e1a7fc4482b9
[gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
900
diff
changeset
|
1381 |
1201
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1188
diff
changeset
|
1382 debug_printf("created room: %s %d %d %d %lu %d %d %d %d %s %s\n", |
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1188
diff
changeset
|
1383 fqcn, |
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1188
diff
changeset
|
1384 exchange, instance, flags, |
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1188
diff
changeset
|
1385 createtime, |
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1188
diff
changeset
|
1386 maxmsglen, maxoccupancy, createperms, unknown, |
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1188
diff
changeset
|
1387 name, ck); |
90bb83cafb9e
[gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1188
diff
changeset
|
1388 aim_chat_join(odata->sess, odata->conn, exchange, ck); |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1389 } |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1390 break; |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1391 default: |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1392 va_end(ap); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
1393 debug_printf("chatnav info: unknown type (%04x)\n", type); |
302
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1394 break; |
61894ab8c47e
[gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
288
diff
changeset
|
1395 } |
242
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
1396 return 1; |
14fc16f579c8
[gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
1397 } |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1398 |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1399 int gaim_chat_join(struct aim_session_t *sess, |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1400 struct command_rx_struct *command, ...) { |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1401 va_list ap; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1402 int count, i = 0; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1403 struct aim_userinfo_s *info; |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
1404 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
|
1405 |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
1406 GSList *bcs = g->buddy_chats; |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
466
diff
changeset
|
1407 struct conversation *b = NULL; |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1408 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1409 va_start(ap, command); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1410 count = va_arg(ap, int); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1411 info = va_arg(ap, struct aim_userinfo_s *); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1412 va_end(ap); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1413 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1414 while(bcs) { |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
466
diff
changeset
|
1415 b = (struct conversation *)bcs->data; |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1416 if (!strcasecmp(b->name, (char *)command->conn->priv)) |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1417 break; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1418 bcs = bcs->next; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1419 b = NULL; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1420 } |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1421 if (!b) |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1422 return 1; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1423 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1424 while (i < count) |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1425 add_chat_buddy(b, info[i++].sn); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1426 |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1427 return 1; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1428 } |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1429 |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1430 int gaim_chat_leave(struct aim_session_t *sess, |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1431 struct command_rx_struct *command, ...) { |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1432 va_list ap; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1433 int count, i = 0; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1434 struct aim_userinfo_s *info; |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
1435 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
|
1436 |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
1437 GSList *bcs = g->buddy_chats; |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
466
diff
changeset
|
1438 struct conversation *b = NULL; |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1439 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1440 va_start(ap, command); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1441 count = va_arg(ap, int); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1442 info = va_arg(ap, struct aim_userinfo_s *); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1443 va_end(ap); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1444 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1445 while(bcs) { |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
466
diff
changeset
|
1446 b = (struct conversation *)bcs->data; |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1447 if (!strcasecmp(b->name, (char *)command->conn->priv)) |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1448 break; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1449 bcs = bcs->next; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1450 b = NULL; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1451 } |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1452 if (!b) |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1453 return 1; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1454 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1455 while (i < count) |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1456 remove_chat_buddy(b, info[i++].sn); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1457 |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1458 return 1; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1459 } |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1460 |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1461 int gaim_chat_info_update(struct aim_session_t *sess, |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1462 struct command_rx_struct *command, ...) { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
1463 debug_printf("inside chat_info_update\n"); |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1464 return 1; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1465 } |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1466 |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1467 int gaim_chat_incoming_msg(struct aim_session_t *sess, |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1468 struct command_rx_struct *command, ...) { |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1469 va_list ap; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1470 struct aim_userinfo_s *info; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1471 char *msg; |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
1472 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
|
1473 |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
1474 GSList *bcs = gc->buddy_chats; |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
466
diff
changeset
|
1475 struct conversation *b = NULL; |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1476 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1477 va_start(ap, command); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1478 info = va_arg(ap, struct aim_userinfo_s *); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1479 msg = va_arg(ap, char *); |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1480 |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1481 while(bcs) { |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
466
diff
changeset
|
1482 b = (struct conversation *)bcs->data; |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1483 if (!strcasecmp(b->name, (char *)command->conn->priv)) |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1484 break; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1485 bcs = bcs->next; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1486 b = NULL; |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1487 } |
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1488 if (!b) |
270
cfa39d39dec6
[gaim-migrate @ 280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
267
diff
changeset
|
1489 return 0; |
248
cfc73b8501a7
[gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
1490 |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
1491 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
|
1492 |
243
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1493 return 1; |
3414ff74cb0f
[gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
242
diff
changeset
|
1494 } |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1495 |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1496 /* |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1497 * 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
|
1498 */ |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1499 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
|
1500 va_list ap; |
505
3bd51b3f07c3
[gaim-migrate @ 515]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
503
diff
changeset
|
1501 u_short type; |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1502 char *sn = NULL; |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1503 |
505
3bd51b3f07c3
[gaim-migrate @ 515]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
503
diff
changeset
|
1504 va_start(ap, command); |
3bd51b3f07c3
[gaim-migrate @ 515]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
503
diff
changeset
|
1505 type = (u_short)va_arg(ap, u_int); |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1506 sn = va_arg(ap, char *); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1507 va_end(ap); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1508 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
1509 debug_printf("Sent message to %s.\n", sn); |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1510 |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1511 return 1; |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1512 } |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1513 |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1514 int gaim_parse_ratechange(struct aim_session_t *sess, struct command_rx_struct *command, ...) { |
1288
d8eaf65ca9c3
[gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
1515 static char *codes[5] = {"invalid", |
d8eaf65ca9c3
[gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
1516 "change", |
d8eaf65ca9c3
[gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
1517 "warning", |
d8eaf65ca9c3
[gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
1518 "limit", |
d8eaf65ca9c3
[gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
1519 "limit cleared"}; |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1520 va_list ap; |
1288
d8eaf65ca9c3
[gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
1521 int code; |
d8eaf65ca9c3
[gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
1522 unsigned long parmid, windowsize, clear, alert, limit, disconnect; |
d8eaf65ca9c3
[gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
1523 unsigned long currentavg, maxavg; |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1524 |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1525 va_start(ap, command); |
1288
d8eaf65ca9c3
[gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
1526 code = va_arg(ap, int); |
d8eaf65ca9c3
[gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
1527 parmid = va_arg(ap, int); |
d8eaf65ca9c3
[gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
1528 windowsize = va_arg(ap, unsigned long); |
d8eaf65ca9c3
[gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
1529 clear = va_arg(ap, unsigned long); |
d8eaf65ca9c3
[gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
1530 alert = va_arg(ap, unsigned long); |
d8eaf65ca9c3
[gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
1531 limit = va_arg(ap, unsigned long); |
d8eaf65ca9c3
[gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
1532 disconnect = va_arg(ap, unsigned long); |
d8eaf65ca9c3
[gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
1533 currentavg = va_arg(ap, unsigned long); |
d8eaf65ca9c3
[gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
1534 maxavg = va_arg(ap, unsigned long); |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1535 va_end(ap); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1536 |
1288
d8eaf65ca9c3
[gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
1537 debug_printf("rate %s (paramid 0x%04lx): curavg = %ld, maxavg = %ld, alert at %ld, " |
d8eaf65ca9c3
[gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
1538 "clear warning at %ld, limit at %ld, disconnect at %ld (window size = %ld)\n", |
d8eaf65ca9c3
[gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
1539 (code < 5) ? codes[code] : codes[0], |
d8eaf65ca9c3
[gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
1540 parmid, |
d8eaf65ca9c3
[gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
1541 currentavg, maxavg, |
d8eaf65ca9c3
[gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
1542 alert, clear, |
d8eaf65ca9c3
[gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
1543 limit, disconnect, |
d8eaf65ca9c3
[gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
1544 windowsize); |
d8eaf65ca9c3
[gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
1545 |
d8eaf65ca9c3
[gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
1546 if (code == AIM_RATE_CODE_CHANGE) { |
d8eaf65ca9c3
[gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
1547 if (currentavg >= clear) |
d8eaf65ca9c3
[gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
1548 aim_conn_setlatency(command->conn, 0); |
d8eaf65ca9c3
[gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
1549 } else if (code == AIM_RATE_CODE_WARNING) { |
d8eaf65ca9c3
[gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
1550 aim_conn_setlatency(command->conn, windowsize/4); |
d8eaf65ca9c3
[gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
1551 } else if (code == AIM_RATE_CODE_LIMIT) { |
d8eaf65ca9c3
[gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
1552 aim_conn_setlatency(command->conn, windowsize/2); |
d8eaf65ca9c3
[gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
1553 } else if (code == AIM_RATE_CODE_CLEARLIMIT) { |
d8eaf65ca9c3
[gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
1554 aim_conn_setlatency(command->conn, 0); |
d8eaf65ca9c3
[gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1261
diff
changeset
|
1555 } |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1556 |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
481
diff
changeset
|
1557 return 1; |
840
595ac7759563
[gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
838
diff
changeset
|
1558 } |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
505
diff
changeset
|
1559 |
771
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1560 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
|
1561 va_list ap; |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1562 char *sn; |
1100
f168625b63fe
[gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1092
diff
changeset
|
1563 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess); |
771
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1564 |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1565 va_start(ap, command); |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1566 sn = va_arg(ap, char *); |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1567 va_end(ap); |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1568 |
1100
f168625b63fe
[gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1092
diff
changeset
|
1569 serv_got_eviled(gc, sn, 0); |
771
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1570 |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1571 return 1; |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1572 } |
72e556f6b99d
[gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
747
diff
changeset
|
1573 |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1574 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
|
1575 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
|
1576 switch (command->conn->type) { |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1577 case AIM_CONN_TYPE_BOS: |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1578 aim_bos_ackrateresp(sess, command->conn); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1579 aim_bos_reqpersonalinfo(sess, command->conn); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1580 aim_bos_reqlocaterights(sess, command->conn); |
1051
713b0e14e0a9
[gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
1581 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
|
1582 aim_bos_reqbuddyrights(sess, command->conn); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1583 |
1089
f0f5c10cce63
[gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1086
diff
changeset
|
1584 account_online(gc); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
1585 serv_finish_login(gc); |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1586 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
1587 if (bud_list_cache_exists(gc)) |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
946
diff
changeset
|
1588 do_import(NULL, gc); |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1589 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
1590 debug_printf("buddy list loaded\n"); |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1591 |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1592 aim_addicbmparam(sess, command->conn); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1593 aim_bos_reqicbmparaminfo(sess, command->conn); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1594 |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1595 aim_bos_reqrights(sess, command->conn); |
900
e18815f5a4e9
[gaim-migrate @ 910]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
891
diff
changeset
|
1596 aim_bos_setgroupperm(sess, command->conn, AIM_FLAG_ALLUSERS); |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1597 aim_bos_setprivacyflags(sess, command->conn, AIM_PRIVFLAGS_ALLOWIDLE | |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1598 AIM_PRIVFLAGS_ALLOWMEMBERSINCE); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1599 |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1600 break; |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1601 default: |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
1602 debug_printf("got rate response for unhandled connection type %04x\n", |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1603 command->conn->type); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1604 break; |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1605 } |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1606 |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1607 return 1; |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1608 } |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1609 |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1610 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
|
1611 if (command->data) { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
1612 debug_printf("minimum report interval: %d (seconds?)\n", aimutil_get16(command->data+10)); |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1613 } else |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
1614 debug_printf("NULL minimum report interval!\n"); |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1615 return 1; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1616 } |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1617 |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1618 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
|
1619 va_list ap; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1620 u_short maxbuddies, maxwatchers; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1621 |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1622 va_start(ap, command); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1623 maxbuddies = (u_short)va_arg(ap, u_int); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1624 maxwatchers = (u_short)va_arg(ap, u_int); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1625 va_end(ap); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1626 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
1627 debug_printf("buddy list rights: Max buddies = %d / Max watchers = %d\n", maxbuddies, maxwatchers); |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1628 |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1629 return 1; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1630 } |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1631 |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1632 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
|
1633 u_short maxpermits, maxdenies; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1634 va_list ap; |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1635 |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1636 va_start(ap, command); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1637 maxpermits = (u_short)va_arg(ap, u_int); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1638 maxdenies = (u_short)va_arg(ap, u_int); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1639 va_end(ap); |
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1640 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
1641 debug_printf("BOS rights: Max permit = %d / Max deny = %d\n", maxpermits, maxdenies); |
836
15d005f8baaf
[gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1642 |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1643 aim_bos_clientready(sess, command->conn); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1644 |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1645 aim_bos_reqservice(sess, command->conn, AIM_CONN_TYPE_CHATNAV); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1646 |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1647 return 1; |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1648 } |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
828
diff
changeset
|
1649 |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1650 static void oscar_keepalive(struct gaim_connection *gc) { |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1651 struct oscar_data *odata = (struct oscar_data *)gc->proto_data; |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1652 aim_flap_nop(odata->sess, odata->conn); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1653 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1654 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1655 static char *oscar_name() { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1656 return "Oscar"; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1657 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1658 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1659 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
|
1660 struct oscar_data *odata = (struct oscar_data *)gc->proto_data; |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1661 struct direct_im *dim = find_direct_im(odata, name); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1662 if (dim) { |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1663 aim_send_im_direct(odata->sess, dim->conn, message); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1664 } else { |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1665 if (away) |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1666 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
|
1667 else |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1668 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
|
1669 } |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1670 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1671 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1672 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
|
1673 struct oscar_data *odata = (struct oscar_data *)g->proto_data; |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1674 aim_getinfo(odata->sess, odata->conn, name, AIM_GETINFO_GENERALINFO); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1675 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1676 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1677 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
|
1678 struct oscar_data *odata = (struct oscar_data *)g->proto_data; |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1679 aim_getinfo(odata->sess, odata->conn, name, AIM_GETINFO_AWAYMESSAGE); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1680 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1681 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1682 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
|
1683 char *maiden, char *city, char *state, char *country, int web) { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1684 /* 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
|
1685 struct oscar_data *odata = (struct oscar_data *)g->proto_data; |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1686 aim_setdirectoryinfo(odata->sess, odata->conn, first, middle, last, |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1687 maiden, NULL, NULL, city, state, NULL, 0, web); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1688 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1689 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1690 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1691 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
|
1692 struct oscar_data *odata = (struct oscar_data *)g->proto_data; |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1693 aim_bos_setidle(odata->sess, odata->conn, time); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1694 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1695 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1696 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
|
1697 struct oscar_data *odata = (struct oscar_data *)g->proto_data; |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1698 if (awaymessage) |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1699 aim_bos_setprofile(odata->sess, odata->conn, info, |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1700 awaymessage->message, gaim_caps); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1701 else |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1702 aim_bos_setprofile(odata->sess, odata->conn, info, |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1703 NULL, gaim_caps); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1704 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1705 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1706 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
|
1707 struct oscar_data *odata = (struct oscar_data *)g->proto_data; |
1051
713b0e14e0a9
[gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1039
diff
changeset
|
1708 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
|
1709 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1710 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1711 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
|
1712 struct oscar_data *odata = (struct oscar_data *)g->proto_data; |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1713 aim_send_warning(odata->sess, odata->conn, name, anon); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1714 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1715 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1716 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
|
1717 char *maiden, char *city, char *state, char *country, char *email) { |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1718 struct oscar_data *odata = (struct oscar_data *)g->proto_data; |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1719 if (strlen(email)) |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1720 aim_usersearch_address(odata->sess, odata->conn, email); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1721 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1722 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1723 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
|
1724 struct oscar_data *odata = (struct oscar_data *)g->proto_data; |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1725 aim_add_buddy(odata->sess, odata->conn, name); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1726 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1727 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1728 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
|
1729 struct oscar_data *odata = (struct oscar_data *)g->proto_data; |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1730 char buf[MSG_LEN]; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1731 int n = 0; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1732 while (buddies) { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1733 if (n > MSG_LEN - 18) { |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1734 aim_bos_setbuddylist(odata->sess, odata->conn, buf); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1735 n = 0; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1736 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1737 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
|
1738 buddies = buddies->next; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1739 } |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1740 aim_bos_setbuddylist(odata->sess, odata->conn, buf); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1741 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1742 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1743 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
|
1744 struct oscar_data *odata = (struct oscar_data *)g->proto_data; |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1745 aim_remove_buddy(odata->sess, odata->conn, name); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1746 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1747 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1748 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
|
1749 struct oscar_data *odata = (struct oscar_data *)g->proto_data; |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1750 struct aim_conn_t *cur = NULL; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
1751 debug_printf("Attempting to join chat room %s.\n", name); |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1752 if ((cur = aim_getconn_type(odata->sess, AIM_CONN_TYPE_CHATNAV))) { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
1753 debug_printf("chatnav exists, creating room\n"); |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1754 aim_chatnav_createroom(odata->sess, cur, name, exchange); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1755 } else { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1756 /* this gets tricky */ |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
1757 debug_printf("chatnav does not exist, opening chatnav\n"); |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1758 odata->create_exchange = exchange; |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1759 odata->create_name = g_strdup(name); |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1760 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
|
1761 } |
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
857
diff
changeset
|
1762 } |
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
857
diff
changeset
|
1763 |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1764 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
|
1765 struct oscar_data *odata = (struct oscar_data *)g->proto_data; |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1766 GSList *bcs = g->buddy_chats; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1767 struct conversation *b = NULL; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1768 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1769 while (bcs) { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1770 b = (struct conversation *)bcs->data; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1771 if (id == b->id) |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1772 break; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1773 bcs = bcs->next; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1774 b = NULL; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1775 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1776 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1777 if (!b) |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1778 return; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1779 |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1780 aim_chat_invite(odata->sess, odata->conn, name, |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1781 message ? message : "", 0x4, b->name, 0x0); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1782 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1783 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1784 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
|
1785 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
|
1786 GSList *bcs = g->buddy_chats; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1787 struct conversation *b = NULL; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1788 struct chat_connection *c = NULL; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1789 int count = 0; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1790 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1791 while (bcs) { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1792 count++; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1793 b = (struct conversation *)bcs->data; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1794 if (id == b->id) |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1795 break; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1796 bcs = bcs->next; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1797 b = NULL; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1798 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1799 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1800 if (!b) |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1801 return; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1802 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
1803 debug_printf("Attempting to leave room %s (currently in %d rooms)\n", b->name, count); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1804 |
1186
c00fc3adfd66
[gaim-migrate @ 1196]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1161
diff
changeset
|
1805 c = find_oscar_chat(g, b->id); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1806 if (c != NULL) { |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1807 if (odata) |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1808 odata->oscar_chats = g_slist_remove(odata->oscar_chats, c); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1809 gdk_input_remove(c->inpa); |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1810 if (g && odata->sess) |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1811 aim_conn_kill(odata->sess, &c->conn); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1812 g_free(c->name); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1813 g_free(c); |
891
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
857
diff
changeset
|
1814 } |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1815 /* 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
|
1816 serv_got_chat_left(g, b->id); |
891
fa2feef25e1e
[gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
857
diff
changeset
|
1817 } |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1818 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1819 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
|
1820 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
|
1821 "Gaim - Chat"); |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1822 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1823 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1824 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
|
1825 struct oscar_data *odata = (struct oscar_data *)g->proto_data; |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1826 struct aim_conn_t *cn; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1827 GSList *bcs = g->buddy_chats; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1828 struct conversation *b = NULL; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1829 |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1830 while (bcs) { |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1831 b = (struct conversation *)bcs->data; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1832 if (id == b->id) |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1833 break; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1834 bcs = bcs->next; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1835 b = NULL; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1836 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1837 if (!b) |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1838 return; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1839 |
998
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1840 cn = aim_chat_getconn(odata->sess, b->name); |
70c685de2be5
[gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
988
diff
changeset
|
1841 aim_chat_send_im(odata->sess, cn, message); |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1842 } |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1843 |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1844 static char **oscar_list_icon(int uc) { |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1845 if (uc & UC_UNAVAILABLE) |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1846 return (char **)away_icon_xpm; |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1847 if (uc & UC_AOL) |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1848 return (char **)aol_icon_xpm; |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1849 if (uc & UC_NORMAL) |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1850 return (char **)free_icon_xpm; |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1851 if (uc & UC_ADMIN) |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1852 return (char **)admin_icon_xpm; |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1853 if (uc & UC_UNCONFIRMED) |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1854 return (char **)dt_icon_xpm; |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1855 return NULL; |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1856 } |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
1857 |
1032
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1858 static void oscar_info(GtkObject *obj, char *who) { |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1859 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
|
1860 serv_get_info(gc, who); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1861 } |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1862 |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1863 static void oscar_away_msg(GtkObject *obj, char *who) { |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1864 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
|
1865 serv_get_away_msg(gc, who); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1866 } |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1867 |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1868 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
|
1869 va_list ap; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1870 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1871 struct oscar_data *od = (struct oscar_data *)gc->proto_data; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1872 struct aim_directim_priv *priv; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1873 struct aim_conn_t *newconn; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1874 struct direct_im *dim; |
1072
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1064
diff
changeset
|
1875 char buf[256]; |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1876 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1877 va_start(ap, command); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1878 newconn = va_arg(ap, struct aim_conn_t *); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1879 va_end(ap); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1880 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1881 priv = (struct aim_directim_priv *)newconn->priv; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1882 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1883 debug_printf("DirectIM: initiate success to %s\n", priv->sn); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1884 dim = find_direct_im(od, priv->sn); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1885 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1886 dim->cnv = find_conversation(priv->sn); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1887 if (!dim->cnv) dim->cnv = new_conversation(priv->sn); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1888 gtk_signal_connect(GTK_OBJECT(dim->cnv->window), "destroy", |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1889 GTK_SIGNAL_FUNC(delete_direct_im), dim); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1890 gdk_input_remove(dim->watcher); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1891 dim->conn = newconn; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1892 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
|
1893 oscar_callback, dim->conn); |
1072
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1064
diff
changeset
|
1894 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
|
1895 write_to_conv(dim->cnv, buf, WFLAG_SYSTEM, NULL); |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1896 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1897 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
|
1898 gaim_directim_incoming, 0); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1899 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
|
1900 gaim_directim_disconnect, 0); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1901 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
|
1902 gaim_directim_typing, 0); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1903 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1904 return 1; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1905 } |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1906 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1907 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
|
1908 va_list ap; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1909 char *sn = NULL, *msg = NULL; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1910 struct aim_conn_t *conn; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1911 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1912 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1913 va_start(ap, command); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1914 conn = va_arg(ap, struct aim_conn_t *); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1915 sn = va_arg(ap, char *); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1916 msg = va_arg(ap, char *); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1917 va_end(ap); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1918 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1919 debug_printf("Got DirectIM message from %s\n", sn); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1920 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1921 serv_got_im(gc, sn, msg, 0); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1922 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1923 return 1; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1924 } |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1925 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1926 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
|
1927 va_list ap; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1928 struct aim_conn_t *conn; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1929 char *sn; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1930 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1931 struct oscar_data *od = (struct oscar_data *)gc->proto_data; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1932 struct direct_im *dim; |
1072
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1064
diff
changeset
|
1933 char buf[256]; |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1934 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1935 va_start(ap, command); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1936 conn = va_arg(ap, struct aim_conn_t *); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1937 sn = va_arg(ap, char *); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1938 va_end(ap); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1939 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1940 debug_printf("%s disconnected Direct IM.\n", sn); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1941 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1942 dim = find_direct_im(od, sn); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1943 od->direct_ims = g_slist_remove(od->direct_ims, dim); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1944 gdk_input_remove(dim->watcher); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1945 gtk_signal_disconnect_by_data(GTK_OBJECT(dim->cnv->window), dim); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1946 |
1072
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1064
diff
changeset
|
1947 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
|
1948 if (dim->cnv) |
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1064
diff
changeset
|
1949 write_to_conv(dim->cnv, buf, WFLAG_SYSTEM, NULL); |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1950 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1951 aim_conn_kill(sess, &conn); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1952 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1953 return 1; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1954 } |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1955 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1956 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
|
1957 va_list ap; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1958 char *sn; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1959 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1960 va_start(ap, command); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1961 sn = va_arg(ap, char *); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1962 va_end(ap); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1963 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1964 /* 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
|
1965 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
|
1966 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1967 return 1; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1968 } |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1969 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1970 static void oscar_direct_im(GtkObject *obj, char *who) { |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1971 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
|
1972 struct oscar_data *od = (struct oscar_data *)gc->proto_data; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1973 struct direct_im *dim; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1974 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1975 dim = find_direct_im(od, who); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1976 if (dim) { |
1064
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1060
diff
changeset
|
1977 do_error_dialog("Direct IM request already pending.", "Unable"); |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1978 return; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1979 } |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1980 dim = g_new0(struct direct_im, 1); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1981 dim->gc = gc; |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1982 g_snprintf(dim->name, sizeof dim->name, "%s", who); |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1983 |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1984 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
|
1985 if (dim->conn != NULL) { |
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1064
diff
changeset
|
1986 od->direct_ims = g_slist_append(od->direct_ims, dim); |
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1064
diff
changeset
|
1987 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
|
1988 oscar_callback, dim->conn); |
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1064
diff
changeset
|
1989 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
|
1990 gaim_directim_initiate, 0); |
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1064
diff
changeset
|
1991 } else { |
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1064
diff
changeset
|
1992 do_error_dialog(_("Unable to open Direct IM"), _("Error")); |
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1064
diff
changeset
|
1993 g_free(dim); |
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1064
diff
changeset
|
1994 } |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1995 } |
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
1996 |
1032
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1997 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
|
1998 GtkWidget *button; |
1060
2c4f958c596e
[gaim-migrate @ 1070]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1059
diff
changeset
|
1999 char *n = g_strdup(normalize(gc->username)); |
1032
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
2000 |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
2001 button = gtk_menu_item_new_with_label(_("Get Info")); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
2002 gtk_signal_connect(GTK_OBJECT(button), "activate", |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
2003 GTK_SIGNAL_FUNC(oscar_info), who); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
2004 gtk_object_set_user_data(GTK_OBJECT(button), gc); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
2005 gtk_menu_append(GTK_MENU(menu), button); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
2006 gtk_widget_show(button); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
2007 |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
2008 button = gtk_menu_item_new_with_label(_("Get Away Msg")); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
2009 gtk_signal_connect(GTK_OBJECT(button), "activate", |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
2010 GTK_SIGNAL_FUNC(oscar_away_msg), who); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
2011 gtk_object_set_user_data(GTK_OBJECT(button), gc); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
2012 gtk_menu_append(GTK_MENU(menu), button); |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
2013 gtk_widget_show(button); |
1059
6e60c69d4432
[gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1051
diff
changeset
|
2014 |
1060
2c4f958c596e
[gaim-migrate @ 1070]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1059
diff
changeset
|
2015 if (strcmp(n, normalize(who))) { |
2c4f958c596e
[gaim-migrate @ 1070]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1059
diff
changeset
|
2016 button = gtk_menu_item_new_with_label(_("Direct IM")); |
2c4f958c596e
[gaim-migrate @ 1070]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1059
diff
changeset
|
2017 gtk_signal_connect(GTK_OBJECT(button), "activate", |
2c4f958c596e
[gaim-migrate @ 1070]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1059
diff
changeset
|
2018 GTK_SIGNAL_FUNC(oscar_direct_im), who); |
2c4f958c596e
[gaim-migrate @ 1070]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1059
diff
changeset
|
2019 gtk_object_set_user_data(GTK_OBJECT(button), gc); |
2c4f958c596e
[gaim-migrate @ 1070]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1059
diff
changeset
|
2020 gtk_menu_append(GTK_MENU(menu), button); |
2c4f958c596e
[gaim-migrate @ 1070]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1059
diff
changeset
|
2021 gtk_widget_show(button); |
2c4f958c596e
[gaim-migrate @ 1070]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1059
diff
changeset
|
2022 } |
2c4f958c596e
[gaim-migrate @ 1070]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1059
diff
changeset
|
2023 g_free(n); |
1032
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
2024 } |
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
2025 |
1086
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2026 |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2027 /* weeee */ |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2028 static void oscar_print_option(GtkEntry *entry, struct aim_user *user) { |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2029 int entrynum; |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2030 |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2031 entrynum = (int) gtk_object_get_user_data(GTK_OBJECT(entry)); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2032 |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2033 if (entrynum == USEROPT_AUTH) { |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2034 g_snprintf(user->proto_opt[USEROPT_AUTH], |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2035 sizeof(user->proto_opt[USEROPT_AUTH]), |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2036 "%s", gtk_entry_get_text(entry)); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2037 } else if (entrynum == USEROPT_AUTHPORT) { |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2038 g_snprintf(user->proto_opt[USEROPT_AUTHPORT], |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2039 sizeof(user->proto_opt[USEROPT_AUTHPORT]), |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2040 "%s", gtk_entry_get_text(entry)); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2041 } else if (entrynum == USEROPT_SOCKSHOST) { |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2042 g_snprintf(user->proto_opt[USEROPT_SOCKSHOST], |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2043 sizeof(user->proto_opt[USEROPT_SOCKSHOST]), |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2044 "%s", gtk_entry_get_text(entry)); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2045 } else if (entrynum == USEROPT_SOCKSPORT) { |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2046 g_snprintf(user->proto_opt[USEROPT_SOCKSPORT], |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2047 sizeof(user->proto_opt[USEROPT_SOCKSPORT]), |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2048 "%s", gtk_entry_get_text(entry)); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2049 } |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2050 } |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2051 |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2052 static void oscar_user_opts(GtkWidget *book, struct aim_user *user) { |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2053 /* so here, we create the new notebook page */ |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2054 GtkWidget *vbox; |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2055 GtkWidget *hbox; |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2056 GtkWidget *label; |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2057 GtkWidget *entry; |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2058 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
2059 vbox = gtk_vbox_new(FALSE, 5); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
2060 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); |
1086
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2061 gtk_notebook_append_page(GTK_NOTEBOOK(book), vbox, |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2062 gtk_label_new("OSCAR Options")); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2063 gtk_widget_show(vbox); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2064 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
2065 hbox = gtk_hbox_new(FALSE, 5); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
2066 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
1086
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2067 gtk_widget_show(hbox); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2068 |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2069 label = gtk_label_new("Authorizer:"); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
2070 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
1086
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2071 gtk_widget_show(label); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2072 |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2073 entry = gtk_entry_new(); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
2074 gtk_box_pack_end(GTK_BOX(hbox), entry, FALSE, FALSE, 0); |
1086
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2075 gtk_object_set_user_data(GTK_OBJECT(entry), (void *)USEROPT_AUTH); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2076 gtk_signal_connect(GTK_OBJECT(entry), "changed", |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2077 GTK_SIGNAL_FUNC(oscar_print_option), user); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2078 if (user->proto_opt[USEROPT_AUTH][0]) { |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2079 debug_printf("setting text %s\n", user->proto_opt[USEROPT_AUTH]); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2080 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
|
2081 } else |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2082 gtk_entry_set_text(GTK_ENTRY(entry), "login.oscar.aol.com"); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2083 gtk_widget_show(entry); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2084 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
2085 hbox = gtk_hbox_new(FALSE, 5); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
2086 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
1086
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2087 gtk_widget_show(hbox); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2088 |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2089 label = gtk_label_new("Authorizer Port:"); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
2090 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
1086
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2091 gtk_widget_show(label); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2092 |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2093 entry = gtk_entry_new(); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
2094 gtk_box_pack_end(GTK_BOX(hbox), entry, FALSE, FALSE, 0); |
1086
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2095 gtk_object_set_user_data(GTK_OBJECT(entry), (void *)1); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2096 gtk_signal_connect(GTK_OBJECT(entry), "changed", |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2097 GTK_SIGNAL_FUNC(oscar_print_option), user); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2098 if (user->proto_opt[USEROPT_AUTHPORT][0]) { |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2099 debug_printf("setting text %s\n", user->proto_opt[USEROPT_AUTHPORT]); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2100 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
|
2101 } else |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2102 gtk_entry_set_text(GTK_ENTRY(entry), "5190"); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2103 gtk_widget_show(entry); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2104 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
2105 hbox = gtk_hbox_new(FALSE, 5); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
2106 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
1086
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2107 gtk_widget_show(hbox); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2108 |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2109 label = gtk_label_new("SOCKS5 Host:"); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
2110 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
1086
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2111 gtk_widget_show(label); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2112 |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2113 entry = gtk_entry_new(); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
2114 gtk_box_pack_end(GTK_BOX(hbox), entry, FALSE, FALSE, 0); |
1086
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2115 gtk_object_set_user_data(GTK_OBJECT(entry), (void *)USEROPT_SOCKSHOST); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2116 gtk_signal_connect(GTK_OBJECT(entry), "changed", |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2117 GTK_SIGNAL_FUNC(oscar_print_option), user); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2118 if (user->proto_opt[USEROPT_SOCKSHOST][0]) { |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2119 debug_printf("setting text %s\n", user->proto_opt[USEROPT_SOCKSHOST]); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2120 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
|
2121 } |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2122 gtk_widget_show(entry); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2123 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
2124 hbox = gtk_hbox_new(FALSE, 5); |
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
2125 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
1086
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2126 gtk_widget_show(hbox); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2127 |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2128 label = gtk_label_new("SOCKS5 Port:"); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
2129 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
1086
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2130 gtk_widget_show(label); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2131 |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2132 entry = gtk_entry_new(); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1247
diff
changeset
|
2133 gtk_box_pack_end(GTK_BOX(hbox), entry, FALSE, FALSE, 0); |
1086
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2134 gtk_object_set_user_data(GTK_OBJECT(entry), (void *)USEROPT_SOCKSPORT); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2135 gtk_signal_connect(GTK_OBJECT(entry), "changed", |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2136 GTK_SIGNAL_FUNC(oscar_print_option), user); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2137 if (user->proto_opt[USEROPT_SOCKSPORT][0]) { |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2138 debug_printf("setting text %s\n", user->proto_opt[USEROPT_SOCKSPORT]); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2139 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
|
2140 } |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2141 gtk_widget_show(entry); |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2142 } |
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2143 |
1147
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2144 static void oscar_add_permit(struct gaim_connection *gc, char *who) { |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2145 struct oscar_data *od = (struct oscar_data *)gc->proto_data; |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2146 if (gc->permdeny != 3) return; |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2147 aim_bos_changevisibility(od->sess, od->conn, AIM_VISIBILITYCHANGE_PERMITADD, who); |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2148 } |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2149 |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2150 static void oscar_add_deny(struct gaim_connection *gc, char *who) { |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2151 struct oscar_data *od = (struct oscar_data *)gc->proto_data; |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2152 if (gc->permdeny != 4) return; |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2153 aim_bos_changevisibility(od->sess, od->conn, AIM_VISIBILITYCHANGE_DENYADD, who); |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2154 } |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2155 |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2156 static void oscar_rem_permit(struct gaim_connection *gc, char *who) { |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2157 struct oscar_data *od = (struct oscar_data *)gc->proto_data; |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2158 if (gc->permdeny != 3) return; |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2159 aim_bos_changevisibility(od->sess, od->conn, AIM_VISIBILITYCHANGE_PERMITREMOVE, who); |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2160 } |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2161 |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2162 static void oscar_rem_deny(struct gaim_connection *gc, char *who) { |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2163 struct oscar_data *od = (struct oscar_data *)gc->proto_data; |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2164 if (gc->permdeny != 4) return; |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2165 aim_bos_changevisibility(od->sess, od->conn, AIM_VISIBILITYCHANGE_DENYREMOVE, who); |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2166 } |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2167 |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2168 static void oscar_set_permit_deny(struct gaim_connection *gc) { |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2169 struct oscar_data *od = (struct oscar_data *)gc->proto_data; |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2170 GSList *list; |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2171 char buf[MAXMSGLEN]; |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2172 int at; |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2173 |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2174 switch(gc->permdeny) { |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2175 case 1: |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2176 aim_bos_changevisibility(od->sess, od->conn, AIM_VISIBILITYCHANGE_DENYADD, gc->username); |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2177 break; |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2178 case 2: |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2179 aim_bos_changevisibility(od->sess, od->conn, AIM_VISIBILITYCHANGE_PERMITADD, gc->username); |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2180 break; |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2181 case 3: |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2182 list = gc->permit; |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2183 at = g_snprintf(buf, sizeof(buf), "%s", gc->username); |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2184 while (list) { |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2185 at += g_snprintf(buf + at, sizeof(buf) - at, "&%s", (char *)list->data); |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2186 list = list->next; |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2187 } |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2188 aim_bos_changevisibility(od->sess, od->conn, AIM_VISIBILITYCHANGE_PERMITADD, buf); |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2189 break; |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2190 case 4: |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2191 list = gc->deny; |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2192 at = g_snprintf(buf, sizeof(buf), "%s", gc->username); |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2193 while (list) { |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2194 at += g_snprintf(buf + at, sizeof(buf) - at, "&%s", (char *)list->data); |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2195 list = list->next; |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2196 } |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2197 aim_bos_changevisibility(od->sess, od->conn, AIM_VISIBILITYCHANGE_DENYADD, buf); |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2198 break; |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2199 default: |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2200 break; |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2201 } |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2202 } |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2203 |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
2204 void oscar_init(struct prpl *ret) { |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
2205 ret->protocol = PROTO_OSCAR; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
2206 ret->name = oscar_name; |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1020
diff
changeset
|
2207 ret->list_icon = oscar_list_icon; |
1032
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
2208 ret->action_menu = oscar_action_menu; |
1086
ce201056e7a6
[gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1082
diff
changeset
|
2209 ret->user_opts = oscar_user_opts; |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
2210 ret->login = oscar_login; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
2211 ret->close = oscar_close; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
2212 ret->send_im = oscar_send_im; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
2213 ret->set_info = oscar_set_info; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
2214 ret->get_info = oscar_get_info; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
2215 ret->set_away = oscar_set_away; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
2216 ret->get_away_msg = oscar_get_away_msg; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
2217 ret->set_dir = oscar_set_dir; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
2218 ret->get_dir = NULL; /* Oscar really doesn't have this */ |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
2219 ret->dir_search = oscar_dir_search; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
2220 ret->set_idle = oscar_set_idle; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
2221 ret->change_passwd = NULL; /* Oscar doesn't have this either */ |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
2222 ret->add_buddy = oscar_add_buddy; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
2223 ret->add_buddies = oscar_add_buddies; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
2224 ret->remove_buddy = oscar_remove_buddy; |
1147
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2225 ret->add_permit = oscar_add_permit; |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2226 ret->add_deny = oscar_add_deny; |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2227 ret->rem_permit = oscar_rem_permit; |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2228 ret->rem_deny = oscar_rem_deny; |
65e0608e19f7
[gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1114
diff
changeset
|
2229 ret->set_permit_deny = oscar_set_permit_deny; |
981
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
2230 ret->warn = oscar_warn; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
2231 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
|
2232 ret->join_chat = oscar_join_chat; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
2233 ret->chat_invite = oscar_chat_invite; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
2234 ret->chat_leave = oscar_chat_leave; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
2235 ret->chat_whisper = oscar_chat_whisper; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
2236 ret->chat_send = oscar_chat_send; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
2237 ret->keepalive = oscar_keepalive; |
7e231bc0018a
[gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
2238 } |