annotate src/oscar.c @ 1828:643872269616

[gaim-migrate @ 1838] i don't know if this matters committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 09 May 2001 05:24:50 +0000
parents bb115612a2ed
children 086213e7fb73
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1 /*
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2 * gaim
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
4 * Some code copyright (C) 1998-1999, Mark Spencer <markster@marko.net>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
5 * libfaim code copyright 1998, 1999 Adam Fritzler <afritz@auk.cx>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
6 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
7 * This program is free software; you can redistribute it and/or modify
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
8 * it under the terms of the GNU General Public License as published by
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
9 * the Free Software Foundation; either version 2 of the License, or
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
10 * (at your option) any later version.
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
11 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
15 * GNU General Public License for more details.
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
16 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
17 * You should have received a copy of the GNU General Public License
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
18 * along with this program; if not, write to the Free Software
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
20 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
21 */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
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
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
27
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
28 #include <netdb.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
29 #include <gtk/gtk.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
30 #include <unistd.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
31 #include <errno.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
32 #include <netinet/in.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
33 #include <arpa/inet.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
34 #include <string.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
35 #include <stdlib.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
36 #include <stdio.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
37 #include <time.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
38 #include <sys/socket.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
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
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
42 #include "gaim.h"
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
43 #include "aim.h"
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
44
1815
f15d449b3167 [gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1810
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
1384
847b5e39a552 [gaim-migrate @ 1394]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1383
diff changeset
58 int gaim_caps = AIM_CAPS_CHAT | AIM_CAPS_GETFILE | AIM_CAPS_IMIMAGE;
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
59
1807
ba8f463744c0 [gaim-migrate @ 1817]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1806
diff changeset
60 static GtkWidget *join_chat_spin = NULL;
ba8f463744c0 [gaim-migrate @ 1817]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1806
diff changeset
61 static GtkWidget *join_chat_entry = NULL;
1806
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
62
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
63 struct oscar_data {
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
64 struct aim_session_t *sess;
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
65 struct aim_conn_t *conn;
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
66
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
67 guint cnpa;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
68 guint paspa;
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
69
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
70 int create_exchange;
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
71 char *create_name;
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
72
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
73 gboolean conf;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
74 gboolean reqemail;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
75 gboolean chpass;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
76 char *oldp;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
77 char *newp;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
78
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
79 GSList *oscar_chats;
1059
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
80 GSList *direct_ims;
1156
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
81 GSList *getfiles;
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
82 };
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
83
1106
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1100
diff changeset
84 struct chat_connection {
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1100
diff changeset
85 char *name;
1186
c00fc3adfd66 [gaim-migrate @ 1196]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1161
diff changeset
86 int exchange;
1106
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1100
diff changeset
87 int fd; /* this is redundant since we have the conn below */
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1100
diff changeset
88 struct aim_conn_t *conn;
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1100
diff changeset
89 int inpa;
1186
c00fc3adfd66 [gaim-migrate @ 1196]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1161
diff changeset
90 int id;
1106
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1100
diff changeset
91 };
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1100
diff changeset
92
1059
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
93 struct direct_im {
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
94 struct gaim_connection *gc;
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
95 char name[80];
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
96 struct conversation *cnv;
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
97 int watcher;
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
98 struct aim_conn_t *conn;
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
99 };
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
100
1064
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
101 struct ask_direct {
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
102 struct gaim_connection *gc;
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
103 char *sn;
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
104 struct aim_directim_priv *priv;
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
105 };
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
106
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
107 struct ask_getfile {
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
108 struct gaim_connection *gc;
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
109 char *sn;
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
110 char *cookie;
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
111 char *ip;
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
112 };
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
113
1156
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
114 struct getfile_transfer {
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
115 struct gaim_connection *gc;
1161
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
116 char *receiver;
1156
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
117 char *filename;
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
118 struct aim_conn_t *conn;
1161
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
119 struct aim_fileheader_t *fh;
1156
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
120 int gip;
1161
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
121 int gop;
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
122 FILE *listing;
1156
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
123 FILE *file;
1161
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
124 GtkWidget *window;
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
125 GtkWidget *meter;
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
126 GtkWidget *label;
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
127 long pos;
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
128 long size;
1156
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
129 };
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
130
1059
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
131 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
132 GSList *d = od->direct_ims;
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
133 char *n = g_strdup(normalize(who));
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
134 struct direct_im *m = NULL;
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 while (d) {
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
137 m = (struct direct_im *)d->data;
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
138 if (!strcmp(n, normalize(m->name)))
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
139 break;
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
140 m = NULL;
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
141 d = d->next;
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
142 }
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
143
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
144 g_free(n);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
145 return m;
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
146 }
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
147
1815
f15d449b3167 [gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1810
diff changeset
148 /*
1156
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
149 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
150 GSList *g = od->getfiles;
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
151 struct getfile_transfer *n = NULL;
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
152
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
153 while (g) {
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
154 n = (struct getfile_transfer *)g->data;
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
155 if (n->conn == conn)
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
156 return n;
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
157 n = NULL;
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
158 g = g->next;
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
159 }
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
160
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
161 return n;
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
162 }
1815
f15d449b3167 [gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1810
diff changeset
163 */
1156
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
164
1186
c00fc3adfd66 [gaim-migrate @ 1196]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1161
diff changeset
165 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
166 GSList *g = ((struct oscar_data *)gc->proto_data)->oscar_chats;
312
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
167 struct chat_connection *c = NULL;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
168 if (gc->protocol != PROTO_OSCAR) return NULL;
312
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 while (g) {
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
171 c = (struct chat_connection *)g->data;
1186
c00fc3adfd66 [gaim-migrate @ 1196]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1161
diff changeset
172 if (c->id == id)
312
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
173 break;
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
174 g = g->next;
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
175 c = NULL;
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
176 }
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
177
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
178 return c;
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
179 }
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
180
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
181 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
182 struct aim_conn_t *conn) {
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
183 GSList *g = ((struct oscar_data *)gc->proto_data)->oscar_chats;
833
8d8ef8c3afe2 [gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
184 struct chat_connection *c = NULL;
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 while (g) {
8d8ef8c3afe2 [gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
187 c = (struct chat_connection *)g->data;
8d8ef8c3afe2 [gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
188 if (c->conn == conn)
8d8ef8c3afe2 [gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
189 break;
8d8ef8c3afe2 [gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
190 g = g->next;
8d8ef8c3afe2 [gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
191 c = NULL;
8d8ef8c3afe2 [gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
192 }
8d8ef8c3afe2 [gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
193
8d8ef8c3afe2 [gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
194 return c;
8d8ef8c3afe2 [gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
195 }
8d8ef8c3afe2 [gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
196
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
197 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
198 GSList *g = connections;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
199 struct gaim_connection *c = NULL;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
200 struct aim_conn_t *s;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
201 while (g) {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
202 c = (struct gaim_connection *)g->data;
965
50f2977537d8 [gaim-migrate @ 975]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 964
diff changeset
203 if (c->protocol != PROTO_OSCAR) {
50f2977537d8 [gaim-migrate @ 975]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 964
diff changeset
204 c = NULL;
50f2977537d8 [gaim-migrate @ 975]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 964
diff changeset
205 g = g->next;
50f2977537d8 [gaim-migrate @ 975]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 964
diff changeset
206 continue;
50f2977537d8 [gaim-migrate @ 975]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 964
diff changeset
207 }
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
208 s = ((struct oscar_data *)c->proto_data)->sess->connlist;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
209 while (s) {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
210 if (conn == s)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
211 break;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
212 s = s->next;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
213 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
214 if (s) break;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
215 g = g->next;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
216 c = NULL;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
217 }
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 return c;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
220 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
221
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
222 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
223 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
224 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
225 static int gaim_handle_redirect (struct aim_session_t *, struct command_rx_struct *, ...);
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
226 static int gaim_info_change (struct aim_session_t *, struct command_rx_struct *, ...);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
227 static int gaim_account_confirm (struct aim_session_t *, struct command_rx_struct *, ...);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
228 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
229 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
230 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
231 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
232 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
233 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
234 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
235 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
236 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
237 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
238 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
239 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
240 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
241 static int gaim_parse_evilnotify (struct aim_session_t *, struct command_rx_struct *, ...);
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
242 static int gaim_parse_searcherror(struct aim_session_t *, struct command_rx_struct *, ...);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
243 static int gaim_parse_searchreply(struct aim_session_t *, struct command_rx_struct *, ...);
829
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
244 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
245 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
246 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
247 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
248 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
249 static int gaim_parse_locerr (struct aim_session_t *, struct command_rx_struct *, ...);
1302
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
250 static int gaim_parse_genericerr (struct aim_session_t *, struct command_rx_struct *, ...);
1746
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
251 static int gaim_memrequest (struct aim_session_t *, struct command_rx_struct *, ...);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
252
1059
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
253 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
254 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
255 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
256 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
257
836
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
258 static char *msgerrreason[] = {
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
259 "Invalid error",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
260 "Invalid SNAC",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
261 "Rate to host",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
262 "Rate to client",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
263 "Not logged in",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
264 "Service unavailable",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
265 "Service not defined",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
266 "Obsolete SNAC",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
267 "Not supported by host",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
268 "Not supported by client",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
269 "Refused by client",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
270 "Reply too big",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
271 "Responses lost",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
272 "Request denied",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
273 "Busted SNAC payload",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
274 "Insufficient rights",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
275 "In local permit/deny",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
276 "Too evil (sender)",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
277 "Too evil (receiver)",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
278 "User temporarily unavailable",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
279 "No match",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
280 "List overflow",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
281 "Request ambiguous",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
282 "Queue full",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
283 "Not while on AOL"
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
284 };
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
285 static int msgerrreasonlen = 25;
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
286
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
287 static void oscar_callback(gpointer data, gint source,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
288 GdkInputCondition condition) {
288
6e609d42f767 [gaim-migrate @ 298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 283
diff changeset
289 struct aim_conn_t *conn = (struct aim_conn_t *)data;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
290 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
291 struct oscar_data *odata = (struct oscar_data *)gc->proto_data;
1149
22bf2c3ec2e3 [gaim-migrate @ 1159]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1148
diff changeset
292 if (!g_slist_find(connections, gc)) {
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
293 /* 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
294 * is return? */
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
295 debug_printf("oscar callback for closed connection.\n");
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
296 return;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
297 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
298
259
e159ba2486fc [gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 253
diff changeset
299 if (condition & GDK_INPUT_EXCEPTION) {
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 981
diff changeset
300 hide_login_progress(gc, _("Disconnected."));
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
301 signoff(gc);
259
e159ba2486fc [gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 253
diff changeset
302 return;
e159ba2486fc [gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 253
diff changeset
303 }
e159ba2486fc [gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 253
diff changeset
304 if (condition & GDK_INPUT_READ) {
503
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
305 if (conn->type == AIM_CONN_TYPE_RENDEZVOUS_OUT) {
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
306 debug_printf("got information on rendezvous\n");
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
307 if (aim_handlerendconnect(odata->sess, conn) < 0) {
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
308 debug_printf(_("connection error (rend)\n"));
503
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
309 }
259
e159ba2486fc [gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 253
diff changeset
310 } else {
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
311 if (aim_get_command(odata->sess, conn) >= 0) {
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
312 aim_rxdispatch(odata->sess);
503
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
313 } else {
1002
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1000
diff changeset
314 if ((conn->type == AIM_CONN_TYPE_BOS) ||
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
315 !(aim_getconn_type(odata->sess, AIM_CONN_TYPE_BOS))) {
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
316 debug_printf(_("major connection error\n"));
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 981
diff changeset
317 hide_login_progress(gc, _("Disconnected."));
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
318 signoff(gc);
747
eec93c5929b9 [gaim-migrate @ 757]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 746
diff changeset
319 } else if (conn->type == AIM_CONN_TYPE_CHAT) {
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
320 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
321 char buf[BUF_LONG];
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
322 debug_printf("disconnected from chat room %s\n", c->name);
833
8d8ef8c3afe2 [gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
323 c->conn = NULL;
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
324 if (c->inpa > 0)
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
325 gdk_input_remove(c->inpa);
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
326 c->inpa = 0;
833
8d8ef8c3afe2 [gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
327 c->fd = -1;
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
328 aim_conn_kill(odata->sess, &conn);
833
8d8ef8c3afe2 [gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
329 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
330 do_error_dialog(buf, _("Chat Error!"));
828
4c71c0e7f04e [gaim-migrate @ 838]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 812
diff changeset
331 } else if (conn->type == AIM_CONN_TYPE_CHATNAV) {
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
332 if (odata->cnpa > 0)
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
333 gdk_input_remove(odata->cnpa);
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
334 odata->cnpa = 0;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
335 debug_printf("removing chatnav input watcher\n");
1576
992871bf2649 [gaim-migrate @ 1586]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1537
diff changeset
336 if (odata->create_exchange) {
992871bf2649 [gaim-migrate @ 1586]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1537
diff changeset
337 odata->create_exchange = 0;
992871bf2649 [gaim-migrate @ 1586]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1537
diff changeset
338 g_free(odata->create_name);
992871bf2649 [gaim-migrate @ 1586]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1537
diff changeset
339 odata->create_name = NULL;
992871bf2649 [gaim-migrate @ 1586]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1537
diff changeset
340 do_error_dialog(_("Chat is currently unavailable"),
992871bf2649 [gaim-migrate @ 1586]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1537
diff changeset
341 _("Gaim - Chat"));
992871bf2649 [gaim-migrate @ 1586]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1537
diff changeset
342 }
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
343 aim_conn_kill(odata->sess, &conn);
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
344 } else if (conn->type == AIM_CONN_TYPE_AUTH) {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
345 if (odata->paspa > 0)
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
346 gdk_input_remove(odata->paspa);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
347 odata->paspa = 0;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
348 debug_printf("removing authconn input watcher\n");
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
349 aim_conn_kill(odata->sess, &conn);
1156
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
350 } else if (conn->type == AIM_CONN_TYPE_RENDEZVOUS) {
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
351 debug_printf("No handler for rendezvous disconnect (%d).\n",
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
352 source);
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
353 aim_conn_kill(odata->sess, &conn);
695
d3db515e9a6e [gaim-migrate @ 705]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 694
diff changeset
354 } else {
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
355 debug_printf("holy crap! generic connection error! %d\n",
794
80274f969a09 [gaim-migrate @ 804]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 788
diff changeset
356 conn->type);
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
357 aim_conn_kill(odata->sess, &conn);
503
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
358 }
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
359 }
259
e159ba2486fc [gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 253
diff changeset
360 }
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
361 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
362 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
363
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
364 static void oscar_debug(struct aim_session_t *sess, int level, const char *format, va_list va) {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
365 char *s = g_strdup_vprintf(format, va);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
366 char buf[256];
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
367 char *t;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
368 struct gaim_connection *gc = sess->aux_data;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
369
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
370 g_snprintf(buf, sizeof(buf), "%s %d: ", gc->username, level);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
371 t = g_strconcat(buf, s, NULL);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
372 debug_printf(t);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
373 if (t[strlen(t)-1] != '\n')
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
374 debug_printf("\n");
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
375 g_free(t);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
376 g_free(s);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
377 }
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
378
980
82c5865f7cfe [gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 975
diff changeset
379 void oscar_login(struct aim_user *user) {
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
380 struct aim_session_t *sess;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
381 struct aim_conn_t *conn;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
382 char buf[256];
1086
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
383 char *finalauth = NULL;
1089
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
384 struct gaim_connection *gc = new_gaim_conn(user);
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
385 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
386 odata->create_exchange = 0;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
387
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
388 debug_printf(_("Logging in %s\n"), user->username);
302
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
389
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
390 sess = g_new0(struct aim_session_t, 1);
1086
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
391
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
392 aim_session_init(sess, AIM_SESS_FLAGS_NONBLOCKCONNECT, 0);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
393 aim_setdebuggingcb(sess, oscar_debug);
1086
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
394
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
395 if (user->proto_opt[USEROPT_SOCKSHOST][0]) {
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
396 char *finalproxy;
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
397 if (user->proto_opt[USEROPT_SOCKSPORT][0])
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
398 finalproxy = g_strconcat(user->proto_opt[USEROPT_SOCKSHOST], ":",
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
399 user->proto_opt[USEROPT_SOCKSPORT], NULL);
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
400 else
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
401 finalproxy = g_strdup(user->proto_opt[USEROPT_SOCKSHOST]);
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
402 aim_setupproxy(sess, finalproxy, NULL, NULL);
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
403 g_free(finalproxy);
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
404 }
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
405
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
406 if (user->proto_opt[USEROPT_AUTH][0]) {
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
407 if (user->proto_opt[USEROPT_AUTHPORT][0])
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
408 finalauth = g_strconcat(user->proto_opt[USEROPT_AUTH], ":",
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
409 user->proto_opt[USEROPT_AUTHPORT], NULL);
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
410 else
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
411 finalauth = g_strdup(user->proto_opt[USEROPT_AUTH]);
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
412 }
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
413
279
501e09c51cbc [gaim-migrate @ 289]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 277
diff changeset
414 /* 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
415 * see if things need to be sent. */
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
416 aim_tx_setenqueue(sess, AIM_TX_IMMEDIATE, NULL);
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
417 odata->sess = sess;
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
418 sess->aux_data = gc;
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
419
1086
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
420 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
421
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
422 if (finalauth)
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
423 g_free(finalauth);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
424
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
425 if (conn == NULL) {
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
426 debug_printf(_("internal connection error\n"));
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 981
diff changeset
427 hide_login_progress(gc, _("Unable to login to AIM"));
1106
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1100
diff changeset
428 signoff(gc);
980
82c5865f7cfe [gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 975
diff changeset
429 return;
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
430 } else if (conn->fd == -1) {
975
a45991891aba [gaim-migrate @ 985]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 971
diff changeset
431 if (conn->status & AIM_CONN_STATUS_RESOLVERR) {
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
432 char *crh = _("couldn't resolve host");
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
433 debug_printf("%s\n", crh);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
434 hide_login_progress(gc, crh);
975
a45991891aba [gaim-migrate @ 985]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 971
diff changeset
435 } else if (conn->status & AIM_CONN_STATUS_CONNERR) {
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
436 char *cch = _("couldn't connect to host");
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
437 debug_printf("%s\n", cch);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
438 hide_login_progress(gc, cch);
975
a45991891aba [gaim-migrate @ 985]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 971
diff changeset
439 }
1106
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1100
diff changeset
440 signoff(gc);
980
82c5865f7cfe [gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 975
diff changeset
441 return;
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
442 }
980
82c5865f7cfe [gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 975
diff changeset
443 g_snprintf(buf, sizeof(buf), _("Signon: %s"), gc->username);
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 981
diff changeset
444 set_login_progress(gc, 2, buf);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
445
741
58a6e6e26695 [gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 736
diff changeset
446 aim_conn_addhandler(sess, conn, 0x0017, 0x0007, gaim_parse_login, 0);
58a6e6e26695 [gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 736
diff changeset
447 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
448 aim_request_login(sess, conn, gc->username);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
449
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
450 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
451 oscar_callback, conn);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
452
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
453 debug_printf(_("Password sent, waiting for response\n"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
454 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
455
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
456 void oscar_close(struct gaim_connection *gc) {
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
457 struct oscar_data *odata = (struct oscar_data *)gc->proto_data;
1015
c3579d03a0c1 [gaim-migrate @ 1025]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
458 GSList *c = odata->oscar_chats;
c3579d03a0c1 [gaim-migrate @ 1025]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
459 struct chat_connection *n;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
460 if (gc->protocol != PROTO_OSCAR) return;
1015
c3579d03a0c1 [gaim-migrate @ 1025]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
461
c3579d03a0c1 [gaim-migrate @ 1025]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
462 while (c) {
c3579d03a0c1 [gaim-migrate @ 1025]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
463 n = (struct chat_connection *)c->data;
1667
b5635d882116 [gaim-migrate @ 1677]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1656
diff changeset
464 if (n->inpa > 0)
b5635d882116 [gaim-migrate @ 1677]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1656
diff changeset
465 gdk_input_remove(n->inpa);
1015
c3579d03a0c1 [gaim-migrate @ 1025]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
466 g_free(n->name);
1016
661ac77ccd1b [gaim-migrate @ 1026]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1015
diff changeset
467 c = g_slist_remove(c, n);
1015
c3579d03a0c1 [gaim-migrate @ 1025]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
468 g_free(n);
c3579d03a0c1 [gaim-migrate @ 1025]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
469 }
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
470 if (gc->inpa > 0)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
471 gdk_input_remove(gc->inpa);
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
472 if (odata->cnpa > 0)
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
473 gdk_input_remove(odata->cnpa);
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
474 if (odata->paspa > 0)
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
475 gdk_input_remove(odata->paspa);
1649
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents: 1643
diff changeset
476 aim_session_kill(odata->sess);
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
477 g_free(odata->sess);
1633
f47f75819e8c [gaim-migrate @ 1643]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1629
diff changeset
478 odata->sess = NULL;
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
479 g_free(gc->proto_data);
1633
f47f75819e8c [gaim-migrate @ 1643]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1629
diff changeset
480 gc->proto_data = NULL;
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
481 debug_printf(_("Signed off.\n"));
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
482 }
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
483
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
484 int gaim_parse_auth_resp(struct aim_session_t *sess,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
485 struct command_rx_struct *command, ...) {
1245
2ac6ccb94229 [gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
486 va_list ap;
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
487 struct aim_conn_t *bosconn = NULL;
1245
2ac6ccb94229 [gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
488 char *sn = NULL, *bosip = NULL, *errurl = NULL, *email = NULL;
2ac6ccb94229 [gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
489 unsigned char *cookie = NULL;
2ac6ccb94229 [gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
490 int errorcode = 0, regstatus = 0;
1247
f50146ce818e [gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1246
diff changeset
491 int latestbuild = 0, latestbetabuild = 0;
f50146ce818e [gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1246
diff changeset
492 char *latestrelease = NULL, *latestbeta = NULL;
f50146ce818e [gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1246
diff changeset
493 char *latestreleaseurl = NULL, *latestbetaurl = NULL;
f50146ce818e [gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1246
diff changeset
494 char *latestreleaseinfo = NULL, *latestbetainfo = NULL;
1245
2ac6ccb94229 [gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
495
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
496 struct gaim_connection *gc = sess->aux_data;
1245
2ac6ccb94229 [gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
497
2ac6ccb94229 [gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
498 va_start(ap, command);
2ac6ccb94229 [gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
499 sn = va_arg(ap, char *);
2ac6ccb94229 [gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
500 errorcode = va_arg(ap, int);
2ac6ccb94229 [gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
501 errurl = va_arg(ap, char *);
2ac6ccb94229 [gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
502 regstatus = va_arg(ap, int);
2ac6ccb94229 [gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
503 email = va_arg(ap, char *);
2ac6ccb94229 [gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
504 bosip = va_arg(ap, char *);
2ac6ccb94229 [gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
505 cookie = va_arg(ap, unsigned char *);
1247
f50146ce818e [gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1246
diff changeset
506
f50146ce818e [gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1246
diff changeset
507 latestrelease = va_arg(ap, char *);
f50146ce818e [gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1246
diff changeset
508 latestbuild = va_arg(ap, int);
f50146ce818e [gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1246
diff changeset
509 latestreleaseurl = va_arg(ap, char *);
f50146ce818e [gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1246
diff changeset
510 latestreleaseinfo = va_arg(ap, char *);
f50146ce818e [gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1246
diff changeset
511
f50146ce818e [gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1246
diff changeset
512 latestbeta = va_arg(ap, char *);
f50146ce818e [gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1246
diff changeset
513 latestbetabuild = va_arg(ap, int);
f50146ce818e [gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1246
diff changeset
514 latestbetaurl = va_arg(ap, char *);
f50146ce818e [gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1246
diff changeset
515 latestbetainfo = va_arg(ap, char *);
f50146ce818e [gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1246
diff changeset
516
1245
2ac6ccb94229 [gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
517 va_end(ap);
2ac6ccb94229 [gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
518
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
519 debug_printf("inside auth_resp (Screen name: %s)\n", sn);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
520
1245
2ac6ccb94229 [gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
521 if (errorcode || !bosip || !cookie) {
2ac6ccb94229 [gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
522 switch (errorcode) {
302
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
523 case 0x18:
392
df5127560034 [gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 388
diff changeset
524 /* connecting too frequently */
1038
daad2440a642 [gaim-migrate @ 1048]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1032
diff changeset
525 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
526 plugin_event(event_error, (void *)983, 0, 0, 0);
302
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
527 break;
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
528 case 0x05:
392
df5127560034 [gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 388
diff changeset
529 /* Incorrect nick/password */
1038
daad2440a642 [gaim-migrate @ 1048]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1032
diff changeset
530 hide_login_progress(gc, _("Incorrect nickname or password."));
1000
91b7377e7b45 [gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
531 plugin_event(event_error, (void *)980, 0, 0, 0);
302
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
532 break;
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
533 case 0x1c:
392
df5127560034 [gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 388
diff changeset
534 /* client too old */
1710
f42ce672c560 [gaim-migrate @ 1720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1667
diff changeset
535 hide_login_progress(gc, _("The client version you are using is too old. Please upgrade at " WEBSITE));
1000
91b7377e7b45 [gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
536 plugin_event(event_error, (void *)989, 0, 0, 0);
302
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
537 break;
1038
daad2440a642 [gaim-migrate @ 1048]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1032
diff changeset
538 default:
daad2440a642 [gaim-migrate @ 1048]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1032
diff changeset
539 hide_login_progress(gc, _("Authentication Failed"));
daad2440a642 [gaim-migrate @ 1048]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1032
diff changeset
540 break;
302
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
541 }
1245
2ac6ccb94229 [gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
542 debug_printf("Login Error Code 0x%04x\n", errorcode);
2ac6ccb94229 [gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
543 debug_printf("Error URL: %s\n", errurl);
1593
ec31e23aadc7 [gaim-migrate @ 1603]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1582
diff changeset
544 aim_conn_kill(sess, &command->conn);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
545 signoff(gc);
1796
5728118a8d4c [gaim-migrate @ 1806]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1764
diff changeset
546 return -1;
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
547 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
548
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
549
1247
f50146ce818e [gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1246
diff changeset
550 debug_printf("Reg status: %2d\n", regstatus);
1245
2ac6ccb94229 [gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
551 if (email) {
2ac6ccb94229 [gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
552 debug_printf("Email: %s\n", email);
946
acd4d81f2afc [gaim-migrate @ 956]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 930
diff changeset
553 } else {
1245
2ac6ccb94229 [gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
554 debug_printf("Email is NULL\n");
946
acd4d81f2afc [gaim-migrate @ 956]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 930
diff changeset
555 }
1247
f50146ce818e [gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1246
diff changeset
556 debug_printf("BOSIP: %s\n", bosip);
f50146ce818e [gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1246
diff changeset
557 if (latestbeta)
f50146ce818e [gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1246
diff changeset
558 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
559 latestbeta, latestbetabuild, latestbetaurl, latestbetainfo);
f50146ce818e [gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1246
diff changeset
560 if (latestrelease)
f50146ce818e [gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1246
diff changeset
561 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
562 latestrelease, latestbuild, latestreleaseurl, latestreleaseinfo);
f50146ce818e [gaim-migrate @ 1257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1246
diff changeset
563 debug_printf("Closing auth connection...\n");
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
564 gdk_input_remove(gc->inpa);
338
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 335
diff changeset
565 aim_conn_kill(sess, &command->conn);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
566
1245
2ac6ccb94229 [gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
567 bosconn = aim_newconn(sess, AIM_CONN_TYPE_BOS, bosip);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
568 if (bosconn == NULL) {
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 981
diff changeset
569 hide_login_progress(gc, _("Internal Error"));
1106
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1100
diff changeset
570 signoff(gc);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
571 return -1;
1081
efcacae6acdb [gaim-migrate @ 1091]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1072
diff changeset
572 } else if (bosconn->status & AIM_CONN_STATUS_CONNERR) {
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 981
diff changeset
573 hide_login_progress(gc, _("Could Not Connect"));
1106
5bc8fdacd2cb [gaim-migrate @ 1116]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1100
diff changeset
574 signoff(gc);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
575 return -1;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
576 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
577
829
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
578 aim_conn_addhandler(sess, bosconn, 0x0009, 0x0003, gaim_bosrights, 0);
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
579 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
580 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
581 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
582 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
583 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
584 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
585 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
586 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
587 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
588 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
589 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
590 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
591 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
592 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_GEN, AIM_CB_GEN_EVIL, gaim_parse_evilnotify, 0);
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
593 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_LOK, AIM_CB_LOK_ERROR, gaim_parse_searcherror, 0);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
594 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_LOK, 0x0003, gaim_parse_searchreply, 0);
836
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
595 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
596 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
597 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_MSG, AIM_CB_MSG_ACK, gaim_parse_msgack, 0);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
598 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_GEN, AIM_CB_GEN_MOTD, gaim_parse_motd, 0);
1302
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
599 aim_conn_addhandler(sess, bosconn, 0x0001, 0x0001, gaim_parse_genericerr, 0);
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
600 aim_conn_addhandler(sess, bosconn, 0x0003, 0x0001, gaim_parse_genericerr, 0);
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
601 aim_conn_addhandler(sess, bosconn, 0x0009, 0x0001, gaim_parse_genericerr, 0);
1746
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
602 aim_conn_addhandler(sess, bosconn, 0x0001, 0x001f, gaim_memrequest, 0);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
603
1245
2ac6ccb94229 [gaim-migrate @ 1255]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1233
diff changeset
604 aim_auth_sendcookie(sess, bosconn, cookie);
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
605 ((struct oscar_data *)gc->proto_data)->conn = bosconn;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
606 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
607 oscar_callback, bosconn);
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 981
diff changeset
608 set_login_progress(gc, 4, _("Connection established, cookie sent"));
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
609 return 1;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
610 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
611
1746
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
612 struct pieceofcrap {
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
613 struct gaim_connection *gc;
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
614 unsigned long offset;
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
615 unsigned long len;
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
616 char *modname;
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
617 struct aim_conn_t *conn;
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
618 struct aim_conn_t *mainconn;
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
619 unsigned int inpa;
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
620 };
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
621
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
622 void damn_you(gpointer data, gint source, GdkInputCondition c)
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
623 {
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
624 struct pieceofcrap *pos = data;
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
625 struct oscar_data *od = pos->gc->proto_data;
1747
0763e0d4addd [gaim-migrate @ 1757]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1746
diff changeset
626 char in = '\0';
1746
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
627 int x = 0;
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
628 char m[17];
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
629 if (c == GDK_INPUT_WRITE) {
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
630 char buf[BUF_LONG];
1751
14494564481e [gaim-migrate @ 1761]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1747
diff changeset
631 if (aim_conn_completeconnect(od->sess, pos->conn) < 0) {
14494564481e [gaim-migrate @ 1761]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1747
diff changeset
632 do_error_dialog("Gaim was unable to get a valid hash for logging into AIM."
14494564481e [gaim-migrate @ 1761]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1747
diff changeset
633 " You may be disconnected shortly.", "Login Error");
14494564481e [gaim-migrate @ 1761]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1747
diff changeset
634 gdk_input_remove(pos->inpa);
14494564481e [gaim-migrate @ 1761]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1747
diff changeset
635 close(pos->conn->fd);
14494564481e [gaim-migrate @ 1761]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1747
diff changeset
636 aim_conn_kill(od->sess, &pos->conn);
14494564481e [gaim-migrate @ 1761]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1747
diff changeset
637 g_free(pos);
14494564481e [gaim-migrate @ 1761]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1747
diff changeset
638 return;
14494564481e [gaim-migrate @ 1761]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1747
diff changeset
639 }
1746
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
640 g_snprintf(buf, sizeof(buf), "GET http://gaim.sourceforge.net/aim_data.php3?"
1815
f15d449b3167 [gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1810
diff changeset
641 "offset=%ld&len=%ld&modname=%s HTTP/1.0\n\n",
1746
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
642 pos->offset, pos->len, pos->modname ? pos->modname : "");
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
643 write(pos->conn->fd, buf, strlen(buf));
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
644 if (pos->modname)
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
645 g_free(pos->modname);
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
646 gdk_input_remove(pos->inpa);
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
647 pos->inpa = gdk_input_add(pos->conn->fd, GDK_INPUT_READ, damn_you, pos);
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
648 return;
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
649 }
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
650
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
651 while (read(pos->conn->fd, &in, 1) == 1) {
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
652 if (in == '\n')
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
653 x++;
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
654 else if (in != '\r')
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
655 x = 0;
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
656 if (x == 2)
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
657 break;
1747
0763e0d4addd [gaim-migrate @ 1757]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1746
diff changeset
658 in = '\0';
0763e0d4addd [gaim-migrate @ 1757]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1746
diff changeset
659 }
0763e0d4addd [gaim-migrate @ 1757]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1746
diff changeset
660 if (in != '\n') {
0763e0d4addd [gaim-migrate @ 1757]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1746
diff changeset
661 do_error_dialog("Gaim was unable to get a valid hash for logging into AIM."
0763e0d4addd [gaim-migrate @ 1757]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1746
diff changeset
662 " You may be disconnected shortly.", "Login Error");
0763e0d4addd [gaim-migrate @ 1757]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1746
diff changeset
663 gdk_input_remove(pos->inpa);
0763e0d4addd [gaim-migrate @ 1757]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1746
diff changeset
664 close(pos->conn->fd);
0763e0d4addd [gaim-migrate @ 1757]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1746
diff changeset
665 aim_conn_kill(od->sess, &pos->conn);
0763e0d4addd [gaim-migrate @ 1757]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1746
diff changeset
666 g_free(pos);
0763e0d4addd [gaim-migrate @ 1757]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1746
diff changeset
667 return;
1746
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
668 }
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
669 read(pos->conn->fd, m, 16);
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
670 m[16] = '\0';
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
671 gdk_input_remove(pos->inpa);
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
672 close(pos->conn->fd);
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
673 aim_conn_kill(od->sess, &pos->conn);
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
674 aim_sendmemblock(od->sess, pos->mainconn, 0, 16, m, AIM_SENDMEMBLOCK_FLAG_ISHASH);
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
675 g_free(pos);
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
676 }
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
677
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
678 int gaim_memrequest(struct aim_session_t *sess,
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
679 struct command_rx_struct *command, ...) {
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
680 va_list ap;
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
681 struct pieceofcrap *pos;
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
682 unsigned long offset, len;
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
683 char *modname;
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
684
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
685 va_start(ap, command);
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
686 offset = va_arg(ap, unsigned long);
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
687 len = va_arg(ap, unsigned long);
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
688 modname = va_arg(ap, char *);
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
689 va_end(ap);
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
690
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
691 if (len == 0) {
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
692 aim_sendmemblock(sess, command->conn, offset, len, NULL,
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
693 AIM_SENDMEMBLOCK_FLAG_ISREQUEST);
1815
f15d449b3167 [gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1810
diff changeset
694 return 1;
1746
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
695 }
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
696
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
697 pos = g_new0(struct pieceofcrap, 1);
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
698 pos->gc = sess->aux_data;
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
699 pos->mainconn = command->conn;
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
700
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
701 pos->offset = offset;
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
702 pos->len = len;
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
703 pos->modname = modname ? g_strdup(modname) : NULL;
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
704
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
705 pos->conn = aim_newconn(sess, 0, "gaim.sourceforge.net:80");
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
706 pos->inpa = gdk_input_add(pos->conn->fd, GDK_INPUT_WRITE, damn_you, pos);
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
707
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
708 return 1;
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
709 }
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
710
1710
f42ce672c560 [gaim-migrate @ 1720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1667
diff changeset
711 void some_name(char *buf)
f42ce672c560 [gaim-migrate @ 1720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1667
diff changeset
712 {
f42ce672c560 [gaim-migrate @ 1720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1667
diff changeset
713 int x[4];
f42ce672c560 [gaim-migrate @ 1720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1667
diff changeset
714 x[0] = htonl(0x45576172);
f42ce672c560 [gaim-migrate @ 1720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1667
diff changeset
715 x[1] = htonl(0x6d656e68);
f42ce672c560 [gaim-migrate @ 1720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1667
diff changeset
716 x[2] = htonl(0x6f76656e);
f42ce672c560 [gaim-migrate @ 1720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1667
diff changeset
717 x[3] = 0;
1815
f15d449b3167 [gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1810
diff changeset
718 g_snprintf(buf, 16, "%s", (char *)x);
1710
f42ce672c560 [gaim-migrate @ 1720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1667
diff changeset
719 }
f42ce672c560 [gaim-migrate @ 1720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1667
diff changeset
720
741
58a6e6e26695 [gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 736
diff changeset
721 int gaim_parse_login(struct aim_session_t *sess,
58a6e6e26695 [gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 736
diff changeset
722 struct command_rx_struct *command, ...) {
1649
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents: 1643
diff changeset
723 #if 0
1629
51e8f61ce2c6 [gaim-migrate @ 1639]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1627
diff changeset
724 struct client_info_s info = {"gaim", 4, 1, 2010, "us", "en", 0x0004, 0x0000, 0x04b};
1649
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents: 1643
diff changeset
725 #else
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents: 1643
diff changeset
726 struct client_info_s info = AIM_CLIENTINFO_KNOWNGOOD;
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents: 1643
diff changeset
727 #endif
840
595ac7759563 [gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 838
diff changeset
728 char *key;
741
58a6e6e26695 [gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 736
diff changeset
729 va_list ap;
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
730 struct gaim_connection *gc = sess->aux_data;
741
58a6e6e26695 [gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 736
diff changeset
731
58a6e6e26695 [gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 736
diff changeset
732 va_start(ap, command);
58a6e6e26695 [gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 736
diff changeset
733 key = va_arg(ap, char *);
58a6e6e26695 [gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 736
diff changeset
734 va_end(ap);
58a6e6e26695 [gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 736
diff changeset
735
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
736 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
737 return 1;
741
58a6e6e26695 [gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 736
diff changeset
738 }
58a6e6e26695 [gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 736
diff changeset
739
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
740 int gaim_server_ready(struct aim_session_t *sess,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
741 struct command_rx_struct *command, ...) {
511
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 505
diff changeset
742 static int id = 1;
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
743 struct gaim_connection *gc = sess->aux_data;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
744 struct oscar_data *od = gc->proto_data;
1186
c00fc3adfd66 [gaim-migrate @ 1196]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1161
diff changeset
745 struct chat_connection *chatcon;
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
746 switch (command->conn->type) {
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
747 case AIM_CONN_TYPE_AUTH:
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
748 aim_auth_setversions(sess, command->conn);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
749 aim_bos_reqrate(sess, command->conn);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
750 debug_printf("done with AUTH ServerReady\n");
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
751 if (od->chpass) {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
752 debug_printf("changing password\n");
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
753 aim_auth_changepasswd(sess, command->conn, od->newp, od->oldp);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
754 g_free(od->oldp);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
755 g_free(od->newp);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
756 od->chpass = FALSE;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
757 }
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
758 if (od->conf) {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
759 debug_printf("confirming account\n");
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
760 aim_auth_reqconfirm(sess, command->conn);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
761 od->conf = FALSE;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
762 }
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
763 if (od->reqemail) {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
764 debug_printf("requesting email\n");
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
765 aim_auth_getinfo(sess, command->conn, 0x0011);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
766 od->reqemail = FALSE;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
767 }
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
768 break;
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
769 case AIM_CONN_TYPE_BOS:
829
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
770 aim_setversions(sess, command->conn);
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
771 aim_bos_reqrate(sess, command->conn); /* request rate info */
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
772 debug_printf("done with BOS ServerReady\n");
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
773 break;
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
774 case AIM_CONN_TYPE_CHATNAV:
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
775 debug_printf("chatnav: got server ready\n");
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
776 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
777 aim_bos_reqrate(sess, command->conn);
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
778 aim_bos_ackrateresp(sess, command->conn);
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
779 aim_chatnav_clientready(sess, command->conn);
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
780 aim_chatnav_reqrights(sess, command->conn);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
781 break;
511
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 505
diff changeset
782 case AIM_CONN_TYPE_CHAT:
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
783 debug_printf("chat: got server ready\n");
511
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 505
diff changeset
784 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
785 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
786 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
787 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
788 aim_bos_reqrate(sess, command->conn);
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 505
diff changeset
789 aim_bos_ackrateresp(sess, command->conn);
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 505
diff changeset
790 aim_chat_clientready(sess, command->conn);
1186
c00fc3adfd66 [gaim-migrate @ 1196]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1161
diff changeset
791 chatcon = find_oscar_chat_by_conn(gc, command->conn);
c00fc3adfd66 [gaim-migrate @ 1196]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1161
diff changeset
792 chatcon->id = id;
964
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
793 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
794 break;
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 505
diff changeset
795 case AIM_CONN_TYPE_RENDEZVOUS:
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 505
diff changeset
796 break;
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
797 default: /* huh? */
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
798 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
799 break;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
800 }
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
801 return 1;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
802 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
803
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
804 int gaim_handle_redirect(struct aim_session_t *sess,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
805 struct command_rx_struct *command, ...) {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
806 va_list ap;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
807 int serviceid;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
808 char *ip;
840
595ac7759563 [gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 838
diff changeset
809 unsigned char *cookie;
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
810 struct gaim_connection *gc = sess->aux_data;
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
811 struct oscar_data *odata = (struct oscar_data *)gc->proto_data;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
812
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
813 va_start(ap, command);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
814 serviceid = va_arg(ap, int);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
815 ip = va_arg(ap, char *);
840
595ac7759563 [gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 838
diff changeset
816 cookie = va_arg(ap, unsigned char *);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
817
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
818 switch(serviceid) {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
819 case 0x7: /* Authorizer */
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
820 debug_printf("Reconnecting with authorizor...\n");
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
821 {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
822 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
823 if (tstconn == NULL || tstconn->status & AIM_CONN_STATUS_RESOLVERR)
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
824 debug_printf("unable to reconnect with authorizer\n");
331
f3c8d79688db [gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 319
diff changeset
825 else {
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
826 aim_conn_addhandler(sess, tstconn, 0x0001, 0x0003, gaim_server_ready, 0);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
827 aim_conn_addhandler(sess, tstconn, 0x0001, 0x0007, gaim_rateresp, 0);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
828 aim_conn_addhandler(sess, tstconn, 0x0007, 0x0003, gaim_info_change, 0);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
829 aim_conn_addhandler(sess, tstconn, 0x0007, 0x0005, gaim_info_change, 0);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
830 aim_conn_addhandler(sess, tstconn, 0x0007, 0x0007, gaim_account_confirm, 0);
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
831 odata->paspa = gdk_input_add(tstconn->fd,
331
f3c8d79688db [gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 319
diff changeset
832 GDK_INPUT_READ | GDK_INPUT_EXCEPTION,
f3c8d79688db [gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 319
diff changeset
833 oscar_callback, tstconn);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
834 aim_auth_sendcookie(sess, tstconn, cookie);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
835 }
331
f3c8d79688db [gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 319
diff changeset
836 }
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
837 break;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
838 case 0xd: /* ChatNav */
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
839 {
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
840 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
841 if (tstconn == NULL || tstconn->status & AIM_CONN_STATUS_RESOLVERR) {
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
842 debug_printf("unable to connect to chatnav server\n");
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
843 return 1;
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
844 }
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
845 aim_conn_addhandler(sess, tstconn, 0x0001, 0x0003, gaim_server_ready, 0);
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
846 aim_auth_sendcookie(sess, tstconn, cookie);
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
847 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
848 oscar_callback, tstconn);
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
849 }
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
850 debug_printf("chatnav: connected\n");
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
851 break;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
852 case 0xe: /* Chat */
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
853 {
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
854 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
855 char *roomname = va_arg(ap, char *);
1186
c00fc3adfd66 [gaim-migrate @ 1196]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1161
diff changeset
856 int exchange = va_arg(ap, int);
312
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
857 struct chat_connection *ccon;
1082
13df4e342cff [gaim-migrate @ 1092]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1081
diff changeset
858 if (tstconn == NULL || tstconn->status & AIM_CONN_STATUS_RESOLVERR) {
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
859 debug_printf("unable to connect to chat server\n");
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
860 return 1;
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
861 }
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
862 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
863
312
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
864 ccon = g_new0(struct chat_connection, 1);
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
865 ccon->conn = tstconn;
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
866 ccon->fd = tstconn->fd;
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
867 ccon->name = g_strdup(roomname);
1186
c00fc3adfd66 [gaim-migrate @ 1196]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1161
diff changeset
868 ccon->exchange = exchange;
312
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
869
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
870 ccon->inpa = gdk_input_add(tstconn->fd,
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
871 GDK_INPUT_READ | GDK_INPUT_EXCEPTION,
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
872 oscar_callback, tstconn);
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
873
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
874 odata->oscar_chats = g_slist_append(odata->oscar_chats, ccon);
312
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
875
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
876 aim_chat_attachname(tstconn, roomname);
511
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 505
diff changeset
877 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
878 aim_auth_sendcookie(sess, tstconn, cookie);
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
879 }
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
880 break;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
881 default: /* huh? */
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
882 debug_printf("got redirect for unknown service 0x%04x\n", serviceid);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
883 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
884 }
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
885
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
886 va_end(ap);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
887
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
888 return 1;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
889 }
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
890
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
891 int gaim_parse_oncoming(struct aim_session_t *sess,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
892 struct command_rx_struct *command, ...) {
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
893 struct aim_userinfo_s *info;
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
894 time_t time_idle;
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
895 int type = 0;
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
896 struct gaim_connection *gc = sess->aux_data;
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
897
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
898 va_list ap;
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
899 va_start(ap, command);
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
900 info = va_arg(ap, struct aim_userinfo_s *);
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
901 va_end(ap);
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
902
900
e18815f5a4e9 [gaim-migrate @ 910]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 891
diff changeset
903 if (info->flags & AIM_FLAG_UNCONFIRMED)
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
904 type |= UC_UNCONFIRMED;
900
e18815f5a4e9 [gaim-migrate @ 910]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 891
diff changeset
905 else if (info->flags & AIM_FLAG_ADMINISTRATOR)
771
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
906 type |= UC_ADMIN;
900
e18815f5a4e9 [gaim-migrate @ 910]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 891
diff changeset
907 else if (info->flags & AIM_FLAG_AOL)
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
908 type |= UC_AOL;
900
e18815f5a4e9 [gaim-migrate @ 910]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 891
diff changeset
909 else if (info->flags & AIM_FLAG_FREE)
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
910 type |= UC_NORMAL;
900
e18815f5a4e9 [gaim-migrate @ 910]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 891
diff changeset
911 if (info->flags & AIM_FLAG_AWAY)
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
912 type |= UC_UNAVAILABLE;
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
913
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
914 if (info->idletime) {
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
915 time(&time_idle);
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
916 time_idle -= info->idletime*60;
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
917 } else
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
918 time_idle = 0;
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
919
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1020
diff changeset
920 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
921 time_idle, type, info->capabilities);
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
922
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
923 return 1;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
924 }
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
925
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
926 int gaim_parse_offgoing(struct aim_session_t *sess,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
927 struct command_rx_struct *command, ...) {
1649
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents: 1643
diff changeset
928 struct aim_userinfo_s *info;
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
929 va_list ap;
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
930 struct gaim_connection *gc = sess->aux_data;
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
931
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
932 va_start(ap, command);
1649
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents: 1643
diff changeset
933 info = va_arg(ap, struct aim_userinfo_s *);
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
934 va_end(ap);
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
935
1649
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents: 1643
diff changeset
936 serv_got_update(gc, info->sn, 0, 0, 0, 0, 0, 0);
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
937
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
938 return 1;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
939 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
940
1064
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
941 static void cancel_direct_im(gpointer w, struct ask_direct *d) {
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
942 debug_printf("Freeing DirectIM prompts.\n");
1059
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
943
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
944 g_free(d->sn);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
945 g_free(d);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
946 }
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
947
1064
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
948 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
949 struct oscar_data *od = (struct oscar_data *)d->gc->proto_data;
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
950
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
951 od->direct_ims = g_slist_remove(od->direct_ims, d);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
952 gdk_input_remove(d->watcher);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
953 aim_conn_kill(od->sess, &d->conn);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
954 g_free(d);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
955 }
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
956
1305
374b6482f904 [gaim-migrate @ 1315]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1302
diff changeset
957 static void oscar_directim_callback(gpointer data, gint source, GdkInputCondition condition) {
374b6482f904 [gaim-migrate @ 1315]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1302
diff changeset
958 struct direct_im *dim = data;
374b6482f904 [gaim-migrate @ 1315]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1302
diff changeset
959 struct gaim_connection *gc = dim->gc;
374b6482f904 [gaim-migrate @ 1315]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1302
diff changeset
960 struct oscar_data *od = gc->proto_data;
374b6482f904 [gaim-migrate @ 1315]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1302
diff changeset
961 char buf[256];
374b6482f904 [gaim-migrate @ 1315]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1302
diff changeset
962
374b6482f904 [gaim-migrate @ 1315]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1302
diff changeset
963 if (!(dim->cnv = find_conversation(dim->name))) dim->cnv = new_conversation(dim->name);
1735
00f74db70f2d [gaim-migrate @ 1745]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1710
diff changeset
964 g_snprintf(buf, sizeof buf, _("Direct IM with %s established"), dim->name);
1764
1e0613d9526b [gaim-migrate @ 1774]
Rob Flynn <gaim@robflynn.com>
parents: 1751
diff changeset
965 write_to_conv(dim->cnv, buf, WFLAG_SYSTEM, NULL, time((time_t)NULL));
1305
374b6482f904 [gaim-migrate @ 1315]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1302
diff changeset
966
374b6482f904 [gaim-migrate @ 1315]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1302
diff changeset
967 gtk_signal_connect(GTK_OBJECT(dim->cnv->window), "destroy",
374b6482f904 [gaim-migrate @ 1315]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1302
diff changeset
968 GTK_SIGNAL_FUNC(delete_direct_im), dim);
374b6482f904 [gaim-migrate @ 1315]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1302
diff changeset
969
374b6482f904 [gaim-migrate @ 1315]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1302
diff changeset
970 aim_conn_addhandler(od->sess, dim->conn, AIM_CB_FAM_OFT, AIM_CB_OFT_DIRECTIMINCOMING,
374b6482f904 [gaim-migrate @ 1315]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1302
diff changeset
971 gaim_directim_incoming, 0);
374b6482f904 [gaim-migrate @ 1315]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1302
diff changeset
972 aim_conn_addhandler(od->sess, dim->conn, AIM_CB_FAM_OFT, AIM_CB_OFT_DIRECTIMDISCONNECT,
374b6482f904 [gaim-migrate @ 1315]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1302
diff changeset
973 gaim_directim_disconnect, 0);
374b6482f904 [gaim-migrate @ 1315]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1302
diff changeset
974 aim_conn_addhandler(od->sess, dim->conn, AIM_CB_FAM_OFT, AIM_CB_OFT_DIRECTIMTYPING,
374b6482f904 [gaim-migrate @ 1315]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1302
diff changeset
975 gaim_directim_typing, 0);
374b6482f904 [gaim-migrate @ 1315]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1302
diff changeset
976
374b6482f904 [gaim-migrate @ 1315]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1302
diff changeset
977 gdk_input_remove(dim->watcher);
374b6482f904 [gaim-migrate @ 1315]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1302
diff changeset
978 dim->watcher = gdk_input_add(dim->conn->fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION,
374b6482f904 [gaim-migrate @ 1315]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1302
diff changeset
979 oscar_callback, dim->conn);
374b6482f904 [gaim-migrate @ 1315]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1302
diff changeset
980 }
374b6482f904 [gaim-migrate @ 1315]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1302
diff changeset
981
1064
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
982 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
983 struct gaim_connection *gc = d->gc;
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
984 struct oscar_data *od = (struct oscar_data *)gc->proto_data;
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
985 struct direct_im *dim;
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
986
1064
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
987 debug_printf("Accepted DirectIM.\n");
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
988
1059
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
989 dim = find_direct_im(od, d->sn);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
990 if (dim) {
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
991 cancel_direct_im(w, d); /* 40 */
1092
a930439f29b1 [gaim-migrate @ 1102]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1089
diff changeset
992 return TRUE;
1059
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
993 }
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
994 dim = g_new0(struct direct_im, 1);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
995 dim->gc = d->gc;
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
996 g_snprintf(dim->name, sizeof dim->name, "%s", d->sn);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
997
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
998 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
999 od->sess->flags ^= AIM_SESS_FLAGS_NONBLOCKCONNECT;
1059
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
1000 g_free(dim);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
1001 cancel_direct_im(w, d);
1092
a930439f29b1 [gaim-migrate @ 1102]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1089
diff changeset
1002 return TRUE;
1059
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
1003 }
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
1004
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
1005 od->direct_ims = g_slist_append(od->direct_ims, dim);
1305
374b6482f904 [gaim-migrate @ 1315]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1302
diff changeset
1006
374b6482f904 [gaim-migrate @ 1315]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1302
diff changeset
1007 dim->watcher = gdk_input_add(dim->conn->fd, GDK_INPUT_WRITE, oscar_directim_callback, dim);
1059
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
1008
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
1009 cancel_direct_im(w, d);
1064
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
1010
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
1011 return TRUE;
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
1012 }
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
1013
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1014 /*
1064
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
1015 static void cancel_getfile(gpointer w, struct ask_getfile *g) {
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
1016 g_free(g->ip);
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
1017 g_free(g->cookie);
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
1018 g_free(g->sn);
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
1019 g_free(g);
1059
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
1020 }
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
1021
1156
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1022 static void cancel_getfile_file(GtkObject *obj, struct ask_getfile *g) {
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1023 GtkWidget *w = gtk_object_get_user_data(obj);
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1024 gtk_widget_destroy(w);
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1025 cancel_getfile(w, g);
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1026 }
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1027
1246
42ca87108cd1 [gaim-migrate @ 1256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1245
diff changeset
1028 static void cancel_getfile_cancel(GtkObject *obj, struct ask_getfile *g) {
42ca87108cd1 [gaim-migrate @ 1256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1245
diff changeset
1029 GtkWidget *w = gtk_object_get_user_data(obj);
42ca87108cd1 [gaim-migrate @ 1256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1245
diff changeset
1030 gtk_widget_destroy(w);
42ca87108cd1 [gaim-migrate @ 1256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1245
diff changeset
1031 }
42ca87108cd1 [gaim-migrate @ 1256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1245
diff changeset
1032
1161
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1033 static void interrupt_getfile(GtkObject *obj, struct getfile_transfer *gt) {
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1034 struct gaim_connection *gc = gt->gc;
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1035 struct oscar_data *od = (struct oscar_data *)gc->proto_data;
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1036
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1037 gtk_widget_destroy(gt->window);
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1038 gdk_input_remove(gt->gip);
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1039 if (gt->gop > 0)
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1040 gdk_input_remove(gt->gop);
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1041 aim_conn_kill(od->sess, &gt->conn);
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1042 od->getfiles = g_slist_remove(od->getfiles, gt);
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1043 g_free(gt->receiver);
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1044 g_free(gt->filename);
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1045 fclose(gt->listing);
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1046 g_free(gt);
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1047 }
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1048
1156
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1049 static int gaim_getfile_filereq(struct aim_session_t *sess, struct command_rx_struct *command, ...) {
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1050 struct gaim_connection *gc = sess->aux_data;
1161
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1051 struct oscar_data *od = (struct oscar_data *)gc->proto_data;
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1052 struct getfile_transfer *gt;
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1053 char buf[2048];
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1054 GtkWidget *label;
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1055 GtkWidget *button;
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1056
1156
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1057 va_list ap;
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1058 struct aim_conn_t *oftconn;
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1059 struct aim_fileheader_t *fh;
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1060 char *cookie;
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1061
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1062 va_start(ap, command);
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1063 oftconn = va_arg(ap, struct aim_conn_t *);
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1064 fh = va_arg(ap, struct aim_fileheader_t *);
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1065 cookie = va_arg(ap, char *);
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1066 va_end(ap);
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1067
1161
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1068 gt = find_getfile_transfer(od, oftconn);
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1069
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1070 if (gt->window)
1233
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1231
diff changeset
1071 return 1;
1161
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1072
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1073 gt->window = gtk_dialog_new();
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1074 gtk_window_set_title(GTK_WINDOW(gt->window), _("Gaim - File Transfer"));
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1075 gtk_widget_realize(gt->window);
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1076 aol_icon(gt->window->window);
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1077
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1078 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
1079 label = gtk_label_new(buf);
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1080 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
1081 gtk_widget_show(label);
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1082
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1083 gt->meter = gtk_progress_bar_new();
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1084 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
1085 gtk_widget_show(gt->meter);
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1086
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1087 gt->label = gtk_label_new("0 %");
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1088 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
1089 gtk_widget_show(gt->label);
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1090
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1091 button = picture_button(gt->window, _("Cancel"), cancel_xpm);
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1092 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
1093 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
1094
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1095 gtk_widget_show(gt->window);
1156
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1096
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1097 return 1;
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1098 }
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1099
1161
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1100 static void getfile_send_callback(gpointer data, gint source, GdkInputCondition condition) {
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1101 struct getfile_transfer *gt = (struct getfile_transfer *)data;
1188
004d472be8a3 [gaim-migrate @ 1198]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
1102 int result;
1161
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1103
1188
004d472be8a3 [gaim-migrate @ 1198]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
1104 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
1105 gt->pos += result;
004d472be8a3 [gaim-migrate @ 1198]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
1106 if (result == 0) {
004d472be8a3 [gaim-migrate @ 1198]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
1107 gdk_input_remove(gt->gop); gt->gop = 0;
004d472be8a3 [gaim-migrate @ 1198]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
1108 } else if (result == -1) {
004d472be8a3 [gaim-migrate @ 1198]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
1109 do_error_dialog(_("Error in transfer"), "Gaim");
004d472be8a3 [gaim-migrate @ 1198]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
1110 gdk_input_remove(gt->gop); gt->gop = 0;
004d472be8a3 [gaim-migrate @ 1198]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
1111 interrupt_getfile(NULL, gt);
004d472be8a3 [gaim-migrate @ 1198]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
1112 }
1161
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1113 }
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1114
1156
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1115 static int gaim_getfile_filesend(struct aim_session_t *sess, struct command_rx_struct *command, ...) {
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1116 struct gaim_connection *gc = sess->aux_data;
1161
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1117 struct oscar_data *od = (struct oscar_data *)gc->proto_data;
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1118 struct getfile_transfer *gt;
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1119
1156
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1120 va_list ap;
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1121 struct aim_conn_t *oftconn;
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1122 struct aim_fileheader_t *fh;
1233
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1231
diff changeset
1123 char *cookie;
1156
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1124
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1125 va_start(ap, command);
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1126 oftconn = va_arg(ap, struct aim_conn_t *);
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1127 fh = va_arg(ap, struct aim_fileheader_t *);
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1128 cookie = va_arg(ap, char *);
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1129 va_end(ap);
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1130
1161
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1131 gt = find_getfile_transfer(od, oftconn);
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1132
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1133 if (gt->gop > 0) {
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1134 debug_printf("already have output watcher?\n");
1233
728a90516211 [gaim-migrate @ 1243]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1231
diff changeset
1135 return 1;
1161
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1136 }
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1137
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1138 if ((gt->file = fopen(gt->filename, "r")) == NULL) {
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1139 interrupt_getfile(NULL, gt);
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1140 return 1;
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1141 }
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1142 gt->pos = 0;
1188
004d472be8a3 [gaim-migrate @ 1198]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
1143 gt->fh = g_memdup(fh, sizeof(struct aim_fileheader_t));
004d472be8a3 [gaim-migrate @ 1198]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
1144 fseek(gt->file, 0, SEEK_SET);
1161
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1145
1188
004d472be8a3 [gaim-migrate @ 1198]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1186
diff changeset
1146 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
1147
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1148 return 1;
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1149 }
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1150
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1151 static int gaim_getfile_complete(struct aim_session_t *sess, struct command_rx_struct *command, ...) {
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1152 struct gaim_connection *gc = sess->aux_data;
1161
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1153 struct oscar_data *od = (struct oscar_data *)gc->proto_data;
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1154 struct getfile_transfer *gt;
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1155
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1156 va_list ap;
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1157 struct aim_conn_t *conn;
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1158 struct aim_fileheader_t *fh;
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1159
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1160 va_start(ap, command);
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1161 conn = va_arg(ap, struct aim_conn_t *);
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1162 fh = va_arg(ap, struct aim_fileheader_t *);
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1163 va_end(ap);
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1164
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1165 gt = find_getfile_transfer(od, conn);
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1166
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1167 gtk_widget_destroy(gt->window);
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1168 gt->window = NULL;
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1169 do_error_dialog(_("Transfer complete."), "Gaim");
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1170
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1171 return 1;
1156
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1172 }
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1173
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1174 static int gaim_getfile_disconnect(struct aim_session_t *sess, struct command_rx_struct *command, ...) {
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1175 struct gaim_connection *gc = sess->aux_data;
1156
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1176 struct oscar_data *od = (struct oscar_data *)gc->proto_data;
1161
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1177 struct getfile_transfer *gt;
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1178
1156
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1179 va_list ap;
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1180 struct aim_conn_t *conn;
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1181 char *sn;
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1182
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1183 va_start(ap, command);
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1184 conn = va_arg(ap, struct aim_conn_t *);
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1185 sn = va_arg(ap, char *);
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1186 va_end(ap);
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1187
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1188 gt = find_getfile_transfer(od, conn);
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1189 od->getfiles = g_slist_remove(od->getfiles, gt);
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1190 gdk_input_remove(gt->gip);
1161
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1191 if (gt->gop > 0)
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1192 gdk_input_remove(gt->gop);
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1193 g_free(gt->receiver);
1156
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1194 g_free(gt->filename);
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1195 aim_conn_kill(sess, &conn);
1161
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1196 fclose(gt->listing);
1156
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1197 g_free(gt);
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1198
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1199 debug_printf("getfile disconnect\n");
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1200
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1201 return 1;
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1202 }
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1203
1305
374b6482f904 [gaim-migrate @ 1315]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1302
diff changeset
1204 static void oscar_getfile_callback(gpointer data, gint source, GdkInputCondition condition) {
374b6482f904 [gaim-migrate @ 1315]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1302
diff changeset
1205 struct getfile_transfer *gf = data;
374b6482f904 [gaim-migrate @ 1315]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1302
diff changeset
1206 struct gaim_connection *gc = gf->gc;
374b6482f904 [gaim-migrate @ 1315]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1302
diff changeset
1207 struct oscar_data *od = gc->proto_data;
374b6482f904 [gaim-migrate @ 1315]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1302
diff changeset
1208
374b6482f904 [gaim-migrate @ 1315]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1302
diff changeset
1209 gdk_input_remove(gf->gip);
374b6482f904 [gaim-migrate @ 1315]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1302
diff changeset
1210 gf->gip = gdk_input_add(source, GDK_INPUT_READ | GDK_INPUT_EXCEPTION, oscar_callback, gf->conn);
374b6482f904 [gaim-migrate @ 1315]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1302
diff changeset
1211
374b6482f904 [gaim-migrate @ 1315]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1302
diff changeset
1212 aim_conn_addhandler(od->sess, gf->conn, AIM_CB_FAM_OFT, AIM_CB_OFT_GETFILEFILEREQ, gaim_getfile_filereq, 0);
374b6482f904 [gaim-migrate @ 1315]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1302
diff changeset
1213 aim_conn_addhandler(od->sess, gf->conn, AIM_CB_FAM_OFT, AIM_CB_OFT_GETFILEFILESEND, gaim_getfile_filesend, 0);
374b6482f904 [gaim-migrate @ 1315]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1302
diff changeset
1214 aim_conn_addhandler(od->sess, gf->conn, AIM_CB_FAM_OFT, AIM_CB_OFT_GETFILECOMPLETE, gaim_getfile_complete, 0);
374b6482f904 [gaim-migrate @ 1315]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1302
diff changeset
1215 aim_conn_addhandler(od->sess, gf->conn, AIM_CB_FAM_OFT, AIM_CB_OFT_GETFILEDISCONNECT, gaim_getfile_disconnect, 0);
374b6482f904 [gaim-migrate @ 1315]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1302
diff changeset
1216 }
374b6482f904 [gaim-migrate @ 1315]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1302
diff changeset
1217
1156
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1218 static void do_getfile(GtkObject *obj, struct ask_getfile *g) {
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1219 GtkWidget *w = gtk_object_get_user_data(obj);
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1220 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
1221 struct gaim_connection *gc = g->gc;
1156
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1222 struct oscar_data *od = (struct oscar_data *)gc->proto_data;
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1223 struct getfile_transfer *gf;
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1224 struct stat st;
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1225 struct tm *ft;
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1226 char tmppath[256];
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1227 FILE *file;
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1228 static int current = 0;
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1229 struct aim_conn_t *newconn;
1059
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
1230
1156
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1231 if (file_is_dir(filename, w))
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1232 return;
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1233
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1234 if (stat(filename, &st) != 0) {
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1235 gtk_widget_destroy(w);
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1236 do_error_dialog(_("Error examining file"), _("GetFile Error"));
1064
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
1237 cancel_getfile(w, g);
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
1238 return;
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
1239 }
1156
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1240
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1241 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
1242 if ((file = fopen(tmppath, "w+")) == NULL) {
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1243 gtk_widget_destroy(w);
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1244 do_error_dialog(_("Could not open temporary file, aborting"), _("GetFile Error"));
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1245 cancel_getfile(w, g);
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1246 return;
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1247 }
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1248
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1249 gf = g_new0(struct getfile_transfer, 1);
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1250 gf->gc = gc;
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1251 gf->filename = g_strdup(filename);
1161
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1252 gf->listing = file;
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1253 gf->receiver = g_strdup(g->sn);
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1254 gf->size = st.st_size;
1156
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1255
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1256 ft = localtime(&st.st_ctime);
1161
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1257 fprintf(file, "%2d/%2d/%4d %2d:%2d %8ld ",
1156
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1258 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
1259 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
1260 fprintf(file, "%s\r\n", g_basename(filename));
1156
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1261 rewind(file);
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1262
1161
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1263 aim_oft_registerlisting(od->sess, file, "");
1156
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1264 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
1265 od->sess->flags ^= AIM_SESS_FLAGS_NONBLOCKCONNECT;
1156
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1266 do_error_dialog(_("Error connecting for transfer"), _("GetFile Error"));
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1267 g_free(gf->filename);
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1268 fclose(file);
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1269 g_free(gf);
1161
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1270 gtk_widget_destroy(w);
1156
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1271 return;
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1272 }
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1273
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1274 gtk_widget_destroy(w);
1059
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
1275
1161
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1276 od->getfiles = g_slist_append(od->getfiles, gf);
984cbc219724 [gaim-migrate @ 1171]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1156
diff changeset
1277 gf->conn = newconn;
1305
374b6482f904 [gaim-migrate @ 1315]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1302
diff changeset
1278 gf->gip = gdk_input_add(newconn->fd, GDK_INPUT_WRITE, oscar_getfile_callback, gf);
1156
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1279 }
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1280
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1281 static int accept_getfile(gpointer w, struct ask_getfile *g) {
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1282 GtkWidget *window;
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1283 window = gtk_file_selection_new(_("Gaim - Send File..."));
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1284 gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(window));
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1285 gtk_object_set_user_data(GTK_OBJECT(window), window);
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1286 gtk_signal_connect(GTK_OBJECT(window), "destroy",
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1287 GTK_SIGNAL_FUNC(cancel_getfile_file), g);
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1288 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
1289 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
1290 GTK_SIGNAL_FUNC(do_getfile), g);
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1291 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
1292 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
1293 GTK_SIGNAL_FUNC(cancel_getfile_cancel), g);
1156
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1294 gtk_widget_show(window);
1059
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
1295
1064
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
1296 return TRUE;
1059
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
1297 }
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1298 */
1059
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
1299
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
1300 int gaim_parse_incoming_im(struct aim_session_t *sess,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
1301 struct command_rx_struct *command, ...) {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
1302 int channel;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
1303 va_list ap;
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1304 struct gaim_connection *gc = sess->aux_data;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1305
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
1306 va_start(ap, command);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
1307 channel = va_arg(ap, int);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1308
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
1309 /* channel 1: standard message */
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
1310 if (channel == 1) {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
1311 struct aim_userinfo_s *userinfo;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
1312 char *msg = NULL;
744
f53e8f48628d [gaim-migrate @ 754]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 741
diff changeset
1313 char *tmp = g_malloc(BUF_LONG);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
1314 u_int icbmflags = 0;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
1315 u_short flag1, flag2;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1316
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
1317 userinfo = va_arg(ap, struct aim_userinfo_s *);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
1318 msg = va_arg(ap, char *);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
1319 icbmflags = va_arg(ap, u_int);
464
4966003f2c9b [gaim-migrate @ 474]
Rob Flynn <gaim@robflynn.com>
parents: 446
diff changeset
1320 flag1 = (u_short)va_arg(ap, u_int);
4966003f2c9b [gaim-migrate @ 474]
Rob Flynn <gaim@robflynn.com>
parents: 446
diff changeset
1321 flag2 = (u_short)va_arg(ap, u_int);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
1322 va_end(ap);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1323
744
f53e8f48628d [gaim-migrate @ 754]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 741
diff changeset
1324 g_snprintf(tmp, BUF_LONG, "%s", msg);
1764
1e0613d9526b [gaim-migrate @ 1774]
Rob Flynn <gaim@robflynn.com>
parents: 1751
diff changeset
1325 serv_got_im(gc, userinfo->sn, tmp, icbmflags & AIM_IMFLAGS_AWAY, time((time_t)NULL));
744
f53e8f48628d [gaim-migrate @ 754]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 741
diff changeset
1326 g_free(tmp);
252
4a41f8323022 [gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 250
diff changeset
1327 } else if (channel == 2) {
4a41f8323022 [gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 250
diff changeset
1328 struct aim_userinfo_s *userinfo;
4a41f8323022 [gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 250
diff changeset
1329 int rendtype = va_arg(ap, int);
445
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
1330 if (rendtype & AIM_CAPS_CHAT) {
252
4a41f8323022 [gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 250
diff changeset
1331 char *msg, *encoding, *lang;
4a41f8323022 [gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 250
diff changeset
1332 struct aim_chat_roominfo *roominfo;
4a41f8323022 [gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 250
diff changeset
1333
4a41f8323022 [gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 250
diff changeset
1334 userinfo = va_arg(ap, struct aim_userinfo_s *);
4a41f8323022 [gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 250
diff changeset
1335 roominfo = va_arg(ap, struct aim_chat_roominfo *);
4a41f8323022 [gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 250
diff changeset
1336 msg = va_arg(ap, char *);
4a41f8323022 [gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 250
diff changeset
1337 encoding = va_arg(ap, char *);
4a41f8323022 [gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 250
diff changeset
1338 lang = va_arg(ap, char *);
4a41f8323022 [gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 250
diff changeset
1339 va_end(ap);
4a41f8323022 [gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 250
diff changeset
1340
964
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
1341 serv_got_chat_invite(gc,
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
1342 roominfo->name,
693
30a8e386849d [gaim-migrate @ 703]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 692
diff changeset
1343 roominfo->exchange,
252
4a41f8323022 [gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 250
diff changeset
1344 userinfo->sn,
4a41f8323022 [gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 250
diff changeset
1345 msg);
445
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
1346 } else if (rendtype & AIM_CAPS_SENDFILE) {
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
1347 } else if (rendtype & AIM_CAPS_GETFILE) {
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1348 /*
1064
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
1349 char *ip, *cookie;
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
1350 struct ask_getfile *g = g_new0(struct ask_getfile, 1);
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
1351 char buf[256];
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
1352
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
1353 userinfo = va_arg(ap, struct aim_userinfo_s *);
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
1354 ip = va_arg(ap, char *);
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
1355 cookie = va_arg(ap, char *);
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
1356 va_end(ap);
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
1357
1156
b6b2d26a4e2f [gaim-migrate @ 1166]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1153
diff changeset
1358 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
1359 gc->username, userinfo->sn, ip, cookie);
1064
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
1360
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
1361 g->gc = gc;
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
1362 g->sn = g_strdup(userinfo->sn);
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
1363 g->cookie = g_strdup(cookie);
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
1364 g->ip = g_strdup(ip);
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
1365 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
1366 userinfo->sn, gc->username);
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
1367 do_ask_dialog(buf, g, accept_getfile, cancel_getfile);
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1368 */
445
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
1369 } else if (rendtype & AIM_CAPS_VOICE) {
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
1370 } else if (rendtype & AIM_CAPS_BUDDYICON) {
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
1371 } else if (rendtype & AIM_CAPS_IMIMAGE) {
1059
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
1372 struct aim_directim_priv *priv;
1064
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
1373 struct ask_direct *d = g_new0(struct ask_direct, 1);
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
1374 char buf[256];
1059
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
1375
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
1376 userinfo = va_arg(ap, struct aim_userinfo_s *);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
1377 priv = va_arg(ap, struct aim_directim_priv *);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
1378 va_end(ap);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
1379
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
1380 debug_printf("%s received direct im request from %s (%s)\n",
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
1381 gc->username, userinfo->sn, priv->ip);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
1382
1064
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
1383 d->gc = gc;
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
1384 d->sn = g_strdup(userinfo->sn);
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
1385 d->priv = priv;
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
1386 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
1387 userinfo->sn, gc->username);
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
1388 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
1389 } else {
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
1390 debug_printf("Unknown rendtype %d\n", rendtype);
252
4a41f8323022 [gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 250
diff changeset
1391 }
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
1392 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1393
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
1394 return 1;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1395 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1396
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
1397 int gaim_parse_misses(struct aim_session_t *sess,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
1398 struct command_rx_struct *command, ...) {
836
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1399 va_list ap;
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1400 u_short chan, nummissed, reason;
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1401 struct aim_userinfo_s *userinfo;
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1402 char buf[1024];
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1403
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1404 va_start(ap, command);
838
7714587cd1f9 [gaim-migrate @ 848]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 836
diff changeset
1405 chan = (u_short)va_arg(ap, u_int);
836
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1406 userinfo = va_arg(ap, struct aim_userinfo_s *);
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1407 nummissed = (u_short)va_arg(ap, u_int);
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1408 reason = (u_short)va_arg(ap, u_int);
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1409 va_end(ap);
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
1410
836
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1411 switch(reason) {
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1412 case 1:
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1413 /* message too large */
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1414 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
1415 do_error_dialog(buf, _("Gaim - Error"));
1000
91b7377e7b45 [gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
1416 plugin_event(event_error, (void *)961, 0, 0, 0);
836
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1417 break;
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1418 default:
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1419 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
1420 do_error_dialog(buf, _("Gaim - Error"));
1000
91b7377e7b45 [gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
1421 plugin_event(event_error, (void *)970, 0, 0, 0);
836
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1422 break;
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1423 }
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
1424
836
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1425 return 1;
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1426 }
709
957957d0dc2c [gaim-migrate @ 719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 704
diff changeset
1427
1302
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
1428 int gaim_parse_genericerr(struct aim_session_t *sess, struct command_rx_struct *command, ...) {
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
1429 va_list ap;
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
1430 unsigned short reason;
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
1431
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
1432 va_start(ap, command);
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
1433 reason = va_arg(ap, int);
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
1434 va_end(ap);
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
1435
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
1436 debug_printf("snac threw error (reason 0x%04x: %s\n", reason,
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
1437 (reason < msgerrreasonlen) ? msgerrreason[reason] : "unknown");
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
1438
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
1439 return 1;
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
1440 }
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
1441
836
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1442 int gaim_parse_msgerr(struct aim_session_t *sess,
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1443 struct command_rx_struct *command, ...) {
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1444 va_list ap;
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1445 char *destn;
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1446 u_short reason;
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1447 char buf[1024];
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1448
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1449 va_start(ap, command);
1649
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents: 1643
diff changeset
1450 reason = (u_short)va_arg(ap, u_int);
836
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1451 destn = va_arg(ap, char *);
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1452 va_end(ap);
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1453
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1454 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
1455 (reason < msgerrreasonlen) ? msgerrreason[reason] : _("Reason unknown"));
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1456 do_error_dialog(buf, _("Gaim - Error"));
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1457
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1458 return 1;
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1459 }
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1460
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1461 int gaim_parse_locerr(struct aim_session_t *sess,
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1462 struct command_rx_struct *command, ...) {
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1463 va_list ap;
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1464 char *destn;
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1465 u_short reason;
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1466 char buf[1024];
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1467
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1468 va_start(ap, command);
1649
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents: 1643
diff changeset
1469 reason = (u_short)va_arg(ap, u_int);
836
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1470 destn = va_arg(ap, char *);
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1471 va_end(ap);
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1472
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1473 sprintf(buf, _("User information for %s unavailable: %s"), destn,
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1474 (reason < msgerrreasonlen) ? msgerrreason[reason] : _("Reason unknown"));
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1475 do_error_dialog(buf, _("Gaim - Error"));
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
1476
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
1477 return 1;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
1478 }
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
1479
1537
2157d91c2eb9 [gaim-migrate @ 1547]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1535
diff changeset
1480 static char *images(int flags) {
2157d91c2eb9 [gaim-migrate @ 1547]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1535
diff changeset
1481 static char buf[1024];
2157d91c2eb9 [gaim-migrate @ 1547]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1535
diff changeset
1482 g_snprintf(buf, sizeof(buf), "%s%s%s%s",
2157d91c2eb9 [gaim-migrate @ 1547]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1535
diff changeset
1483 (flags & AIM_FLAG_UNCONFIRMED) ? "<IMG SRC=\"dt_icon.gif\">" : "",
2157d91c2eb9 [gaim-migrate @ 1547]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1535
diff changeset
1484 (flags & AIM_FLAG_AOL) ? "<IMG SRC=\"aol_icon.gif\">" : "",
2157d91c2eb9 [gaim-migrate @ 1547]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1535
diff changeset
1485 (flags & AIM_FLAG_ADMINISTRATOR) ? "<IMG SRC=\"admin_icon.gif\">" : "",
2157d91c2eb9 [gaim-migrate @ 1547]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1535
diff changeset
1486 (flags & AIM_FLAG_FREE) ? "<IMG SRC=\"free_icon.gif\">" : "");
2157d91c2eb9 [gaim-migrate @ 1547]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1535
diff changeset
1487 return buf;
2157d91c2eb9 [gaim-migrate @ 1547]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1535
diff changeset
1488 }
2157d91c2eb9 [gaim-migrate @ 1547]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1535
diff changeset
1489
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
1490 int gaim_parse_user_info(struct aim_session_t *sess,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
1491 struct command_rx_struct *command, ...) {
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
1492 struct aim_userinfo_s *info;
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
1493 char *prof_enc = NULL, *prof = NULL;
249
810c595258c8 [gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 248
diff changeset
1494 u_short infotype;
247
f6e8ea29b24f [gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 243
diff changeset
1495 char buf[BUF_LONG];
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1496 struct gaim_connection *gc = sess->aux_data;
247
f6e8ea29b24f [gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 243
diff changeset
1497 va_list ap;
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
1498
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
1499 va_start(ap, command);
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
1500 info = va_arg(ap, struct aim_userinfo_s *);
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
1501 prof_enc = va_arg(ap, char *);
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
1502 prof = va_arg(ap, char *);
464
4966003f2c9b [gaim-migrate @ 474]
Rob Flynn <gaim@robflynn.com>
parents: 446
diff changeset
1503 infotype = (u_short)va_arg(ap, u_int);
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
1504 va_end(ap);
247
f6e8ea29b24f [gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 243
diff changeset
1505
249
810c595258c8 [gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 248
diff changeset
1506 if (prof == NULL || !strlen(prof)) {
392
df5127560034 [gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 388
diff changeset
1507 /* no info/away message */
836
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1508 char buf[1024];
1206
0d19ddd6f11e [gaim-migrate @ 1216]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1201
diff changeset
1509 sprintf(buf, _("%s has no %s."), info->sn,
0d19ddd6f11e [gaim-migrate @ 1216]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1201
diff changeset
1510 (infotype == AIM_GETINFO_GENERALINFO) ? "information" : "away message");
836
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1511 do_error_dialog(buf, _("Gaim - Error"));
1000
91b7377e7b45 [gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
1512 plugin_event(event_error, (void *)977, 0, 0, 0);
249
810c595258c8 [gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 248
diff changeset
1513 return 1;
810c595258c8 [gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 248
diff changeset
1514 }
810c595258c8 [gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 248
diff changeset
1515
1537
2157d91c2eb9 [gaim-migrate @ 1547]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1535
diff changeset
1516 g_snprintf(buf, sizeof buf, _("Username : <B>%s</B> %s <BR>\n"
2157d91c2eb9 [gaim-migrate @ 1547]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1535
diff changeset
1517 "Warning Level : <B>%d %%</B><BR>\n"
2157d91c2eb9 [gaim-migrate @ 1547]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1535
diff changeset
1518 "Online Since : <B>%s</B><BR>\n"
2157d91c2eb9 [gaim-migrate @ 1547]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1535
diff changeset
1519 "Idle Minutes : <B>%d</B>\n<BR>\n<HR><BR>\n"
2157d91c2eb9 [gaim-migrate @ 1547]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1535
diff changeset
1520 "%s"
1582
4fcd012c0a6a [gaim-migrate @ 1592]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1581
diff changeset
1521 "<br><BODY BGCOLOR=WHITE><hr><I>Legend:</I><br><br>"
1537
2157d91c2eb9 [gaim-migrate @ 1547]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1535
diff changeset
1522 "<IMG SRC=\"free_icon.gif\"> : Normal AIM User<br>"
2157d91c2eb9 [gaim-migrate @ 1547]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1535
diff changeset
1523 "<IMG SRC=\"aol_icon.gif\"> : AOL User <br>"
2157d91c2eb9 [gaim-migrate @ 1547]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1535
diff changeset
1524 "<IMG SRC=\"dt_icon.gif\"> : Trial AIM User <br>"
2157d91c2eb9 [gaim-migrate @ 1547]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1535
diff changeset
1525 "<IMG SRC=\"admin_icon.gif\"> : Administrator"),
2157d91c2eb9 [gaim-migrate @ 1547]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1535
diff changeset
1526 info->sn, images(info->flags),
601
e670cdb5fb2f [gaim-migrate @ 611]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 592
diff changeset
1527 info->warnlevel/10,
247
f6e8ea29b24f [gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 243
diff changeset
1528 asctime(localtime(&info->onlinesince)),
f6e8ea29b24f [gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 243
diff changeset
1529 info->idletime,
592
7c75d69a1129 [gaim-migrate @ 602]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 535
diff changeset
1530 infotype == AIM_GETINFO_GENERALINFO ? prof :
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
1531 away_subs(prof, gc->username));
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
1532 g_show_info_text(away_subs(buf, gc->username));
247
f6e8ea29b24f [gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 243
diff changeset
1533
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
1534 return 1;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
1535 }
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
1536
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
1537 int gaim_parse_motd(struct aim_session_t *sess,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
1538 struct command_rx_struct *command, ...) {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
1539 char *msg;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
1540 u_short id;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
1541 va_list ap;
1649
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents: 1643
diff changeset
1542 char buildbuf[150];
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
1543
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
1544 va_start(ap, command);
464
4966003f2c9b [gaim-migrate @ 474]
Rob Flynn <gaim@robflynn.com>
parents: 446
diff changeset
1545 id = (u_short)va_arg(ap, u_int);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
1546 msg = va_arg(ap, char *);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
1547 va_end(ap);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
1548
1649
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents: 1643
diff changeset
1549 aim_getbuildstring(buildbuf, sizeof(buildbuf));
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents: 1643
diff changeset
1550
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
1551 debug_printf("MOTD: %s (%d)\n", msg, id);
1649
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents: 1643
diff changeset
1552 debug_printf("Gaim %s / Libfaim %s\n", VERSION, buildbuf);
771
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
1553 if (id != 4)
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
1554 do_error_dialog(_("Your connection may be lost."),
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
1555 _("AOL error"));
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
1556
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
1557 return 1;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
1558 }
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
1559
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
1560 int gaim_chatnav_info(struct aim_session_t *sess,
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
1561 struct command_rx_struct *command, ...) {
445
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
1562 va_list ap;
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
1563 u_short type;
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1564 struct gaim_connection *gc = sess->aux_data;
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
1565 struct oscar_data *odata = (struct oscar_data *)gc->proto_data;
445
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
1566
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
1567 va_start(ap, command);
464
4966003f2c9b [gaim-migrate @ 474]
Rob Flynn <gaim@robflynn.com>
parents: 446
diff changeset
1568 type = (u_short)va_arg(ap, u_int);
302
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
1569
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
1570 switch(type) {
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
1571 case 0x0002: {
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
1572 int maxrooms;
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
1573 struct aim_chat_exchangeinfo *exchanges;
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
1574 int exchangecount, i = 0;
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
1575
466
b5c2359d633e [gaim-migrate @ 476]
Rob Flynn <gaim@robflynn.com>
parents: 464
diff changeset
1576 maxrooms = (u_char)va_arg(ap, u_int);
302
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
1577 exchangecount = va_arg(ap, int);
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
1578 exchanges = va_arg(ap, struct aim_chat_exchangeinfo *);
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
1579 va_end(ap);
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
1580
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
1581 debug_printf("chat info: Chat Rights:\n");
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
1582 debug_printf("chat info: \tMax Concurrent Rooms: %d\n", maxrooms);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
1583 debug_printf("chat info: \tExchange List: (%d total)\n", exchangecount);
1148
0a14a9a844cb [gaim-migrate @ 1158]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1147
diff changeset
1584 while (i < exchangecount)
0a14a9a844cb [gaim-migrate @ 1158]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1147
diff changeset
1585 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
1586 if (odata->create_exchange) {
1149
22bf2c3ec2e3 [gaim-migrate @ 1159]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1148
diff changeset
1587 debug_printf("creating room %s\n", odata->create_name);
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
1588 aim_chatnav_createroom(sess, command->conn, odata->create_name,
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
1589 odata->create_exchange);
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
1590 odata->create_exchange = 0;
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
1591 g_free(odata->create_name);
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
1592 odata->create_name = NULL;
904
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
1593 }
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
1594 }
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
1595 break;
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
1596 case 0x0008: {
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
1597 char *fqcn, *name, *ck;
1201
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1188
diff changeset
1598 u_short instance, flags, maxmsglen, maxoccupancy, unknown, exchange;
904
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
1599 unsigned char createperms;
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
1600 unsigned long createtime;
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
1601
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
1602 fqcn = va_arg(ap, char *);
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
1603 instance = (u_short)va_arg(ap, u_int);
1201
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1188
diff changeset
1604 exchange = (u_short)va_arg(ap, u_int);
904
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
1605 flags = (u_short)va_arg(ap, u_int);
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
1606 createtime = va_arg(ap, unsigned long);
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
1607 maxmsglen = (u_short)va_arg(ap, u_int);
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
1608 maxoccupancy = (u_short)va_arg(ap, u_int);
906
7b976e5e1c3a [gaim-migrate @ 916]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
1609 createperms = (unsigned char)va_arg(ap, int);
904
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
1610 unknown = (u_short)va_arg(ap, u_int);
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
1611 name = va_arg(ap, char *);
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
1612 ck = va_arg(ap, char *);
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
1613 va_end(ap);
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
1614
1201
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1188
diff changeset
1615 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
1616 fqcn,
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1188
diff changeset
1617 exchange, instance, flags,
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1188
diff changeset
1618 createtime,
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1188
diff changeset
1619 maxmsglen, maxoccupancy, createperms, unknown,
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1188
diff changeset
1620 name, ck);
90bb83cafb9e [gaim-migrate @ 1211]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1188
diff changeset
1621 aim_chat_join(odata->sess, odata->conn, exchange, ck);
302
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
1622 }
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
1623 break;
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
1624 default:
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
1625 va_end(ap);
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
1626 debug_printf("chatnav info: unknown type (%04x)\n", type);
302
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
1627 break;
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
1628 }
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
1629 return 1;
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
1630 }
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
1631
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
1632 int gaim_chat_join(struct aim_session_t *sess,
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
1633 struct command_rx_struct *command, ...) {
248
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1634 va_list ap;
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1635 int count, i = 0;
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1636 struct aim_userinfo_s *info;
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1637 struct gaim_connection *g = sess->aux_data;
248
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1638
964
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
1639 GSList *bcs = g->buddy_chats;
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 466
diff changeset
1640 struct conversation *b = NULL;
248
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1641
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1642 va_start(ap, command);
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1643 count = va_arg(ap, int);
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1644 info = va_arg(ap, struct aim_userinfo_s *);
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1645 va_end(ap);
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1646
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1647 while(bcs) {
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 466
diff changeset
1648 b = (struct conversation *)bcs->data;
248
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1649 if (!strcasecmp(b->name, (char *)command->conn->priv))
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1650 break;
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1651 bcs = bcs->next;
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1652 b = NULL;
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1653 }
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1654 if (!b)
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1655 return 1;
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1656
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1657 while (i < count)
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1658 add_chat_buddy(b, info[i++].sn);
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1659
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
1660 return 1;
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
1661 }
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
1662
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
1663 int gaim_chat_leave(struct aim_session_t *sess,
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
1664 struct command_rx_struct *command, ...) {
248
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1665 va_list ap;
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1666 int count, i = 0;
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1667 struct aim_userinfo_s *info;
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1668 struct gaim_connection *g = sess->aux_data;
248
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1669
964
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
1670 GSList *bcs = g->buddy_chats;
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 466
diff changeset
1671 struct conversation *b = NULL;
248
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1672
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1673 va_start(ap, command);
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1674 count = va_arg(ap, int);
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1675 info = va_arg(ap, struct aim_userinfo_s *);
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1676 va_end(ap);
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1677
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1678 while(bcs) {
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 466
diff changeset
1679 b = (struct conversation *)bcs->data;
248
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1680 if (!strcasecmp(b->name, (char *)command->conn->priv))
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1681 break;
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1682 bcs = bcs->next;
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1683 b = NULL;
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1684 }
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1685 if (!b)
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1686 return 1;
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1687
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1688 while (i < count)
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1689 remove_chat_buddy(b, info[i++].sn);
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1690
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
1691 return 1;
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
1692 }
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
1693
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
1694 int gaim_chat_info_update(struct aim_session_t *sess,
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
1695 struct command_rx_struct *command, ...) {
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
1696 debug_printf("inside chat_info_update\n");
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
1697 return 1;
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
1698 }
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
1699
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
1700 int gaim_chat_incoming_msg(struct aim_session_t *sess,
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
1701 struct command_rx_struct *command, ...) {
248
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1702 va_list ap;
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1703 struct aim_userinfo_s *info;
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1704 char *msg;
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1705 struct gaim_connection *gc = sess->aux_data;
1643
d7e380618fd5 [gaim-migrate @ 1653]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1635
diff changeset
1706 char *tmp;
248
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1707
964
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
1708 GSList *bcs = gc->buddy_chats;
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 466
diff changeset
1709 struct conversation *b = NULL;
248
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1710
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1711 va_start(ap, command);
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1712 info = va_arg(ap, struct aim_userinfo_s *);
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1713 msg = va_arg(ap, char *);
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1714
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1715 while(bcs) {
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 466
diff changeset
1716 b = (struct conversation *)bcs->data;
248
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1717 if (!strcasecmp(b->name, (char *)command->conn->priv))
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1718 break;
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1719 bcs = bcs->next;
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1720 b = NULL;
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1721 }
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1722 if (!b)
270
cfa39d39dec6 [gaim-migrate @ 280]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 267
diff changeset
1723 return 0;
248
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1724
1643
d7e380618fd5 [gaim-migrate @ 1653]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1635
diff changeset
1725 tmp = g_malloc(BUF_LONG);
d7e380618fd5 [gaim-migrate @ 1653]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1635
diff changeset
1726 g_snprintf(tmp, BUF_LONG, "%s", msg);
1764
1e0613d9526b [gaim-migrate @ 1774]
Rob Flynn <gaim@robflynn.com>
parents: 1751
diff changeset
1727 serv_got_chat_in(gc, b->id, info->sn, 0, tmp, time((time_t)NULL));
1643
d7e380618fd5 [gaim-migrate @ 1653]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1635
diff changeset
1728 g_free(tmp);
248
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1729
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
1730 return 1;
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
1731 }
503
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1732
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1733 /*
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1734 * 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
1735 */
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1736 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
1737 va_list ap;
505
3bd51b3f07c3 [gaim-migrate @ 515]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
1738 u_short type;
503
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1739 char *sn = NULL;
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1740
505
3bd51b3f07c3 [gaim-migrate @ 515]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
1741 va_start(ap, command);
3bd51b3f07c3 [gaim-migrate @ 515]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
1742 type = (u_short)va_arg(ap, u_int);
503
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1743 sn = va_arg(ap, char *);
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1744 va_end(ap);
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1745
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
1746 debug_printf("Sent message to %s.\n", sn);
503
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1747
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1748 return 1;
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1749 }
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1750
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1751 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
1752 static char *codes[5] = {"invalid",
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1753 "change",
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1754 "warning",
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1755 "limit",
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1756 "limit cleared"};
503
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1757 va_list ap;
1288
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1758 int code;
1302
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
1759 unsigned long rateclass, windowsize, clear, alert, limit, disconnect;
1288
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1760 unsigned long currentavg, maxavg;
503
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1761
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1762 va_start(ap, command);
1288
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1763 code = va_arg(ap, int);
1302
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
1764 rateclass= va_arg(ap, int);
1288
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1765 windowsize = va_arg(ap, unsigned long);
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1766 clear = va_arg(ap, unsigned long);
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1767 alert = va_arg(ap, unsigned long);
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1768 limit = va_arg(ap, unsigned long);
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1769 disconnect = va_arg(ap, unsigned long);
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1770 currentavg = va_arg(ap, unsigned long);
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1771 maxavg = va_arg(ap, unsigned long);
503
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1772 va_end(ap);
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1773
1288
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1774 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
1775 "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
1776 (code < 5) ? codes[code] : codes[0],
1302
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
1777 rateclass,
1288
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1778 currentavg, maxavg,
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1779 alert, clear,
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1780 limit, disconnect,
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1781 windowsize);
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1782
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1783 if (code == AIM_RATE_CODE_CHANGE) {
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1784 if (currentavg >= clear)
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1785 aim_conn_setlatency(command->conn, 0);
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1786 } else if (code == AIM_RATE_CODE_WARNING) {
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1787 aim_conn_setlatency(command->conn, windowsize/4);
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1788 } else if (code == AIM_RATE_CODE_LIMIT) {
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1789 aim_conn_setlatency(command->conn, windowsize/2);
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1790 } else if (code == AIM_RATE_CODE_CLEARLIMIT) {
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1791 aim_conn_setlatency(command->conn, 0);
d8eaf65ca9c3 [gaim-migrate @ 1298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1261
diff changeset
1792 }
503
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1793
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1794 return 1;
840
595ac7759563 [gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 838
diff changeset
1795 }
511
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 505
diff changeset
1796
771
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
1797 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
1798 va_list ap;
1302
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
1799 int newevil;
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
1800 struct aim_userinfo_s *userinfo;
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1801 struct gaim_connection *gc = sess->aux_data;
771
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
1802
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
1803 va_start(ap, command);
1302
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
1804 newevil = va_arg(ap, int);
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
1805 userinfo = va_arg(ap, struct aim_userinfo_s *);
771
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
1806 va_end(ap);
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
1807
1302
4c5c2fcb83cd [gaim-migrate @ 1312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1288
diff changeset
1808 serv_got_eviled(gc, (userinfo && userinfo->sn[0]) ? userinfo->sn : NULL, newevil / 10);
771
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
1809
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
1810 return 1;
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
1811 }
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
1812
829
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1813 int gaim_rateresp(struct aim_session_t *sess, struct command_rx_struct *command, ...) {
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1814 struct gaim_connection *gc = sess->aux_data;
829
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1815 switch (command->conn->type) {
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1816 case AIM_CONN_TYPE_BOS:
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1817 aim_bos_ackrateresp(sess, command->conn);
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1818 aim_bos_reqpersonalinfo(sess, command->conn);
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1819 aim_bos_reqlocaterights(sess, command->conn);
1051
713b0e14e0a9 [gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1039
diff changeset
1820 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
1821 aim_bos_reqbuddyrights(sess, command->conn);
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1822
1089
f0f5c10cce63 [gaim-migrate @ 1099]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1086
diff changeset
1823 account_online(gc);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
1824 serv_finish_login(gc);
829
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1825
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
1826 if (bud_list_cache_exists(gc))
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
1827 do_import(NULL, gc);
829
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1828
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
1829 debug_printf("buddy list loaded\n");
829
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1830
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1831 aim_addicbmparam(sess, command->conn);
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1832 aim_bos_reqicbmparaminfo(sess, command->conn);
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1833
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1834 aim_bos_reqrights(sess, command->conn);
900
e18815f5a4e9 [gaim-migrate @ 910]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 891
diff changeset
1835 aim_bos_setgroupperm(sess, command->conn, AIM_FLAG_ALLUSERS);
829
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1836 aim_bos_setprivacyflags(sess, command->conn, AIM_PRIVFLAGS_ALLOWIDLE |
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1837 AIM_PRIVFLAGS_ALLOWMEMBERSINCE);
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1838
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1839 break;
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1840 case AIM_CONN_TYPE_AUTH:
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1841 aim_bos_ackrateresp(sess, command->conn);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1842 aim_auth_clientready(sess, command->conn);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1843 debug_printf("connected to auth (admin)\n");
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1844 break;
829
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1845 default:
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
1846 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
1847 command->conn->type);
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1848 break;
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1849 }
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1850
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1851 return 1;
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1852 }
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1853
836
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1854 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
1855 if (command->data) {
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
1856 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
1857 } else
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
1858 debug_printf("NULL minimum report interval!\n");
836
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1859 return 1;
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1860 }
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1861
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1862 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
1863 va_list ap;
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1864 u_short maxbuddies, maxwatchers;
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1865
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1866 va_start(ap, command);
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1867 maxbuddies = (u_short)va_arg(ap, u_int);
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1868 maxwatchers = (u_short)va_arg(ap, u_int);
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1869 va_end(ap);
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1870
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
1871 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
1872
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1873 return 1;
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1874 }
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1875
829
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1876 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
1877 u_short maxpermits, maxdenies;
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1878 va_list ap;
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1879
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1880 va_start(ap, command);
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1881 maxpermits = (u_short)va_arg(ap, u_int);
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1882 maxdenies = (u_short)va_arg(ap, u_int);
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1883 va_end(ap);
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1884
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
1885 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
1886
829
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1887 aim_bos_clientready(sess, command->conn);
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1888
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1889 aim_bos_reqservice(sess, command->conn, AIM_CONN_TYPE_CHATNAV);
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1890
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1891 return 1;
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1892 }
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1893
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1894 int gaim_parse_searchreply(struct aim_session_t *sess, struct command_rx_struct *command, ...) {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1895 va_list ap;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1896 char *address, *SNs;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1897 int i, num;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1898 char *buf;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1899 int at = 0, len;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1900
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1901 va_start(ap, command);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1902 address = va_arg(ap, char *);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1903 num = va_arg(ap, int);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1904 SNs = va_arg(ap, char *);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1905 va_end(ap);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1906
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1907 len = num * (MAXSNLEN + 1) + 1024;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1908 buf = g_malloc(len);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1909 at += g_snprintf(buf + at, len - at, "<B>%s has the following screen names:</B><BR>", address);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1910 for (i = 0; i < num; i++)
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1911 at += g_snprintf(buf + at, len - at, "%s<BR>", &SNs[i * (MAXSNLEN + 1)]);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1912 g_show_info_text(buf);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1913 g_free(buf);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1914
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1915 return 1;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1916 }
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1917
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1918 int gaim_parse_searcherror(struct aim_session_t *sess, struct command_rx_struct *command, ...) {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1919 va_list ap;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1920 char *address;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1921 char buf[BUF_LONG];
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1922
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1923 va_start(ap, command);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1924 address = va_arg(ap, char *);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1925 va_end(ap);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1926
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1927 g_snprintf(buf, sizeof(buf), "No results found for email address %s", address);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1928 do_error_dialog(buf, _("Error"));
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1929
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1930 return 1;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1931 }
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1932
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1933 int gaim_account_confirm(struct aim_session_t *sess, struct command_rx_struct *command, ...) {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1934 int status;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1935 va_list ap;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1936 char msg[256];
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1937 struct gaim_connection *gc = sess->aux_data;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1938
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1939 va_start(ap, command);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1940 status = va_arg(ap, int); /* status code of confirmation request */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1941 va_end(ap);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1942
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1943 debug_printf("account confirmation returned status 0x%04x (%s)\n", status,
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1944 status ? "email sent" : "unknown");
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1945 if (status) {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1946 g_snprintf(msg, sizeof(msg), "You should receive an email asking to confirm %s.",
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1947 gc->username);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1948 do_error_dialog(msg, "Confirm");
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1949 }
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1950
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1951 return 1;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1952 }
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1953
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1954 int gaim_info_change(struct aim_session_t *sess, struct command_rx_struct *command, ...) {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1955 unsigned short change = 0;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1956 int perms, type, length, str;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1957 char *val;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1958 va_list ap;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1959 char buf[BUF_LONG];
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1960 struct gaim_connection *gc = sess->aux_data;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1961
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1962 va_start(ap, command);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1963 perms = va_arg(ap, int);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1964 type = va_arg(ap, int);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1965 length = va_arg(ap, int);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1966 val = va_arg(ap, char *);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1967 str = va_arg(ap, int);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1968 va_end(ap);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1969
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1970 if (aimutil_get16(command->data+2) == 0x0005)
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1971 change = 1;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1972
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1973 debug_printf("info%s: perms = %d, type = %x, length = %d, val = %s\n",
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1974 change ? " change" : "", perms, type, length, str ? val : "(not string)");
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1975
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1976 if ((type == 0x0011) && str) {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1977 g_snprintf(buf, sizeof(buf), "The email address for %s is %s", gc->username, val);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1978 do_error_dialog(buf, "Email");
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1979 }
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1980
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1981 return 1;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1982 }
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
1983
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1984 static void oscar_keepalive(struct gaim_connection *gc) {
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
1985 struct oscar_data *odata = (struct oscar_data *)gc->proto_data;
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
1986 aim_flap_nop(odata->sess, odata->conn);
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1987 }
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1988
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1989 static char *oscar_name() {
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1990 return "Oscar";
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1991 }
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1992
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1993 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
1994 struct oscar_data *odata = (struct oscar_data *)gc->proto_data;
1059
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
1995 struct direct_im *dim = find_direct_im(odata, name);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
1996 if (dim) {
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
1997 aim_send_im_direct(odata->sess, dim->conn, message);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
1998 } else {
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
1999 if (away)
1746
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2000 aim_send_im(odata->sess, odata->conn, name, AIM_IMFLAGS_AWAY, message,
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2001 strlen(message));
1059
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2002 else
1746
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2003 aim_send_im(odata->sess, odata->conn, name, AIM_IMFLAGS_ACK, message,
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2004 strlen(message));
1059
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2005 }
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2006 }
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2007
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2008 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
2009 struct oscar_data *odata = (struct oscar_data *)g->proto_data;
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
2010 aim_getinfo(odata->sess, odata->conn, name, AIM_GETINFO_GENERALINFO);
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2011 }
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2012
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2013 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
2014 struct oscar_data *odata = (struct oscar_data *)g->proto_data;
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
2015 aim_getinfo(odata->sess, odata->conn, name, AIM_GETINFO_AWAYMESSAGE);
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2016 }
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2017
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2018 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
2019 char *maiden, char *city, char *state, char *country, int web) {
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2020 /* 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
2021 struct oscar_data *odata = (struct oscar_data *)g->proto_data;
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
2022 aim_setdirectoryinfo(odata->sess, odata->conn, first, middle, last,
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2023 maiden, NULL, NULL, city, state, NULL, 0, web);
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2024 }
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2025
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2026
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2027 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
2028 struct oscar_data *odata = (struct oscar_data *)g->proto_data;
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
2029 aim_bos_setidle(odata->sess, odata->conn, time);
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2030 }
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2031
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2032 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
2033 struct oscar_data *odata = (struct oscar_data *)g->proto_data;
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2034 if (awaymessage)
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
2035 aim_bos_setprofile(odata->sess, odata->conn, info,
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2036 awaymessage->message, gaim_caps);
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2037 else
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
2038 aim_bos_setprofile(odata->sess, odata->conn, info,
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2039 NULL, gaim_caps);
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2040 }
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2041
1401
bf041349b11e [gaim-migrate @ 1411]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1384
diff changeset
2042 static void oscar_set_away(struct gaim_connection *g, char *state, char *message) {
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
2043 struct oscar_data *odata = (struct oscar_data *)g->proto_data;
1051
713b0e14e0a9 [gaim-migrate @ 1061]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1039
diff changeset
2044 aim_bos_setprofile(odata->sess, odata->conn, g->user->user_info, message, gaim_caps);
1404
96e93119268d [gaim-migrate @ 1414]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1401
diff changeset
2045 if (g->away)
96e93119268d [gaim-migrate @ 1414]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1401
diff changeset
2046 g_free (g->away);
96e93119268d [gaim-migrate @ 1414]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1401
diff changeset
2047 g->away = NULL;
96e93119268d [gaim-migrate @ 1414]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1401
diff changeset
2048 if (message)
96e93119268d [gaim-migrate @ 1414]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1401
diff changeset
2049 g->away = g_strdup (message);
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2050 }
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2051
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2052 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
2053 struct oscar_data *odata = (struct oscar_data *)g->proto_data;
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
2054 aim_send_warning(odata->sess, odata->conn, name, anon);
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2055 }
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2056
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2057 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
2058 char *maiden, char *city, char *state, char *country, char *email) {
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
2059 struct oscar_data *odata = (struct oscar_data *)g->proto_data;
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2060 if (strlen(email))
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
2061 aim_usersearch_address(odata->sess, odata->conn, email);
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2062 }
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2063
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2064 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
2065 struct oscar_data *odata = (struct oscar_data *)g->proto_data;
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
2066 aim_add_buddy(odata->sess, odata->conn, name);
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2067 }
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2068
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2069 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
2070 struct oscar_data *odata = (struct oscar_data *)g->proto_data;
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2071 char buf[MSG_LEN];
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2072 int n = 0;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2073 while (buddies) {
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2074 if (n > MSG_LEN - 18) {
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
2075 aim_bos_setbuddylist(odata->sess, odata->conn, buf);
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2076 n = 0;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2077 }
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2078 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
2079 buddies = buddies->next;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2080 }
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
2081 aim_bos_setbuddylist(odata->sess, odata->conn, buf);
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2082 }
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2083
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2084 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
2085 struct oscar_data *odata = (struct oscar_data *)g->proto_data;
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
2086 aim_remove_buddy(odata->sess, odata->conn, name);
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2087 }
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2088
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2089 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
2090 struct oscar_data *odata = (struct oscar_data *)g->proto_data;
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2091 struct aim_conn_t *cur = NULL;
1806
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2092 if (!name) {
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2093 if (!join_chat_entry || !join_chat_spin)
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2094 return;
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2095 name = gtk_entry_get_text(GTK_ENTRY(join_chat_entry));
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2096 exchange = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(join_chat_spin));
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2097 if (!name || !strlen(name))
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2098 return;
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2099 }
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
2100 debug_printf("Attempting to join chat room %s.\n", name);
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
2101 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
2102 debug_printf("chatnav exists, creating room\n");
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
2103 aim_chatnav_createroom(odata->sess, cur, name, exchange);
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2104 } else {
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2105 /* this gets tricky */
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
2106 debug_printf("chatnav does not exist, opening chatnav\n");
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
2107 odata->create_exchange = exchange;
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
2108 odata->create_name = g_strdup(name);
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
2109 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
2110 }
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 857
diff changeset
2111 }
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 857
diff changeset
2112
1806
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2113 static void des_jc()
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2114 {
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2115 join_chat_entry = NULL;
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2116 join_chat_spin = NULL;
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2117 }
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2118
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2119 static void oscar_draw_join_chat(struct gaim_connection *gc, GtkWidget *fbox) {
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2120 GtkWidget *label;
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2121 GtkWidget *rowbox;
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2122 GtkObject *adjust;
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2123
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2124 rowbox = gtk_hbox_new(FALSE, 5);
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2125 gtk_box_pack_start(GTK_BOX(fbox), rowbox, TRUE, TRUE, 0);
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2126 gtk_widget_show(rowbox);
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2127
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2128 label = gtk_label_new(_("Join what group:"));
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2129 gtk_box_pack_start(GTK_BOX(rowbox), label, FALSE, FALSE, 0);
1810
ad7759c19545 [gaim-migrate @ 1820]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1807
diff changeset
2130 gtk_signal_connect(GTK_OBJECT(label), "destroy", GTK_SIGNAL_FUNC(des_jc), NULL);
1806
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2131 gtk_widget_show(label);
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2132
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2133 join_chat_entry = gtk_entry_new();
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2134 gtk_box_pack_start(GTK_BOX(rowbox), join_chat_entry, TRUE, TRUE, 0);
1827
bb115612a2ed [gaim-migrate @ 1837]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1819
diff changeset
2135 gtk_widget_grab_focus(join_chat_entry);
1819
47e064712091 [gaim-migrate @ 1829]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1815
diff changeset
2136 gtk_signal_connect(GTK_OBJECT(join_chat_entry), "activate", GTK_SIGNAL_FUNC(do_join_chat), NULL);
1806
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2137 gtk_widget_show(join_chat_entry);
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2138
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2139 rowbox = gtk_hbox_new(FALSE, 5);
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2140 gtk_box_pack_start(GTK_BOX(fbox), rowbox, TRUE, TRUE, 0);
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2141 gtk_widget_show(rowbox);
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2142
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2143 label = gtk_label_new(_("Exchange:"));
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2144 gtk_box_pack_start(GTK_BOX(rowbox), label, FALSE, FALSE, 0);
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2145 gtk_widget_show(label);
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2146
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2147 adjust = gtk_adjustment_new(4, 4, 20, 1, 10, 10);
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2148 join_chat_spin = gtk_spin_button_new(GTK_ADJUSTMENT(adjust), 1, 0);
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2149 gtk_widget_set_usize(join_chat_spin, 50, -1);
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2150 gtk_box_pack_start(GTK_BOX(rowbox), join_chat_spin, FALSE, FALSE, 0);
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2151 gtk_widget_show(join_chat_spin);
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2152 }
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2153
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2154 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
2155 struct oscar_data *odata = (struct oscar_data *)g->proto_data;
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2156 GSList *bcs = g->buddy_chats;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2157 struct conversation *b = NULL;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2158
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2159 while (bcs) {
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2160 b = (struct conversation *)bcs->data;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2161 if (id == b->id)
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2162 break;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2163 bcs = bcs->next;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2164 b = NULL;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2165 }
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2166
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2167 if (!b)
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2168 return;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2169
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
2170 aim_chat_invite(odata->sess, odata->conn, name,
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2171 message ? message : "", 0x4, b->name, 0x0);
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2172 }
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2173
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2174 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
2175 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
2176 GSList *bcs = g->buddy_chats;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2177 struct conversation *b = NULL;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2178 struct chat_connection *c = NULL;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2179 int count = 0;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2180
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2181 while (bcs) {
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2182 count++;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2183 b = (struct conversation *)bcs->data;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2184 if (id == b->id)
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2185 break;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2186 bcs = bcs->next;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2187 b = NULL;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2188 }
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2189
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2190 if (!b)
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2191 return;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2192
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
2193 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
2194
1186
c00fc3adfd66 [gaim-migrate @ 1196]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1161
diff changeset
2195 c = find_oscar_chat(g, b->id);
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2196 if (c != NULL) {
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
2197 if (odata)
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
2198 odata->oscar_chats = g_slist_remove(odata->oscar_chats, c);
1667
b5635d882116 [gaim-migrate @ 1677]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1656
diff changeset
2199 if (c->inpa > 0)
b5635d882116 [gaim-migrate @ 1677]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1656
diff changeset
2200 gdk_input_remove(c->inpa);
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
2201 if (g && odata->sess)
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
2202 aim_conn_kill(odata->sess, &c->conn);
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2203 g_free(c->name);
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2204 g_free(c);
891
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 857
diff changeset
2205 }
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2206 /* 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
2207 serv_got_chat_left(g, b->id);
891
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 857
diff changeset
2208 }
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2209
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2210 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
2211 struct oscar_data *odata = (struct oscar_data *)g->proto_data;
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2212 struct aim_conn_t *cn;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2213 GSList *bcs = g->buddy_chats;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2214 struct conversation *b = NULL;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2215
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2216 while (bcs) {
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2217 b = (struct conversation *)bcs->data;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2218 if (id == b->id)
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2219 break;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2220 bcs = bcs->next;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2221 b = NULL;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2222 }
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2223 if (!b)
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2224 return;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2225
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
2226 cn = aim_chat_getconn(odata->sess, b->name);
1746
bacb77b0eb06 [gaim-migrate @ 1756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1735
diff changeset
2227 aim_chat_send_im(odata->sess, cn, 0, message, strlen(message));
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2228 }
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2229
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1020
diff changeset
2230 static char **oscar_list_icon(int uc) {
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1020
diff changeset
2231 if (uc & UC_UNAVAILABLE)
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1020
diff changeset
2232 return (char **)away_icon_xpm;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1020
diff changeset
2233 if (uc & UC_AOL)
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1020
diff changeset
2234 return (char **)aol_icon_xpm;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1020
diff changeset
2235 if (uc & UC_NORMAL)
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1020
diff changeset
2236 return (char **)free_icon_xpm;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1020
diff changeset
2237 if (uc & UC_ADMIN)
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1020
diff changeset
2238 return (char **)admin_icon_xpm;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1020
diff changeset
2239 if (uc & UC_UNCONFIRMED)
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1020
diff changeset
2240 return (char **)dt_icon_xpm;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1020
diff changeset
2241 return NULL;
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1020
diff changeset
2242 }
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1020
diff changeset
2243
1032
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
2244 static void oscar_info(GtkObject *obj, char *who) {
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
2245 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
2246 serv_get_info(gc, who);
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
2247 }
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
2248
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
2249 static void oscar_away_msg(GtkObject *obj, char *who) {
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
2250 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
2251 serv_get_away_msg(gc, who);
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
2252 }
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
2253
1059
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2254 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
2255 va_list ap;
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2256 struct gaim_connection *gc = sess->aux_data;
1059
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2257 struct oscar_data *od = (struct oscar_data *)gc->proto_data;
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2258 struct aim_directim_priv *priv;
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2259 struct aim_conn_t *newconn;
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2260 struct direct_im *dim;
1072
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1064
diff changeset
2261 char buf[256];
1059
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2262
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2263 va_start(ap, command);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2264 newconn = va_arg(ap, struct aim_conn_t *);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2265 va_end(ap);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2266
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2267 priv = (struct aim_directim_priv *)newconn->priv;
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2268
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2269 debug_printf("DirectIM: initiate success to %s\n", priv->sn);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2270 dim = find_direct_im(od, priv->sn);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2271
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2272 dim->cnv = find_conversation(priv->sn);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2273 if (!dim->cnv) dim->cnv = new_conversation(priv->sn);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2274 gtk_signal_connect(GTK_OBJECT(dim->cnv->window), "destroy",
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2275 GTK_SIGNAL_FUNC(delete_direct_im), dim);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2276 gdk_input_remove(dim->watcher);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2277 dim->conn = newconn;
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2278 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
2279 oscar_callback, dim->conn);
1735
00f74db70f2d [gaim-migrate @ 1745]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1710
diff changeset
2280 g_snprintf(buf, sizeof buf, _("Direct IM with %s established"), priv->sn);
1764
1e0613d9526b [gaim-migrate @ 1774]
Rob Flynn <gaim@robflynn.com>
parents: 1751
diff changeset
2281 write_to_conv(dim->cnv, buf, WFLAG_SYSTEM, NULL, time((time_t)NULL));
1059
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2282
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2283 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
2284 gaim_directim_incoming, 0);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2285 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
2286 gaim_directim_disconnect, 0);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2287 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
2288 gaim_directim_typing, 0);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2289
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2290 return 1;
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2291 }
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2292
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2293 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
2294 va_list ap;
1593
ec31e23aadc7 [gaim-migrate @ 1603]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1582
diff changeset
2295 char *msg = NULL;
1059
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2296 struct aim_conn_t *conn;
1593
ec31e23aadc7 [gaim-migrate @ 1603]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1582
diff changeset
2297 struct aim_directim_priv *priv;
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2298 struct gaim_connection *gc = sess->aux_data;
1059
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2299
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2300 va_start(ap, command);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2301 conn = va_arg(ap, struct aim_conn_t *);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2302 msg = va_arg(ap, char *);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2303 va_end(ap);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2304
1593
ec31e23aadc7 [gaim-migrate @ 1603]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1582
diff changeset
2305 if (!(priv = conn->priv)) {
ec31e23aadc7 [gaim-migrate @ 1603]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1582
diff changeset
2306 return -1;
ec31e23aadc7 [gaim-migrate @ 1603]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1582
diff changeset
2307 }
1059
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2308
1593
ec31e23aadc7 [gaim-migrate @ 1603]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1582
diff changeset
2309 debug_printf("Got DirectIM message from %s\n", priv->sn);
ec31e23aadc7 [gaim-migrate @ 1603]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1582
diff changeset
2310
1764
1e0613d9526b [gaim-migrate @ 1774]
Rob Flynn <gaim@robflynn.com>
parents: 1751
diff changeset
2311 serv_got_im(gc, priv->sn, msg, 0, time((time_t)NULL));
1059
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2312
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2313 return 1;
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2314 }
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2315
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2316 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
2317 va_list ap;
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2318 struct aim_conn_t *conn;
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2319 char *sn;
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2320 struct gaim_connection *gc = sess->aux_data;
1059
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2321 struct oscar_data *od = (struct oscar_data *)gc->proto_data;
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2322 struct direct_im *dim;
1072
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1064
diff changeset
2323 char buf[256];
1059
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2324
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2325 va_start(ap, command);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2326 conn = va_arg(ap, struct aim_conn_t *);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2327 sn = va_arg(ap, char *);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2328 va_end(ap);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2329
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2330 debug_printf("%s disconnected Direct IM.\n", sn);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2331
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2332 dim = find_direct_im(od, sn);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2333 od->direct_ims = g_slist_remove(od->direct_ims, dim);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2334 gdk_input_remove(dim->watcher);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2335 gtk_signal_disconnect_by_data(GTK_OBJECT(dim->cnv->window), dim);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2336
1735
00f74db70f2d [gaim-migrate @ 1745]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1710
diff changeset
2337 g_snprintf(buf, sizeof buf, _("Direct IM with %s closed"), sn);
1072
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1064
diff changeset
2338 if (dim->cnv)
1764
1e0613d9526b [gaim-migrate @ 1774]
Rob Flynn <gaim@robflynn.com>
parents: 1751
diff changeset
2339 write_to_conv(dim->cnv, buf, WFLAG_SYSTEM, NULL, time((time_t)NULL));
1059
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2340
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2341 aim_conn_kill(sess, &conn);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2342
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2343 return 1;
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2344 }
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2345
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2346 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
2347 va_list ap;
1593
ec31e23aadc7 [gaim-migrate @ 1603]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1582
diff changeset
2348 struct aim_conn_t *conn;
ec31e23aadc7 [gaim-migrate @ 1603]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1582
diff changeset
2349 struct aim_directim_priv *priv;
1059
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2350
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2351 va_start(ap, command);
1593
ec31e23aadc7 [gaim-migrate @ 1603]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1582
diff changeset
2352 conn = va_arg(ap, struct aim_conn_t *);
1059
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2353 va_end(ap);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2354
1593
ec31e23aadc7 [gaim-migrate @ 1603]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1582
diff changeset
2355 if (!(priv = conn->priv)) {
ec31e23aadc7 [gaim-migrate @ 1603]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1582
diff changeset
2356 return -1;
ec31e23aadc7 [gaim-migrate @ 1603]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1582
diff changeset
2357 }
ec31e23aadc7 [gaim-migrate @ 1603]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1582
diff changeset
2358
1059
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2359 /* I had to leave this. It's just too funny. It reminds me of my sister. */
1593
ec31e23aadc7 [gaim-migrate @ 1603]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1582
diff changeset
2360 debug_printf("ohmigod! %s has started typing (DirectIM). He's going to send you a message! *squeal*\n", priv->sn);
1059
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2361
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2362 return 1;
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2363 }
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2364
1380
638af9a58e39 [gaim-migrate @ 1390]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1370
diff changeset
2365 struct ask_do_dir_im {
638af9a58e39 [gaim-migrate @ 1390]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1370
diff changeset
2366 char *who;
638af9a58e39 [gaim-migrate @ 1390]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1370
diff changeset
2367 struct gaim_connection *gc;
638af9a58e39 [gaim-migrate @ 1390]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1370
diff changeset
2368 };
638af9a58e39 [gaim-migrate @ 1390]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1370
diff changeset
2369
638af9a58e39 [gaim-migrate @ 1390]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1370
diff changeset
2370 static void oscar_cancel_direct_im(GtkObject *obj, struct ask_do_dir_im *data) {
638af9a58e39 [gaim-migrate @ 1390]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1370
diff changeset
2371 g_free(data);
638af9a58e39 [gaim-migrate @ 1390]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1370
diff changeset
2372 }
638af9a58e39 [gaim-migrate @ 1390]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1370
diff changeset
2373
638af9a58e39 [gaim-migrate @ 1390]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1370
diff changeset
2374 static void oscar_direct_im(GtkObject *obj, struct ask_do_dir_im *data) {
638af9a58e39 [gaim-migrate @ 1390]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1370
diff changeset
2375 struct gaim_connection *gc = data->gc;
1059
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2376 struct oscar_data *od = (struct oscar_data *)gc->proto_data;
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2377 struct direct_im *dim;
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2378
1380
638af9a58e39 [gaim-migrate @ 1390]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1370
diff changeset
2379 dim = find_direct_im(od, data->who);
1059
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2380 if (dim) {
1064
b0b40b5faede [gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1060
diff changeset
2381 do_error_dialog("Direct IM request already pending.", "Unable");
1059
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2382 return;
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2383 }
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2384 dim = g_new0(struct direct_im, 1);
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2385 dim->gc = gc;
1380
638af9a58e39 [gaim-migrate @ 1390]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1370
diff changeset
2386 g_snprintf(dim->name, sizeof dim->name, "%s", data->who);
1059
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2387
1380
638af9a58e39 [gaim-migrate @ 1390]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1370
diff changeset
2388 dim->conn = aim_directim_initiate(od->sess, od->conn, NULL, data->who);
1072
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1064
diff changeset
2389 if (dim->conn != NULL) {
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1064
diff changeset
2390 od->direct_ims = g_slist_append(od->direct_ims, dim);
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1064
diff changeset
2391 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
2392 oscar_callback, dim->conn);
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1064
diff changeset
2393 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
2394 gaim_directim_initiate, 0);
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1064
diff changeset
2395 } else {
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1064
diff changeset
2396 do_error_dialog(_("Unable to open Direct IM"), _("Error"));
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1064
diff changeset
2397 g_free(dim);
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1064
diff changeset
2398 }
1059
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2399 }
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2400
1380
638af9a58e39 [gaim-migrate @ 1390]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1370
diff changeset
2401 static void oscar_ask_direct_im(GtkObject *m, gchar *who) {
638af9a58e39 [gaim-migrate @ 1390]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1370
diff changeset
2402 char buf[BUF_LONG];
638af9a58e39 [gaim-migrate @ 1390]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1370
diff changeset
2403 struct ask_do_dir_im *data = g_new0(struct ask_do_dir_im, 1);
638af9a58e39 [gaim-migrate @ 1390]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1370
diff changeset
2404 data->who = who;
638af9a58e39 [gaim-migrate @ 1390]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1370
diff changeset
2405 data->gc = gtk_object_get_user_data(m);
638af9a58e39 [gaim-migrate @ 1390]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1370
diff changeset
2406 g_snprintf(buf, sizeof(buf), _("You have selected to open a Direct IM connection with %s."
638af9a58e39 [gaim-migrate @ 1390]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1370
diff changeset
2407 " Doing this will let them see your IP address, and may be"
638af9a58e39 [gaim-migrate @ 1390]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1370
diff changeset
2408 " a security risk. Do you wish to continue?"), who);
638af9a58e39 [gaim-migrate @ 1390]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1370
diff changeset
2409 do_ask_dialog(buf, data, oscar_direct_im, oscar_cancel_direct_im);
638af9a58e39 [gaim-migrate @ 1390]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1370
diff changeset
2410 }
638af9a58e39 [gaim-migrate @ 1390]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1370
diff changeset
2411
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1435
diff changeset
2412 static void oscar_buddy_menu(GtkWidget *menu, struct gaim_connection *gc, char *who) {
1032
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
2413 GtkWidget *button;
1060
2c4f958c596e [gaim-migrate @ 1070]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1059
diff changeset
2414 char *n = g_strdup(normalize(gc->username));
1032
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
2415
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
2416 button = gtk_menu_item_new_with_label(_("Get Info"));
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
2417 gtk_signal_connect(GTK_OBJECT(button), "activate",
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
2418 GTK_SIGNAL_FUNC(oscar_info), who);
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
2419 gtk_object_set_user_data(GTK_OBJECT(button), gc);
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
2420 gtk_menu_append(GTK_MENU(menu), button);
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
2421 gtk_widget_show(button);
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
2422
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
2423 button = gtk_menu_item_new_with_label(_("Get Away Msg"));
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
2424 gtk_signal_connect(GTK_OBJECT(button), "activate",
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
2425 GTK_SIGNAL_FUNC(oscar_away_msg), who);
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
2426 gtk_object_set_user_data(GTK_OBJECT(button), gc);
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
2427 gtk_menu_append(GTK_MENU(menu), button);
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
2428 gtk_widget_show(button);
1059
6e60c69d4432 [gaim-migrate @ 1069]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1051
diff changeset
2429
1060
2c4f958c596e [gaim-migrate @ 1070]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1059
diff changeset
2430 if (strcmp(n, normalize(who))) {
2c4f958c596e [gaim-migrate @ 1070]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1059
diff changeset
2431 button = gtk_menu_item_new_with_label(_("Direct IM"));
2c4f958c596e [gaim-migrate @ 1070]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1059
diff changeset
2432 gtk_signal_connect(GTK_OBJECT(button), "activate",
1380
638af9a58e39 [gaim-migrate @ 1390]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1370
diff changeset
2433 GTK_SIGNAL_FUNC(oscar_ask_direct_im), who);
1060
2c4f958c596e [gaim-migrate @ 1070]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1059
diff changeset
2434 gtk_object_set_user_data(GTK_OBJECT(button), gc);
2c4f958c596e [gaim-migrate @ 1070]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1059
diff changeset
2435 gtk_menu_append(GTK_MENU(menu), button);
2c4f958c596e [gaim-migrate @ 1070]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1059
diff changeset
2436 gtk_widget_show(button);
2c4f958c596e [gaim-migrate @ 1070]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1059
diff changeset
2437 }
2c4f958c596e [gaim-migrate @ 1070]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1059
diff changeset
2438 g_free(n);
1032
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
2439 }
643a4d81c18a [gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
2440
1086
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2441
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2442 /* weeee */
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2443 static void oscar_print_option(GtkEntry *entry, struct aim_user *user) {
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2444 int entrynum;
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2445
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2446 entrynum = (int) gtk_object_get_user_data(GTK_OBJECT(entry));
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2447
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2448 if (entrynum == USEROPT_AUTH) {
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2449 g_snprintf(user->proto_opt[USEROPT_AUTH],
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2450 sizeof(user->proto_opt[USEROPT_AUTH]),
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2451 "%s", gtk_entry_get_text(entry));
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2452 } else if (entrynum == USEROPT_AUTHPORT) {
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2453 g_snprintf(user->proto_opt[USEROPT_AUTHPORT],
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2454 sizeof(user->proto_opt[USEROPT_AUTHPORT]),
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2455 "%s", gtk_entry_get_text(entry));
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2456 } else if (entrynum == USEROPT_SOCKSHOST) {
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2457 g_snprintf(user->proto_opt[USEROPT_SOCKSHOST],
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2458 sizeof(user->proto_opt[USEROPT_SOCKSHOST]),
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2459 "%s", gtk_entry_get_text(entry));
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2460 } else if (entrynum == USEROPT_SOCKSPORT) {
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2461 g_snprintf(user->proto_opt[USEROPT_SOCKSPORT],
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2462 sizeof(user->proto_opt[USEROPT_SOCKSPORT]),
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2463 "%s", gtk_entry_get_text(entry));
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2464 }
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2465 }
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2466
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2467 static void oscar_user_opts(GtkWidget *book, struct aim_user *user) {
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2468 /* so here, we create the new notebook page */
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2469 GtkWidget *vbox;
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2470 GtkWidget *hbox;
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2471 GtkWidget *label;
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2472 GtkWidget *entry;
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2473
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
2474 vbox = gtk_vbox_new(FALSE, 5);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
2475 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
1086
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2476 gtk_notebook_append_page(GTK_NOTEBOOK(book), vbox,
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2477 gtk_label_new("OSCAR Options"));
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2478 gtk_widget_show(vbox);
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2479
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
2480 hbox = gtk_hbox_new(FALSE, 5);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
2481 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
2482 gtk_widget_show(hbox);
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2483
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2484 label = gtk_label_new("Authorizer:");
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
2485 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
2486 gtk_widget_show(label);
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2487
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2488 entry = gtk_entry_new();
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
2489 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
2490 gtk_object_set_user_data(GTK_OBJECT(entry), (void *)USEROPT_AUTH);
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2491 gtk_signal_connect(GTK_OBJECT(entry), "changed",
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2492 GTK_SIGNAL_FUNC(oscar_print_option), user);
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2493 if (user->proto_opt[USEROPT_AUTH][0]) {
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2494 debug_printf("setting text %s\n", user->proto_opt[USEROPT_AUTH]);
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2495 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
2496 } else
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2497 gtk_entry_set_text(GTK_ENTRY(entry), "login.oscar.aol.com");
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2498 gtk_widget_show(entry);
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2499
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
2500 hbox = gtk_hbox_new(FALSE, 5);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
2501 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
2502 gtk_widget_show(hbox);
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2503
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2504 label = gtk_label_new("Authorizer Port:");
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
2505 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
2506 gtk_widget_show(label);
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2507
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2508 entry = gtk_entry_new();
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
2509 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
2510 gtk_object_set_user_data(GTK_OBJECT(entry), (void *)1);
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2511 gtk_signal_connect(GTK_OBJECT(entry), "changed",
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2512 GTK_SIGNAL_FUNC(oscar_print_option), user);
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2513 if (user->proto_opt[USEROPT_AUTHPORT][0]) {
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2514 debug_printf("setting text %s\n", user->proto_opt[USEROPT_AUTHPORT]);
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2515 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
2516 } else
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2517 gtk_entry_set_text(GTK_ENTRY(entry), "5190");
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2518 gtk_widget_show(entry);
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2519
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
2520 hbox = gtk_hbox_new(FALSE, 5);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
2521 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
2522 gtk_widget_show(hbox);
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2523
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2524 label = gtk_label_new("SOCKS5 Host:");
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
2525 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
2526 gtk_widget_show(label);
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2527
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2528 entry = gtk_entry_new();
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
2529 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
2530 gtk_object_set_user_data(GTK_OBJECT(entry), (void *)USEROPT_SOCKSHOST);
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2531 gtk_signal_connect(GTK_OBJECT(entry), "changed",
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2532 GTK_SIGNAL_FUNC(oscar_print_option), user);
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2533 if (user->proto_opt[USEROPT_SOCKSHOST][0]) {
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2534 debug_printf("setting text %s\n", user->proto_opt[USEROPT_SOCKSHOST]);
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2535 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
2536 }
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2537 gtk_widget_show(entry);
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2538
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
2539 hbox = gtk_hbox_new(FALSE, 5);
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
2540 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
2541 gtk_widget_show(hbox);
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2542
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2543 label = gtk_label_new("SOCKS5 Port:");
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
2544 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
2545 gtk_widget_show(label);
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2546
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2547 entry = gtk_entry_new();
1250
b5783215b245 [gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1247
diff changeset
2548 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
2549 gtk_object_set_user_data(GTK_OBJECT(entry), (void *)USEROPT_SOCKSPORT);
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2550 gtk_signal_connect(GTK_OBJECT(entry), "changed",
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2551 GTK_SIGNAL_FUNC(oscar_print_option), user);
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2552 if (user->proto_opt[USEROPT_SOCKSPORT][0]) {
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2553 debug_printf("setting text %s\n", user->proto_opt[USEROPT_SOCKSPORT]);
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2554 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
2555 }
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2556 gtk_widget_show(entry);
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2557 }
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2558
1147
65e0608e19f7 [gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1114
diff changeset
2559 static void oscar_set_permit_deny(struct gaim_connection *gc) {
65e0608e19f7 [gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1114
diff changeset
2560 struct oscar_data *od = (struct oscar_data *)gc->proto_data;
65e0608e19f7 [gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1114
diff changeset
2561 GSList *list;
65e0608e19f7 [gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1114
diff changeset
2562 char buf[MAXMSGLEN];
65e0608e19f7 [gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1114
diff changeset
2563 int at;
65e0608e19f7 [gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1114
diff changeset
2564
65e0608e19f7 [gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1114
diff changeset
2565 switch(gc->permdeny) {
65e0608e19f7 [gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1114
diff changeset
2566 case 1:
65e0608e19f7 [gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1114
diff changeset
2567 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
2568 break;
65e0608e19f7 [gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1114
diff changeset
2569 case 2:
65e0608e19f7 [gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1114
diff changeset
2570 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
2571 break;
65e0608e19f7 [gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1114
diff changeset
2572 case 3:
65e0608e19f7 [gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1114
diff changeset
2573 list = gc->permit;
1635
67060e06b234 [gaim-migrate @ 1645]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1633
diff changeset
2574 at = 0;
1147
65e0608e19f7 [gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1114
diff changeset
2575 while (list) {
1635
67060e06b234 [gaim-migrate @ 1645]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1633
diff changeset
2576 at += g_snprintf(buf + at, sizeof(buf) - at, "%s&", (char *)list->data);
1147
65e0608e19f7 [gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1114
diff changeset
2577 list = list->next;
65e0608e19f7 [gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1114
diff changeset
2578 }
65e0608e19f7 [gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1114
diff changeset
2579 aim_bos_changevisibility(od->sess, od->conn, AIM_VISIBILITYCHANGE_PERMITADD, buf);
65e0608e19f7 [gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1114
diff changeset
2580 break;
65e0608e19f7 [gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1114
diff changeset
2581 case 4:
65e0608e19f7 [gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1114
diff changeset
2582 list = gc->deny;
1635
67060e06b234 [gaim-migrate @ 1645]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1633
diff changeset
2583 at = 0;
1147
65e0608e19f7 [gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1114
diff changeset
2584 while (list) {
1635
67060e06b234 [gaim-migrate @ 1645]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1633
diff changeset
2585 at += g_snprintf(buf + at, sizeof(buf) - at, "%s&", (char *)list->data);
1147
65e0608e19f7 [gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1114
diff changeset
2586 list = list->next;
65e0608e19f7 [gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1114
diff changeset
2587 }
65e0608e19f7 [gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1114
diff changeset
2588 aim_bos_changevisibility(od->sess, od->conn, AIM_VISIBILITYCHANGE_DENYADD, buf);
65e0608e19f7 [gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1114
diff changeset
2589 break;
65e0608e19f7 [gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1114
diff changeset
2590 default:
65e0608e19f7 [gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1114
diff changeset
2591 break;
65e0608e19f7 [gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1114
diff changeset
2592 }
65e0608e19f7 [gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1114
diff changeset
2593 }
65e0608e19f7 [gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1114
diff changeset
2594
1635
67060e06b234 [gaim-migrate @ 1645]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1633
diff changeset
2595 static void oscar_add_permit(struct gaim_connection *gc, char *who) {
67060e06b234 [gaim-migrate @ 1645]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1633
diff changeset
2596 if (gc->permdeny != 3) return;
67060e06b234 [gaim-migrate @ 1645]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1633
diff changeset
2597 oscar_set_permit_deny(gc);
67060e06b234 [gaim-migrate @ 1645]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1633
diff changeset
2598 }
67060e06b234 [gaim-migrate @ 1645]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1633
diff changeset
2599
67060e06b234 [gaim-migrate @ 1645]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1633
diff changeset
2600 static void oscar_add_deny(struct gaim_connection *gc, char *who) {
67060e06b234 [gaim-migrate @ 1645]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1633
diff changeset
2601 if (gc->permdeny != 4) return;
67060e06b234 [gaim-migrate @ 1645]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1633
diff changeset
2602 oscar_set_permit_deny(gc);
67060e06b234 [gaim-migrate @ 1645]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1633
diff changeset
2603 }
67060e06b234 [gaim-migrate @ 1645]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1633
diff changeset
2604
67060e06b234 [gaim-migrate @ 1645]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1633
diff changeset
2605 static void oscar_rem_permit(struct gaim_connection *gc, char *who) {
67060e06b234 [gaim-migrate @ 1645]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1633
diff changeset
2606 if (gc->permdeny != 3) return;
67060e06b234 [gaim-migrate @ 1645]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1633
diff changeset
2607 oscar_set_permit_deny(gc);
67060e06b234 [gaim-migrate @ 1645]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1633
diff changeset
2608 }
67060e06b234 [gaim-migrate @ 1645]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1633
diff changeset
2609
67060e06b234 [gaim-migrate @ 1645]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1633
diff changeset
2610 static void oscar_rem_deny(struct gaim_connection *gc, char *who) {
67060e06b234 [gaim-migrate @ 1645]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1633
diff changeset
2611 if (gc->permdeny != 4) return;
67060e06b234 [gaim-migrate @ 1645]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1633
diff changeset
2612 oscar_set_permit_deny(gc);
67060e06b234 [gaim-migrate @ 1645]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1633
diff changeset
2613 }
67060e06b234 [gaim-migrate @ 1645]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1633
diff changeset
2614
1333
b332d8f46b84 [gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1315
diff changeset
2615 static void oscar_draw_new_user(GtkWidget *box)
b332d8f46b84 [gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1315
diff changeset
2616 {
b332d8f46b84 [gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1315
diff changeset
2617 GtkWidget *label;
b332d8f46b84 [gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1315
diff changeset
2618
b332d8f46b84 [gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1315
diff changeset
2619 label = gtk_label_new(_("Unfortunately, currently Oscar only allows new user registration by "
b332d8f46b84 [gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1315
diff changeset
2620 "going to http://aim.aol.com/aimnew/Aim/register.adp?promo=106723&pageset=Aim&client=no"
b332d8f46b84 [gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1315
diff changeset
2621 ". Clicking the Register button will open the URL for you."));
b332d8f46b84 [gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1315
diff changeset
2622 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
b332d8f46b84 [gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1315
diff changeset
2623 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5);
b332d8f46b84 [gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1315
diff changeset
2624 gtk_widget_show(label);
b332d8f46b84 [gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1315
diff changeset
2625 }
b332d8f46b84 [gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1315
diff changeset
2626
b332d8f46b84 [gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1315
diff changeset
2627 static void oscar_do_new_user()
b332d8f46b84 [gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1315
diff changeset
2628 {
b332d8f46b84 [gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1315
diff changeset
2629 open_url(NULL, "http://aim.aol.com/aimnew/Aim/register.adp?promo=106723&pageset=Aim&client=no");
b332d8f46b84 [gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1315
diff changeset
2630 }
b332d8f46b84 [gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1315
diff changeset
2631
1401
bf041349b11e [gaim-migrate @ 1411]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1384
diff changeset
2632 static GList *oscar_away_states()
bf041349b11e [gaim-migrate @ 1411]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1384
diff changeset
2633 {
bf041349b11e [gaim-migrate @ 1411]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1384
diff changeset
2634 return g_list_append(NULL, GAIM_AWAY_CUSTOM);
bf041349b11e [gaim-migrate @ 1411]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1384
diff changeset
2635 }
bf041349b11e [gaim-migrate @ 1411]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1384
diff changeset
2636
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1435
diff changeset
2637 static void oscar_do_action(struct gaim_connection *gc, char *act)
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1435
diff changeset
2638 {
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2639 struct oscar_data *od = gc->proto_data;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2640
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1435
diff changeset
2641 if (!strcmp(act, "Set User Info")) {
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1435
diff changeset
2642 show_set_info(gc);
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2643 } else if (!strcmp(act, "Change Password")) {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2644 show_change_passwd(gc);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2645 } else if (!strcmp(act, "Confirm Account")) {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2646 if (od->paspa == 0) {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2647 od->conf = TRUE;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2648 aim_bos_reqservice(od->sess, od->conn, AIM_CONN_TYPE_AUTH);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2649 } else
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2650 aim_auth_reqconfirm(od->sess, aim_getconn_type(od->sess, AIM_CONN_TYPE_AUTH));
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2651 } else if (!strcmp(act, "Change Email")) {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2652 } else if (!strcmp(act, "Display Current Registered Address")) {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2653 if (od->paspa == 0) {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2654 od->reqemail = TRUE;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2655 aim_bos_reqservice(od->sess, od->conn, AIM_CONN_TYPE_AUTH);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2656 } else
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2657 aim_auth_getinfo(od->sess, aim_getconn_type(od->sess, AIM_CONN_TYPE_AUTH), 0x11);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2658 } else if (!strcmp(act, "Search for Buddy by Email")) {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2659 show_find_email(gc);
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1435
diff changeset
2660 }
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1435
diff changeset
2661 }
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1435
diff changeset
2662
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1435
diff changeset
2663 static GList *oscar_actions()
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1435
diff changeset
2664 {
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1435
diff changeset
2665 GList *m = NULL;
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1435
diff changeset
2666
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1435
diff changeset
2667 m = g_list_append(m, "Set User Info");
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2668 m = g_list_append(m, NULL);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2669 m = g_list_append(m, "Change Password");
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2670 m = g_list_append(m, "Confirm Account");
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2671 /*
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2672 m = g_list_append(m, "Change Email");
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2673 */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2674 m = g_list_append(m, "Display Current Registered Address");
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2675 m = g_list_append(m, NULL);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2676 m = g_list_append(m, "Search for Buddy by Email");
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1435
diff changeset
2677
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1435
diff changeset
2678 return m;
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1435
diff changeset
2679 }
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1435
diff changeset
2680
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2681 static void oscar_change_passwd(struct gaim_connection *gc, char *old, char *new)
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2682 {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2683 struct oscar_data *od = gc->proto_data;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2684 if (od->paspa == 0) {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2685 od->chpass = TRUE;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2686 od->oldp = g_strdup(old);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2687 od->newp = g_strdup(new);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2688 aim_bos_reqservice(od->sess, od->conn, AIM_CONN_TYPE_AUTH);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2689 } else {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2690 aim_auth_changepasswd(od->sess, aim_getconn_type(od->sess, AIM_CONN_TYPE_AUTH),
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2691 new, old);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2692 }
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2693 }
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2694
1000
91b7377e7b45 [gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
2695 void oscar_init(struct prpl *ret) {
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2696 ret->protocol = PROTO_OSCAR;
1435
f16e17d42b43 [gaim-migrate @ 1445]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1404
diff changeset
2697 ret->options = OPT_PROTO_HTML | OPT_PROTO_CORRECT_TIME;
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2698 ret->name = oscar_name;
1030
38452403563b [gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1020
diff changeset
2699 ret->list_icon = oscar_list_icon;
1401
bf041349b11e [gaim-migrate @ 1411]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1384
diff changeset
2700 ret->away_states = oscar_away_states;
1499
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1435
diff changeset
2701 ret->actions = oscar_actions;
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1435
diff changeset
2702 ret->do_action = oscar_do_action;
de0b946e86a4 [gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1435
diff changeset
2703 ret->buddy_menu = oscar_buddy_menu;
1086
ce201056e7a6 [gaim-migrate @ 1096]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1082
diff changeset
2704 ret->user_opts = oscar_user_opts;
1333
b332d8f46b84 [gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1315
diff changeset
2705 ret->draw_new_user = oscar_draw_new_user;
b332d8f46b84 [gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1315
diff changeset
2706 ret->do_new_user = oscar_do_new_user;
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2707 ret->login = oscar_login;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2708 ret->close = oscar_close;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2709 ret->send_im = oscar_send_im;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2710 ret->set_info = oscar_set_info;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2711 ret->get_info = oscar_get_info;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2712 ret->set_away = oscar_set_away;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2713 ret->get_away_msg = oscar_get_away_msg;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2714 ret->set_dir = oscar_set_dir;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2715 ret->get_dir = NULL; /* Oscar really doesn't have this */
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2716 ret->dir_search = oscar_dir_search;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2717 ret->set_idle = oscar_set_idle;
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1534
diff changeset
2718 ret->change_passwd = oscar_change_passwd;
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2719 ret->add_buddy = oscar_add_buddy;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2720 ret->add_buddies = oscar_add_buddies;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2721 ret->remove_buddy = oscar_remove_buddy;
1147
65e0608e19f7 [gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1114
diff changeset
2722 ret->add_permit = oscar_add_permit;
65e0608e19f7 [gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1114
diff changeset
2723 ret->add_deny = oscar_add_deny;
65e0608e19f7 [gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1114
diff changeset
2724 ret->rem_permit = oscar_rem_permit;
65e0608e19f7 [gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1114
diff changeset
2725 ret->rem_deny = oscar_rem_deny;
65e0608e19f7 [gaim-migrate @ 1157]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1114
diff changeset
2726 ret->set_permit_deny = oscar_set_permit_deny;
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2727 ret->warn = oscar_warn;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2728 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
2729 ret->join_chat = oscar_join_chat;
1806
c649b63382b7 [gaim-migrate @ 1816]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1796
diff changeset
2730 ret->draw_join_chat = oscar_draw_join_chat;
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2731 ret->chat_invite = oscar_chat_invite;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2732 ret->chat_leave = oscar_chat_leave;
1534
d98b92e3d9ff [gaim-migrate @ 1544]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1499
diff changeset
2733 ret->chat_whisper = NULL;
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2734 ret->chat_send = oscar_chat_send;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2735 ret->keepalive = oscar_keepalive;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
2736 }