annotate src/oscar.c @ 1015:c3579d03a0c1

[gaim-migrate @ 1025] damn i'm smooth. no more 100% cpu usage! yay! :) committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sat, 21 Oct 2000 09:56:16 +0000
parents 1d8f05ea6bdf
children 661ac77ccd1b
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
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
23 #ifndef DYNAMIC_OSCAR
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
24
349
b402a23f35df [gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 338
diff changeset
25 #ifdef HAVE_CONFIG_H
b402a23f35df [gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 338
diff changeset
26 #include "../config.h"
b402a23f35df [gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 338
diff changeset
27 #endif
b402a23f35df [gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 338
diff changeset
28
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
29
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
30 #include <netdb.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
31 #include <gtk/gtk.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
32 #include <unistd.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
33 #include <errno.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
34 #include <netinet/in.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
35 #include <arpa/inet.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
36 #include <string.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
37 #include <stdlib.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
38 #include <stdio.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
39 #include <time.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
40 #include <sys/socket.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
41 #include <sys/stat.h>
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
42 #include "multi.h"
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
43 #include "prpl.h"
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
44 #include "gaim.h"
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
45 #include "aim.h"
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
46 #include "gnome_applet_mgr.h"
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
47
526
5bf71b39cba2 [gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
48 #include "pixmaps/cancel.xpm"
5bf71b39cba2 [gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
49 #include "pixmaps/ok.xpm"
5bf71b39cba2 [gaim-migrate @ 536]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 523
diff changeset
50
369
cf895313fc50 [gaim-migrate @ 379]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
51 int gaim_caps = AIM_CAPS_CHAT | AIM_CAPS_SENDFILE | AIM_CAPS_GETFILE |
cf895313fc50 [gaim-migrate @ 379]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
52 AIM_CAPS_VOICE | AIM_CAPS_IMIMAGE | AIM_CAPS_BUDDYICON;
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
53
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
54 struct oscar_data {
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
55 struct aim_session_t *sess;
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
56 struct aim_conn_t *conn;
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
57
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
58 int cnpa;
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
59 int paspa;
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
60
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
61 int create_exchange;
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
62 char *create_name;
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
63
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
64 GSList *oscar_chats;
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
65 };
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
66
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
67 struct chat_connection *find_oscar_chat(struct gaim_connection *gc, char *name) {
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
68 GSList *g = ((struct oscar_data *)gc->proto_data)->oscar_chats;
312
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
69 struct chat_connection *c = NULL;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
70 if (gc->protocol != PROTO_OSCAR) return NULL;
312
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
71
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
72 while (g) {
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
73 c = (struct chat_connection *)g->data;
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
74 if (!strcmp(name, c->name))
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
75 break;
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
76 g = g->next;
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
77 c = NULL;
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
78 }
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
79
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
80 return c;
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
81 }
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
82
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
83 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
84 struct aim_conn_t *conn) {
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
85 GSList *g = ((struct oscar_data *)gc->proto_data)->oscar_chats;
833
8d8ef8c3afe2 [gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
86 struct chat_connection *c = NULL;
8d8ef8c3afe2 [gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
87
8d8ef8c3afe2 [gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
88 while (g) {
8d8ef8c3afe2 [gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
89 c = (struct chat_connection *)g->data;
8d8ef8c3afe2 [gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
90 if (c->conn == conn)
8d8ef8c3afe2 [gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
91 break;
8d8ef8c3afe2 [gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
92 g = g->next;
8d8ef8c3afe2 [gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
93 c = NULL;
8d8ef8c3afe2 [gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
94 }
8d8ef8c3afe2 [gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
95
8d8ef8c3afe2 [gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
96 return c;
8d8ef8c3afe2 [gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
97 }
8d8ef8c3afe2 [gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
98
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
99 static struct gaim_connection *find_gaim_conn_by_aim_sess(struct aim_session_t *sess) {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
100 GSList *g = connections;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
101 struct gaim_connection *gc = NULL;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
102
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
103 while (g) {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
104 gc = (struct gaim_connection *)g->data;
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
105 if (sess == ((struct oscar_data *)gc->proto_data)->sess)
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
106 break;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
107 g = g->next;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
108 gc = NULL;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
109 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
110
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
111 return gc;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
112 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
113
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
114 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
115 GSList *g = connections;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
116 struct gaim_connection *c = NULL;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
117 struct aim_conn_t *s;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
118 while (g) {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
119 c = (struct gaim_connection *)g->data;
965
50f2977537d8 [gaim-migrate @ 975]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 964
diff changeset
120 if (c->protocol != PROTO_OSCAR) {
50f2977537d8 [gaim-migrate @ 975]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 964
diff changeset
121 c = NULL;
50f2977537d8 [gaim-migrate @ 975]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 964
diff changeset
122 g = g->next;
50f2977537d8 [gaim-migrate @ 975]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 964
diff changeset
123 continue;
50f2977537d8 [gaim-migrate @ 975]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 964
diff changeset
124 }
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
125 s = ((struct oscar_data *)c->proto_data)->sess->connlist;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
126 while (s) {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
127 if (conn == s)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
128 break;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
129 s = s->next;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
130 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
131 if (s) break;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
132 g = g->next;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
133 c = NULL;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
134 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
135
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
136 return c;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
137 }
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
138
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
139 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
140 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
141 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
142 static int gaim_handle_redirect (struct aim_session_t *, struct command_rx_struct *, ...);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
143 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
144 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
145 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
146 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
147 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
148 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
149 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
150 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
151 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
152 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
153 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
154 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
155 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
156 static int gaim_parse_evilnotify (struct aim_session_t *, struct command_rx_struct *, ...);
829
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
157 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
158 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
159 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
160 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
161 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
162 static int gaim_parse_locerr (struct aim_session_t *, struct command_rx_struct *, ...);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
163
836
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
164 static char *msgerrreason[] = {
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
165 "Invalid error",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
166 "Invalid SNAC",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
167 "Rate to host",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
168 "Rate to client",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
169 "Not logged in",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
170 "Service unavailable",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
171 "Service not defined",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
172 "Obsolete SNAC",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
173 "Not supported by host",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
174 "Not supported by client",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
175 "Refused by client",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
176 "Reply too big",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
177 "Responses lost",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
178 "Request denied",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
179 "Busted SNAC payload",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
180 "Insufficient rights",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
181 "In local permit/deny",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
182 "Too evil (sender)",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
183 "Too evil (receiver)",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
184 "User temporarily unavailable",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
185 "No match",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
186 "List overflow",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
187 "Request ambiguous",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
188 "Queue full",
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
189 "Not while on AOL"
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
190 };
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
191 static int msgerrreasonlen = 25;
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
192
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
193 static void oscar_callback(gpointer data, gint source,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
194 GdkInputCondition condition) {
288
6e609d42f767 [gaim-migrate @ 298]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 283
diff changeset
195 struct aim_conn_t *conn = (struct aim_conn_t *)data;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
196 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
197 struct oscar_data *odata = (struct oscar_data *)gc->proto_data;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
198 if (!gc) {
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
199 /* 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
200 * is return? */
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
201 debug_print("oscar callback for closed connection.\n");
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
202 return;
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
203 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
204
259
e159ba2486fc [gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 253
diff changeset
205 if (condition & GDK_INPUT_EXCEPTION) {
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 981
diff changeset
206 hide_login_progress(gc, _("Disconnected."));
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
207 signoff(gc);
259
e159ba2486fc [gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 253
diff changeset
208 return;
e159ba2486fc [gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 253
diff changeset
209 }
e159ba2486fc [gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 253
diff changeset
210 if (condition & GDK_INPUT_READ) {
503
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
211 if (conn->type == AIM_CONN_TYPE_RENDEZVOUS_OUT) {
515
b33ed0a7f49b [gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 513
diff changeset
212 debug_print("got information on rendezvous\n");
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
213 if (aim_handlerendconnect(odata->sess, conn) < 0) {
503
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
214 debug_print(_("connection error (rend)\n"));
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
215 }
259
e159ba2486fc [gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 253
diff changeset
216 } else {
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
217 if (aim_get_command(odata->sess, conn) >= 0) {
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
218 aim_rxdispatch(odata->sess);
503
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
219 } else {
1002
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1000
diff changeset
220 if ((conn->type == AIM_CONN_TYPE_BOS) ||
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
221 !(aim_getconn_type(odata->sess, AIM_CONN_TYPE_BOS))) {
503
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
222 debug_print(_("major connection error\n"));
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 981
diff changeset
223 hide_login_progress(gc, _("Disconnected."));
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
224 signoff(gc);
747
eec93c5929b9 [gaim-migrate @ 757]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 746
diff changeset
225 } else if (conn->type == AIM_CONN_TYPE_CHAT) {
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
226 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
227 char buf[BUF_LONG];
8d8ef8c3afe2 [gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
228 sprintf(debug_buff, "disconnected from chat room %s\n", c->name);
8d8ef8c3afe2 [gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
229 debug_print(debug_buff);
8d8ef8c3afe2 [gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
230 c->conn = NULL;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
231 if (c->inpa > -1)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
232 gdk_input_remove(c->inpa);
833
8d8ef8c3afe2 [gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
233 c->inpa = -1;
8d8ef8c3afe2 [gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
234 c->fd = -1;
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
235 aim_conn_kill(odata->sess, &conn);
833
8d8ef8c3afe2 [gaim-migrate @ 843]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 829
diff changeset
236 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
237 do_error_dialog(buf, _("Chat Error!"));
828
4c71c0e7f04e [gaim-migrate @ 838]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 812
diff changeset
238 } else if (conn->type == AIM_CONN_TYPE_CHATNAV) {
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
239 if (odata->cnpa > -1)
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
240 gdk_input_remove(odata->cnpa);
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
241 odata->cnpa = -1;
828
4c71c0e7f04e [gaim-migrate @ 838]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 812
diff changeset
242 debug_print("removing chatnav input watcher\n");
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
243 aim_conn_kill(odata->sess, &conn);
695
d3db515e9a6e [gaim-migrate @ 705]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 694
diff changeset
244 } else {
794
80274f969a09 [gaim-migrate @ 804]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 788
diff changeset
245 sprintf(debug_buff, "holy crap! generic connection error! %d\n",
80274f969a09 [gaim-migrate @ 804]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 788
diff changeset
246 conn->type);
80274f969a09 [gaim-migrate @ 804]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 788
diff changeset
247 debug_print(debug_buff);
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
248 aim_conn_kill(odata->sess, &conn);
503
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
249 }
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
250 }
259
e159ba2486fc [gaim-migrate @ 269]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 253
diff changeset
251 }
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
252 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
253 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
254
980
82c5865f7cfe [gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 975
diff changeset
255 void oscar_login(struct aim_user *user) {
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
256 struct aim_session_t *sess;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
257 struct aim_conn_t *conn;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
258 char buf[256];
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 981
diff changeset
259 struct gaim_connection *gc = new_gaim_conn(PROTO_OSCAR, user->username, user->password);
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
260 struct oscar_data *odata = gc->proto_data = g_new0(struct oscar_data, 1);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
261
980
82c5865f7cfe [gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 975
diff changeset
262 sprintf(debug_buff, _("Logging in %s\n"), user->username);
302
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
263 debug_print(debug_buff);
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
264
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
265 sess = g_new0(struct aim_session_t, 1);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
266 aim_session_init(sess);
279
501e09c51cbc [gaim-migrate @ 289]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 277
diff changeset
267 /* 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
268 * see if things need to be sent. */
501e09c51cbc [gaim-migrate @ 289]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 277
diff changeset
269 sess->tx_enqueue = &aim_tx_enqueue__immediate;
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
270 odata->sess = sess;
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
271
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
272 sprintf(buf, _("Looking up %s"), FAIM_LOGIN_SERVER);
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 981
diff changeset
273 set_login_progress(gc, 1, buf);
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 981
diff changeset
274 /* this creates a possible race condition, but hey, what can you do */
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 981
diff changeset
275 while (gtk_events_pending())
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 981
diff changeset
276 gtk_main_iteration();
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
277 conn = aim_newconn(sess, AIM_CONN_TYPE_AUTH, FAIM_LOGIN_SERVER);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
278
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
279 if (conn == NULL) {
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
280 debug_print(_("internal connection error\n"));
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 981
diff changeset
281 hide_login_progress(gc, _("Unable to login to AIM"));
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
282 destroy_gaim_conn(gc);
980
82c5865f7cfe [gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 975
diff changeset
283 return;
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
284 } else if (conn->fd == -1) {
975
a45991891aba [gaim-migrate @ 985]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 971
diff changeset
285 if (conn->status & AIM_CONN_STATUS_RESOLVERR) {
a45991891aba [gaim-migrate @ 985]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 971
diff changeset
286 sprintf(debug_buff, _("couldn't resolve host"));
a45991891aba [gaim-migrate @ 985]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 971
diff changeset
287 debug_print(debug_buff); debug_print("\n");
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 981
diff changeset
288 hide_login_progress(gc, debug_buff);
975
a45991891aba [gaim-migrate @ 985]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 971
diff changeset
289 } else if (conn->status & AIM_CONN_STATUS_CONNERR) {
a45991891aba [gaim-migrate @ 985]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 971
diff changeset
290 sprintf(debug_buff, _("couldn't connect to host"));
a45991891aba [gaim-migrate @ 985]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 971
diff changeset
291 debug_print(debug_buff); debug_print("\n");
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 981
diff changeset
292 hide_login_progress(gc, debug_buff);
975
a45991891aba [gaim-migrate @ 985]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 971
diff changeset
293 }
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
294 destroy_gaim_conn(gc);
980
82c5865f7cfe [gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 975
diff changeset
295 return;
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
296 }
980
82c5865f7cfe [gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 975
diff changeset
297 g_snprintf(buf, sizeof(buf), _("Signon: %s"), gc->username);
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 981
diff changeset
298 set_login_progress(gc, 2, buf);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
299
741
58a6e6e26695 [gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 736
diff changeset
300 aim_conn_addhandler(sess, conn, 0x0017, 0x0007, gaim_parse_login, 0);
58a6e6e26695 [gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 736
diff changeset
301 aim_conn_addhandler(sess, conn, 0x0017, 0x0003, gaim_parse_auth_resp, 0);
58a6e6e26695 [gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 736
diff changeset
302 aim_sendconnack(sess, conn);
980
82c5865f7cfe [gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 975
diff changeset
303 aim_request_login(sess, conn, gc->username);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
304
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
305 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
306 oscar_callback, conn);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
307
980
82c5865f7cfe [gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 975
diff changeset
308 sprintf(gc->user_info, "%s", user->user_info);
82c5865f7cfe [gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 975
diff changeset
309 gc->options = user->options;
82c5865f7cfe [gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 975
diff changeset
310 save_prefs(); /* is this necessary anymore? */
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
311
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
312 debug_print(_("Password sent, waiting for response\n"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
313 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
314
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
315 void oscar_close(struct gaim_connection *gc) {
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
316 struct oscar_data *odata = (struct oscar_data *)gc->proto_data;
1015
c3579d03a0c1 [gaim-migrate @ 1025]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
317 GSList *c = odata->oscar_chats;
c3579d03a0c1 [gaim-migrate @ 1025]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
318 struct chat_connection *n;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
319 if (gc->protocol != PROTO_OSCAR) return;
1015
c3579d03a0c1 [gaim-migrate @ 1025]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
320
c3579d03a0c1 [gaim-migrate @ 1025]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
321 while (c) {
c3579d03a0c1 [gaim-migrate @ 1025]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
322 n = (struct chat_connection *)c->data;
c3579d03a0c1 [gaim-migrate @ 1025]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
323 gdk_input_remove(n->inpa);
c3579d03a0c1 [gaim-migrate @ 1025]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
324 g_free(n->name);
c3579d03a0c1 [gaim-migrate @ 1025]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
325 g_free(n);
c3579d03a0c1 [gaim-migrate @ 1025]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
326 c = c->next;
c3579d03a0c1 [gaim-migrate @ 1025]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
327 }
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
328 if (gc->inpa > 0)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
329 gdk_input_remove(gc->inpa);
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
330 if (odata->cnpa > 0)
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
331 gdk_input_remove(odata->cnpa);
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
332 if (odata->paspa > 0)
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
333 gdk_input_remove(odata->paspa);
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
334 aim_logoff(odata->sess);
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
335 g_free(odata->sess);
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
336 g_free(gc->proto_data);
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
337 debug_print(_("Signed off.\n"));
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
338 }
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
339
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
340 int gaim_parse_auth_resp(struct aim_session_t *sess,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
341 struct command_rx_struct *command, ...) {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
342 struct aim_conn_t *bosconn = NULL;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
343 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
344 sprintf(debug_buff, "inside auth_resp (Screen name: %s)\n",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
345 sess->logininfo.screen_name);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
346 debug_print(debug_buff);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
347
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
348 if (sess->logininfo.errorcode) {
302
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
349 switch (sess->logininfo.errorcode) {
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
350 case 0x18:
392
df5127560034 [gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 388
diff changeset
351 /* connecting too frequently */
836
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
352 do_error_dialog(_("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."), _("Gaim - Error"));
1000
91b7377e7b45 [gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
353 plugin_event(event_error, (void *)983, 0, 0, 0);
302
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
354 break;
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
355 case 0x05:
392
df5127560034 [gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 388
diff changeset
356 /* Incorrect nick/password */
836
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
357 do_error_dialog(_("Incorrect nickname or password."), _("Gaim - Error"));
1000
91b7377e7b45 [gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
358 plugin_event(event_error, (void *)980, 0, 0, 0);
302
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
359 break;
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
360 case 0x1c:
392
df5127560034 [gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 388
diff changeset
361 /* client too old */
836
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
362 do_error_dialog(_("The client version you are using is too old. Please upgrade at http://www.marko.net/gaim/"), _("Gaim - Error"));
1000
91b7377e7b45 [gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
363 plugin_event(event_error, (void *)989, 0, 0, 0);
302
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
364 break;
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
365 }
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
366 sprintf(debug_buff, "Login Error Code 0x%04x\n",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
367 sess->logininfo.errorcode);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
368 debug_print(debug_buff);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
369 sprintf(debug_buff, "Error URL: %s\n",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
370 sess->logininfo.errorurl);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
371 debug_print(debug_buff);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
372 #ifdef USE_APPLET
746
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 744
diff changeset
373 set_user_state(offline);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
374 #endif
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
375 gdk_input_remove(gc->inpa);
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 981
diff changeset
376 hide_login_progress(gc, _("Authentication Failed"));
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
377 signoff(gc);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
378 return 0;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
379 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
380
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
381
946
acd4d81f2afc [gaim-migrate @ 956]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 930
diff changeset
382 if (sess->logininfo.email) {
acd4d81f2afc [gaim-migrate @ 956]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 930
diff changeset
383 sprintf(debug_buff, "Email: %s\n", sess->logininfo.email);
acd4d81f2afc [gaim-migrate @ 956]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 930
diff changeset
384 debug_print(debug_buff);
acd4d81f2afc [gaim-migrate @ 956]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 930
diff changeset
385 } else {
acd4d81f2afc [gaim-migrate @ 956]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 930
diff changeset
386 debug_print("Email is NULL\n");
acd4d81f2afc [gaim-migrate @ 956]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 930
diff changeset
387 }
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
388 sprintf(debug_buff, "Closing auth connection...\n");
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
389 debug_print(debug_buff);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
390 gdk_input_remove(gc->inpa);
338
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 335
diff changeset
391 aim_conn_kill(sess, &command->conn);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
392
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
393 bosconn = aim_newconn(sess, AIM_CONN_TYPE_BOS, sess->logininfo.BOSIP);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
394 if (bosconn == NULL) {
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
395 #ifdef USE_APPLET
746
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 744
diff changeset
396 set_user_state(offline);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
397 #endif
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 981
diff changeset
398 hide_login_progress(gc, _("Internal Error"));
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
399 destroy_gaim_conn(gc);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
400 return -1;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
401 } else if (bosconn->status != 0) {
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
402 #ifdef USE_APPLET
746
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 744
diff changeset
403 set_user_state(offline);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
404 #endif
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 981
diff changeset
405 hide_login_progress(gc, _("Could Not Connect"));
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
406 destroy_gaim_conn(gc);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
407 return -1;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
408 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
409
829
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
410 aim_conn_addhandler(sess, bosconn, 0x0009, 0x0003, gaim_bosrights, 0);
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
411 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
412 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
413 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
414 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
415 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
416 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
417 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
418 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
419 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
420 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
421 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
422 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
423 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
424 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_GEN, AIM_CB_GEN_EVIL, gaim_parse_evilnotify, 0);
836
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
425 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
426 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
427 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_MSG, AIM_CB_MSG_ACK, gaim_parse_msgack, 0);
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
428 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_CTN, AIM_CB_CTN_DEFAULT, aim_parse_unknown, 0);
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
429 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_DEFAULT, aim_parse_unknown, 0);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
430 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_GEN, AIM_CB_GEN_MOTD, gaim_parse_motd, 0);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
431
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
432 aim_auth_sendcookie(sess, bosconn, sess->logininfo.cookie);
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
433 ((struct oscar_data *)gc->proto_data)->conn = bosconn;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
434 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
435 oscar_callback, bosconn);
988
9523b772e546 [gaim-migrate @ 998]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 981
diff changeset
436 set_login_progress(gc, 4, _("Connection established, cookie sent"));
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
437 return 1;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
438 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
439
741
58a6e6e26695 [gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 736
diff changeset
440 int gaim_parse_login(struct aim_session_t *sess,
58a6e6e26695 [gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 736
diff changeset
441 struct command_rx_struct *command, ...) {
857
41bfae606d39 [gaim-migrate @ 867]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 840
diff changeset
442 struct client_info_s info = {"AOL Instant Messenger (SM), version 4.1.2010/WIN32", 4, 30, 3141, "us", "en", 0x0004, 0x0001, 0x055};
840
595ac7759563 [gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 838
diff changeset
443 char *key;
741
58a6e6e26695 [gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 736
diff changeset
444 va_list ap;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
445 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess);
741
58a6e6e26695 [gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 736
diff changeset
446
58a6e6e26695 [gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 736
diff changeset
447 va_start(ap, command);
58a6e6e26695 [gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 736
diff changeset
448 key = va_arg(ap, char *);
58a6e6e26695 [gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 736
diff changeset
449 va_end(ap);
58a6e6e26695 [gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 736
diff changeset
450
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
451 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
452 return 1;
741
58a6e6e26695 [gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 736
diff changeset
453 }
58a6e6e26695 [gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 736
diff changeset
454
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
455 int gaim_server_ready(struct aim_session_t *sess,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
456 struct command_rx_struct *command, ...) {
511
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 505
diff changeset
457 static int id = 1;
964
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
458 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
459 switch (command->conn->type) {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
460 case AIM_CONN_TYPE_BOS:
829
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
461 aim_setversions(sess, command->conn);
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
462 aim_bos_reqrate(sess, command->conn); /* request rate info */
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
463 debug_print("done with BOS ServerReady\n");
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
464 break;
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
465 case AIM_CONN_TYPE_CHATNAV:
302
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
466 debug_print("chatnav: got server ready\n");
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
467 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
468 aim_bos_reqrate(sess, command->conn);
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
469 aim_bos_ackrateresp(sess, command->conn);
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
470 aim_chatnav_clientready(sess, command->conn);
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
471 aim_chatnav_reqrights(sess, command->conn);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
472 break;
511
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 505
diff changeset
473 case AIM_CONN_TYPE_CHAT:
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 505
diff changeset
474 debug_print("chat: got server ready\n");
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 505
diff changeset
475 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
476 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
477 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
478 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
479 aim_bos_reqrate(sess, command->conn);
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 505
diff changeset
480 aim_bos_ackrateresp(sess, command->conn);
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 505
diff changeset
481 aim_chat_clientready(sess, command->conn);
964
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
482 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
483 break;
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 505
diff changeset
484 case AIM_CONN_TYPE_RENDEZVOUS:
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 505
diff changeset
485 break;
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
486 default: /* huh? */
302
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
487 sprintf(debug_buff, "server ready: got unexpected connection type %04x\n", command->conn->type);
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
488 debug_print(debug_buff);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
489 break;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
490 }
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
491 return 1;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
492 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
493
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
494 int gaim_handle_redirect(struct aim_session_t *sess,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
495 struct command_rx_struct *command, ...) {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
496 va_list ap;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
497 int serviceid;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
498 char *ip;
840
595ac7759563 [gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 838
diff changeset
499 unsigned char *cookie;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
500 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess);
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
501 struct oscar_data *odata = (struct oscar_data *)gc->proto_data;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
502
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
503 va_start(ap, command);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
504 serviceid = va_arg(ap, int);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
505 ip = va_arg(ap, char *);
840
595ac7759563 [gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 838
diff changeset
506 cookie = va_arg(ap, unsigned char *);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
507
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
508 switch(serviceid) {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
509 case 0x7: /* Authorizer */
302
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
510 debug_print("Reconnecting with authorizor...\n");
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
511 {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
512 struct aim_conn_t *tstconn = aim_newconn(sess, AIM_CONN_TYPE_AUTH, ip);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
513 if (tstconn == NULL || tstconn->status >= AIM_CONN_STATUS_RESOLVERR)
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
514 debug_print("unable to reconnect with authorizer\n");
331
f3c8d79688db [gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 319
diff changeset
515 else {
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
516 odata->paspa = gdk_input_add(tstconn->fd,
331
f3c8d79688db [gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 319
diff changeset
517 GDK_INPUT_READ | GDK_INPUT_EXCEPTION,
f3c8d79688db [gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 319
diff changeset
518 oscar_callback, tstconn);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
519 aim_auth_sendcookie(sess, tstconn, cookie);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
520 }
331
f3c8d79688db [gaim-migrate @ 341]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 319
diff changeset
521 }
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
522 break;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
523 case 0xd: /* ChatNav */
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
524 {
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
525 struct aim_conn_t *tstconn = aim_newconn(sess, AIM_CONN_TYPE_CHATNAV, ip);
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
526 if (tstconn == NULL || tstconn->status >= AIM_CONN_STATUS_RESOLVERR) {
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
527 debug_print("unable to connect to chatnav server\n");
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
528 return 1;
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
529 }
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
530 aim_conn_addhandler(sess, tstconn, 0x0001, 0x0003, gaim_server_ready, 0);
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
531 aim_auth_sendcookie(sess, tstconn, cookie);
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
532 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
533 oscar_callback, tstconn);
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
534 }
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
535 debug_print("chatnav: connected\n");
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
536 break;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
537 case 0xe: /* Chat */
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
538 {
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
539 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
540 char *roomname = va_arg(ap, char *);
312
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
541 struct chat_connection *ccon;
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
542 if (tstconn == NULL || tstconn->status >= AIM_CONN_STATUS_RESOLVERR) {
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
543 debug_print("unable to connect to chat server\n");
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
544 return 1;
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
545 }
302
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
546 sprintf(debug_buff, "Connected to chat room %s\n", roomname);
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
547 debug_print(debug_buff);
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
548
312
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
549 ccon = g_new0(struct chat_connection, 1);
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
550 ccon->conn = tstconn;
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
551 ccon->fd = tstconn->fd;
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
552 ccon->name = g_strdup(roomname);
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
553
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
554 ccon->inpa = gdk_input_add(tstconn->fd,
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
555 GDK_INPUT_READ | GDK_INPUT_EXCEPTION,
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
556 oscar_callback, tstconn);
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
557
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
558 odata->oscar_chats = g_slist_append(odata->oscar_chats, ccon);
312
3069be4c291e [gaim-migrate @ 322]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 302
diff changeset
559
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
560 aim_chat_attachname(tstconn, roomname);
511
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 505
diff changeset
561 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
562 aim_auth_sendcookie(sess, tstconn, cookie);
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
563 }
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
564 break;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
565 default: /* huh? */
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
566 sprintf(debug_buff, "got redirect for unknown service 0x%04x\n",
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
567 serviceid);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
568 debug_print(debug_buff);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
569 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
570 }
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
571
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
572 va_end(ap);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
573
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
574 return 1;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
575 }
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
576
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
577 int gaim_parse_oncoming(struct aim_session_t *sess,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
578 struct command_rx_struct *command, ...) {
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
579 struct aim_userinfo_s *info;
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
580 time_t time_idle;
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
581 int type = 0;
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
582
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
583 va_list ap;
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
584 va_start(ap, command);
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
585 info = va_arg(ap, struct aim_userinfo_s *);
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
586 va_end(ap);
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
587
900
e18815f5a4e9 [gaim-migrate @ 910]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 891
diff changeset
588 if (info->flags & AIM_FLAG_UNCONFIRMED)
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
589 type |= UC_UNCONFIRMED;
900
e18815f5a4e9 [gaim-migrate @ 910]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 891
diff changeset
590 else if (info->flags & AIM_FLAG_ADMINISTRATOR)
771
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
591 type |= UC_ADMIN;
900
e18815f5a4e9 [gaim-migrate @ 910]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 891
diff changeset
592 else if (info->flags & AIM_FLAG_AOL)
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
593 type |= UC_AOL;
900
e18815f5a4e9 [gaim-migrate @ 910]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 891
diff changeset
594 else if (info->flags & AIM_FLAG_FREE)
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
595 type |= UC_NORMAL;
900
e18815f5a4e9 [gaim-migrate @ 910]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 891
diff changeset
596 if (info->flags & AIM_FLAG_AWAY)
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
597 type |= UC_UNAVAILABLE;
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
598
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
599 if (info->idletime) {
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
600 time(&time_idle);
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
601 time_idle -= info->idletime*60;
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
602 } else
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
603 time_idle = 0;
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
604
601
e670cdb5fb2f [gaim-migrate @ 611]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 592
diff changeset
605 serv_got_update(info->sn, 1, info->warnlevel/10, info->onlinesince,
513
eaddaa0dbbcb [gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 512
diff changeset
606 time_idle, type, info->capabilities);
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
607
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
608 return 1;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
609 }
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
610
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
611 int gaim_parse_offgoing(struct aim_session_t *sess,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
612 struct command_rx_struct *command, ...) {
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
613 char *sn;
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
614 va_list ap;
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
615
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
616 va_start(ap, command);
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
617 sn = va_arg(ap, char *);
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
618 va_end(ap);
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
619
513
eaddaa0dbbcb [gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 512
diff changeset
620 serv_got_update(sn, 0, 0, 0, 0, 0, 0);
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
621
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
622 return 1;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
623 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
624
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
625 int gaim_parse_incoming_im(struct aim_session_t *sess,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
626 struct command_rx_struct *command, ...) {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
627 int channel;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
628 va_list ap;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
629 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
630
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
631 va_start(ap, command);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
632 channel = va_arg(ap, int);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
633
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
634 /* channel 1: standard message */
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
635 if (channel == 1) {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
636 struct aim_userinfo_s *userinfo;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
637 char *msg = NULL;
744
f53e8f48628d [gaim-migrate @ 754]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 741
diff changeset
638 char *tmp = g_malloc(BUF_LONG);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
639 u_int icbmflags = 0;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
640 u_short flag1, flag2;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
641
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
642 userinfo = va_arg(ap, struct aim_userinfo_s *);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
643 msg = va_arg(ap, char *);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
644 icbmflags = va_arg(ap, u_int);
464
4966003f2c9b [gaim-migrate @ 474]
Rob Flynn <gaim@robflynn.com>
parents: 446
diff changeset
645 flag1 = (u_short)va_arg(ap, u_int);
4966003f2c9b [gaim-migrate @ 474]
Rob Flynn <gaim@robflynn.com>
parents: 446
diff changeset
646 flag2 = (u_short)va_arg(ap, u_int);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
647 va_end(ap);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
648
744
f53e8f48628d [gaim-migrate @ 754]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 741
diff changeset
649 g_snprintf(tmp, BUF_LONG, "%s", msg);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
650 serv_got_im(gc, userinfo->sn, tmp, icbmflags & AIM_IMFLAGS_AWAY);
744
f53e8f48628d [gaim-migrate @ 754]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 741
diff changeset
651 g_free(tmp);
252
4a41f8323022 [gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 250
diff changeset
652 } else if (channel == 2) {
4a41f8323022 [gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 250
diff changeset
653 struct aim_userinfo_s *userinfo;
4a41f8323022 [gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 250
diff changeset
654 int rendtype = va_arg(ap, int);
445
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
655 if (rendtype & AIM_CAPS_CHAT) {
252
4a41f8323022 [gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 250
diff changeset
656 char *msg, *encoding, *lang;
4a41f8323022 [gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 250
diff changeset
657 struct aim_chat_roominfo *roominfo;
4a41f8323022 [gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 250
diff changeset
658
4a41f8323022 [gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 250
diff changeset
659 userinfo = va_arg(ap, struct aim_userinfo_s *);
4a41f8323022 [gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 250
diff changeset
660 roominfo = va_arg(ap, struct aim_chat_roominfo *);
4a41f8323022 [gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 250
diff changeset
661 msg = va_arg(ap, char *);
4a41f8323022 [gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 250
diff changeset
662 encoding = va_arg(ap, char *);
4a41f8323022 [gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 250
diff changeset
663 lang = va_arg(ap, char *);
4a41f8323022 [gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 250
diff changeset
664 va_end(ap);
4a41f8323022 [gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 250
diff changeset
665
964
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
666 serv_got_chat_invite(gc,
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
667 roominfo->name,
693
30a8e386849d [gaim-migrate @ 703]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 692
diff changeset
668 roominfo->exchange,
252
4a41f8323022 [gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 250
diff changeset
669 userinfo->sn,
4a41f8323022 [gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 250
diff changeset
670 msg);
445
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
671 } else if (rendtype & AIM_CAPS_SENDFILE) {
338
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 335
diff changeset
672 /* libfaim won't tell us that we got this just yet */
445
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
673 } else if (rendtype & AIM_CAPS_GETFILE) {
338
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 335
diff changeset
674 /* nor will it tell us this. but it's still there */
445
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
675 } else if (rendtype & AIM_CAPS_VOICE) {
369
cf895313fc50 [gaim-migrate @ 379]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
676 /* this one libfaim tells us unuseful info about */
445
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
677 } else if (rendtype & AIM_CAPS_BUDDYICON) {
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
678 /* bah */
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
679 } else if (rendtype & AIM_CAPS_IMIMAGE) {
511
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 505
diff changeset
680 /* DirectIM stuff */
283
0f14e6d8a51b [gaim-migrate @ 293]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 282
diff changeset
681 } else {
0f14e6d8a51b [gaim-migrate @ 293]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 282
diff changeset
682 sprintf(debug_buff, "Unknown rendtype %d\n", rendtype);
0f14e6d8a51b [gaim-migrate @ 293]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 282
diff changeset
683 debug_print(debug_buff);
252
4a41f8323022 [gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 250
diff changeset
684 }
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
685 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
686
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
687 return 1;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
688 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
689
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
690 int gaim_parse_misses(struct aim_session_t *sess,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
691 struct command_rx_struct *command, ...) {
836
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
692 va_list ap;
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
693 u_short chan, nummissed, reason;
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
694 struct aim_userinfo_s *userinfo;
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
695 char buf[1024];
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
696
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
697 va_start(ap, command);
838
7714587cd1f9 [gaim-migrate @ 848]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 836
diff changeset
698 chan = (u_short)va_arg(ap, u_int);
836
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
699 userinfo = va_arg(ap, struct aim_userinfo_s *);
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
700 nummissed = (u_short)va_arg(ap, u_int);
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
701 reason = (u_short)va_arg(ap, u_int);
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
702 va_end(ap);
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
703
836
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
704 switch(reason) {
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
705 case 1:
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
706 /* message too large */
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
707 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
708 do_error_dialog(buf, _("Gaim - Error"));
1000
91b7377e7b45 [gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
709 plugin_event(event_error, (void *)961, 0, 0, 0);
836
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
710 break;
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
711 default:
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
712 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
713 do_error_dialog(buf, _("Gaim - Error"));
1000
91b7377e7b45 [gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
714 plugin_event(event_error, (void *)970, 0, 0, 0);
836
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
715 break;
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
716 }
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
717
836
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
718 return 1;
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
719 }
709
957957d0dc2c [gaim-migrate @ 719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 704
diff changeset
720
836
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
721 int gaim_parse_msgerr(struct aim_session_t *sess,
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
722 struct command_rx_struct *command, ...) {
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
723 va_list ap;
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
724 char *destn;
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
725 u_short reason;
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
726 char buf[1024];
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
727
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
728 va_start(ap, command);
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
729 destn = va_arg(ap, char *);
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
730 reason = (u_short)va_arg(ap, u_int);
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
731 va_end(ap);
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
732
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
733 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
734 (reason < msgerrreasonlen) ? msgerrreason[reason] : _("Reason unknown"));
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
735 do_error_dialog(buf, _("Gaim - Error"));
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
736
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
737 return 1;
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
738 }
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
739
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
740 int gaim_parse_locerr(struct aim_session_t *sess,
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
741 struct command_rx_struct *command, ...) {
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
742 va_list ap;
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
743 char *destn;
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
744 u_short reason;
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
745 char buf[1024];
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
746
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
747 va_start(ap, command);
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
748 destn = va_arg(ap, char *);
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
749 reason = (u_short)va_arg(ap, u_int);
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
750 va_end(ap);
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
751
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
752 sprintf(buf, _("User information for %s unavailable: %s"), destn,
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
753 (reason < msgerrreasonlen) ? msgerrreason[reason] : _("Reason unknown"));
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
754 do_error_dialog(buf, _("Gaim - Error"));
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
755
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
756 return 1;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
757 }
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
758
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
759 int gaim_parse_user_info(struct aim_session_t *sess,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
760 struct command_rx_struct *command, ...) {
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
761 struct aim_userinfo_s *info;
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
762 char *prof_enc = NULL, *prof = NULL;
249
810c595258c8 [gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 248
diff changeset
763 u_short infotype;
247
f6e8ea29b24f [gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 243
diff changeset
764 char buf[BUF_LONG];
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
765 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess);
247
f6e8ea29b24f [gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 243
diff changeset
766 va_list ap;
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
767
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
768 va_start(ap, command);
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
769 info = va_arg(ap, struct aim_userinfo_s *);
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
770 prof_enc = va_arg(ap, char *);
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
771 prof = va_arg(ap, char *);
464
4966003f2c9b [gaim-migrate @ 474]
Rob Flynn <gaim@robflynn.com>
parents: 446
diff changeset
772 infotype = (u_short)va_arg(ap, u_int);
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
773 va_end(ap);
247
f6e8ea29b24f [gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 243
diff changeset
774
249
810c595258c8 [gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 248
diff changeset
775 if (prof == NULL || !strlen(prof)) {
392
df5127560034 [gaim-migrate @ 402]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 388
diff changeset
776 /* no info/away message */
836
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
777 char buf[1024];
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
778 sprintf(buf, _("%s has no info/away message."), info->sn);
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
779 do_error_dialog(buf, _("Gaim - Error"));
1000
91b7377e7b45 [gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
780 plugin_event(event_error, (void *)977, 0, 0, 0);
249
810c595258c8 [gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 248
diff changeset
781 return 1;
810c595258c8 [gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 248
diff changeset
782 }
810c595258c8 [gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 248
diff changeset
783
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
784 snprintf(buf, sizeof buf, _("Username : <B>%s</B>\n<BR>"
247
f6e8ea29b24f [gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 243
diff changeset
785 "Warning Level : <B>%d %%</B>\n<BR>"
f6e8ea29b24f [gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 243
diff changeset
786 "Online Since : <B>%s</B><BR>"
f6e8ea29b24f [gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 243
diff changeset
787 "Idle Minutes : <B>%d</B>\n<BR><HR><BR>"
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
788 "%s\n"),
247
f6e8ea29b24f [gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 243
diff changeset
789 info->sn,
601
e670cdb5fb2f [gaim-migrate @ 611]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 592
diff changeset
790 info->warnlevel/10,
247
f6e8ea29b24f [gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 243
diff changeset
791 asctime(localtime(&info->onlinesince)),
f6e8ea29b24f [gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 243
diff changeset
792 info->idletime,
592
7c75d69a1129 [gaim-migrate @ 602]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 535
diff changeset
793 infotype == AIM_GETINFO_GENERALINFO ? prof :
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
794 away_subs(prof, gc->username));
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
795 g_show_info_text(away_subs(buf, gc->username));
247
f6e8ea29b24f [gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 243
diff changeset
796
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
797 return 1;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
798 }
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
799
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
800 int gaim_parse_motd(struct aim_session_t *sess,
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
801 struct command_rx_struct *command, ...) {
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
802 char *msg;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
803 u_short id;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
804 va_list ap;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
805 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
806
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
807 va_start(ap, command);
464
4966003f2c9b [gaim-migrate @ 474]
Rob Flynn <gaim@robflynn.com>
parents: 446
diff changeset
808 id = (u_short)va_arg(ap, u_int);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
809 msg = va_arg(ap, char *);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
810 va_end(ap);
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
811
771
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
812 sprintf(debug_buff, "MOTD: %s (%d)\n", msg, id);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
813 debug_print(debug_buff);
282
918db59d3814 [gaim-migrate @ 292]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 279
diff changeset
814 sprintf(debug_buff, "Gaim %s / Libfaim %s\n",
918db59d3814 [gaim-migrate @ 292]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 279
diff changeset
815 VERSION, aim_getbuildstring());
918db59d3814 [gaim-migrate @ 292]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 279
diff changeset
816 debug_print(debug_buff);
771
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
817 if (id != 4)
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
818 do_error_dialog(_("Your connection may be lost."),
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
819 _("AOL error"));
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
820
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
821 if (gc->keepalive < 0)
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
822 update_keepalive(gc, gc->keepalive);
891
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 857
diff changeset
823
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
824 return 1;
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
825 }
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
826
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
827 int gaim_chatnav_info(struct aim_session_t *sess,
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
828 struct command_rx_struct *command, ...) {
445
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
829 va_list ap;
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
830 u_short type;
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
831 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess);
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
832 struct oscar_data *odata = (struct oscar_data *)gc->proto_data;
445
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
833
e4c34ca88d9b [gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
834 va_start(ap, command);
464
4966003f2c9b [gaim-migrate @ 474]
Rob Flynn <gaim@robflynn.com>
parents: 446
diff changeset
835 type = (u_short)va_arg(ap, u_int);
302
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
836
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
837 switch(type) {
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
838 case 0x0002: {
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
839 int maxrooms;
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
840 struct aim_chat_exchangeinfo *exchanges;
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
841 int exchangecount, i = 0;
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
842
466
b5c2359d633e [gaim-migrate @ 476]
Rob Flynn <gaim@robflynn.com>
parents: 464
diff changeset
843 maxrooms = (u_char)va_arg(ap, u_int);
302
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
844 exchangecount = va_arg(ap, int);
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
845 exchanges = va_arg(ap, struct aim_chat_exchangeinfo *);
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
846 va_end(ap);
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
847
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
848 debug_print("chat info: Chat Rights:\n");
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
849 sprintf(debug_buff, "chat info: \tMax Concurrent Rooms: %d\n", maxrooms);
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
850 debug_print(debug_buff);
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
851 sprintf(debug_buff, "chat info: \tExchange List: (%d total)\n", exchangecount);
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
852 debug_print(debug_buff);
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
853 while (i < exchangecount) {
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
854 sprintf(debug_buff, "chat info: \t\t%x: %s (%s/%s)\n",
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
855 exchanges[i].number,
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
856 exchanges[i].name,
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
857 exchanges[i].charset1,
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
858 exchanges[i].lang1);
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
859 debug_print(debug_buff);
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
860 i++;
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
861 }
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
862 if (odata->create_exchange) {
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
863 sprintf(debug_buff, "creating room %s\n", odata->create_name);
904
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
864 debug_print(debug_buff);
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
865 aim_chatnav_createroom(sess, command->conn, odata->create_name,
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
866 odata->create_exchange);
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
867 odata->create_exchange = 0;
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
868 g_free(odata->create_name);
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
869 odata->create_name = NULL;
904
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
870 }
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
871 }
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
872 break;
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
873 case 0x0008: {
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
874 char *fqcn, *name, *ck;
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
875 u_short instance, flags, maxmsglen, maxoccupancy, unknown;
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
876 unsigned char createperms;
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
877 unsigned long createtime;
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
878
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
879 fqcn = va_arg(ap, char *);
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
880 instance = (u_short)va_arg(ap, u_int);
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
881 flags = (u_short)va_arg(ap, u_int);
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
882 createtime = va_arg(ap, unsigned long);
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
883 maxmsglen = (u_short)va_arg(ap, u_int);
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
884 maxoccupancy = (u_short)va_arg(ap, u_int);
906
7b976e5e1c3a [gaim-migrate @ 916]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
885 createperms = (unsigned char)va_arg(ap, int);
904
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
886 unknown = (u_short)va_arg(ap, u_int);
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
887 name = va_arg(ap, char *);
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
888 ck = va_arg(ap, char *);
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
889 va_end(ap);
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
890
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
891 sprintf(debug_buff, "created room: %s %d %d %lu %d %d %d %d %s %s\n", fqcn, instance, flags, createtime, maxmsglen, maxoccupancy, createperms, unknown, name, ck);
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
892 debug_print(debug_buff);
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
893 if (flags & 0x4) {
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
894 sprintf(debug_buff, "joining %s on exchange 5\n", name);
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
895 debug_print(debug_buff);
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
896 aim_chat_join(odata->sess, odata->conn, 5, ck);
904
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
897 } else
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
898 sprintf(debug_buff, "joining %s on exchange 4\n", name);{
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
899 debug_print(debug_buff);
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
900 aim_chat_join(odata->sess, odata->conn, 4, ck);
904
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 900
diff changeset
901 }
302
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
902 }
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
903 break;
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
904 default:
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
905 va_end(ap);
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
906 sprintf(debug_buff, "chatnav info: unknown type (%04x)\n", type);
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
907 debug_print(debug_buff);
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
908 break;
61894ab8c47e [gaim-migrate @ 312]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 288
diff changeset
909 }
242
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
910 return 1;
14fc16f579c8 [gaim-migrate @ 252]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 237
diff changeset
911 }
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
912
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
913 int gaim_chat_join(struct aim_session_t *sess,
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
914 struct command_rx_struct *command, ...) {
248
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
915 va_list ap;
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
916 int count, i = 0;
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
917 struct aim_userinfo_s *info;
964
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
918 struct gaim_connection *g = find_gaim_conn_by_aim_sess(sess);
248
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
919
964
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
920 GSList *bcs = g->buddy_chats;
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 466
diff changeset
921 struct conversation *b = NULL;
248
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
922
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
923 va_start(ap, command);
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
924 count = va_arg(ap, int);
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
925 info = va_arg(ap, struct aim_userinfo_s *);
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
926 va_end(ap);
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
927
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
928 while(bcs) {
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 466
diff changeset
929 b = (struct conversation *)bcs->data;
248
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
930 if (!strcasecmp(b->name, (char *)command->conn->priv))
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
931 break;
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
932 bcs = bcs->next;
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
933 b = NULL;
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
934 }
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
935 if (!b)
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
936 return 1;
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
937
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
938 while (i < count)
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
939 add_chat_buddy(b, info[i++].sn);
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
940
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
941 return 1;
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
942 }
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
943
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
944 int gaim_chat_leave(struct aim_session_t *sess,
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
945 struct command_rx_struct *command, ...) {
248
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
946 va_list ap;
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
947 int count, i = 0;
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
948 struct aim_userinfo_s *info;
964
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
949 struct gaim_connection *g = find_gaim_conn_by_aim_sess(sess);
248
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
950
964
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
951 GSList *bcs = g->buddy_chats;
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 466
diff changeset
952 struct conversation *b = NULL;
248
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
953
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
954 va_start(ap, command);
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
955 count = va_arg(ap, int);
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
956 info = va_arg(ap, struct aim_userinfo_s *);
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
957 va_end(ap);
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
958
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
959 while(bcs) {
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 466
diff changeset
960 b = (struct conversation *)bcs->data;
248
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
961 if (!strcasecmp(b->name, (char *)command->conn->priv))
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
962 break;
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
963 bcs = bcs->next;
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
964 b = NULL;
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
965 }
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
966 if (!b)
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
967 return 1;
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
968
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
969 while (i < count)
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
970 remove_chat_buddy(b, info[i++].sn);
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
971
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
972 return 1;
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
973 }
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
974
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
975 int gaim_chat_info_update(struct aim_session_t *sess,
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
976 struct command_rx_struct *command, ...) {
248
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
977 debug_print("inside chat_info_update\n");
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
978 return 1;
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
979 }
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
980
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
981 int gaim_chat_incoming_msg(struct aim_session_t *sess,
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
982 struct command_rx_struct *command, ...) {
248
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
983 va_list ap;
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
984 struct aim_userinfo_s *info;
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
985 char *msg;
964
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
986 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess);
248
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
987
964
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
988 GSList *bcs = gc->buddy_chats;
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 466
diff changeset
989 struct conversation *b = NULL;
248
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
990
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
991 va_start(ap, command);
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
992 info = va_arg(ap, struct aim_userinfo_s *);
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
993 msg = va_arg(ap, char *);
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
994
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
995 while(bcs) {
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 466
diff changeset
996 b = (struct conversation *)bcs->data;
248
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
997 if (!strcasecmp(b->name, (char *)command->conn->priv))
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
998 break;
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
999 bcs = bcs->next;
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1000 b = NULL;
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1001 }
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1002 if (!b)
270
cfa39d39dec6 [gaim-migrate @ 280]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 267
diff changeset
1003 return 0;
248
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1004
964
2cd7b73e2c9a [gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 960
diff changeset
1005 serv_got_chat_in(gc, b->id, info->sn, 0, msg);
248
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
1006
243
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
1007 return 1;
3414ff74cb0f [gaim-migrate @ 253]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 242
diff changeset
1008 }
503
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1009
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1010 /*
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1011 * 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
1012 */
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1013 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
1014 va_list ap;
505
3bd51b3f07c3 [gaim-migrate @ 515]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
1015 u_short type;
503
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1016 char *sn = NULL;
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1017
505
3bd51b3f07c3 [gaim-migrate @ 515]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
1018 va_start(ap, command);
3bd51b3f07c3 [gaim-migrate @ 515]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
1019 type = (u_short)va_arg(ap, u_int);
503
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1020 sn = va_arg(ap, char *);
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1021 va_end(ap);
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1022
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1023 sprintf(debug_buff, "Sent message to %s.\n", sn);
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1024 debug_print(debug_buff);
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1025
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1026 return 1;
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1027 }
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1028
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1029 int gaim_parse_ratechange(struct aim_session_t *sess, struct command_rx_struct *command, ...) {
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1030 va_list ap;
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1031 unsigned long newrate;
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1032
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1033 va_start(ap, command);
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1034 newrate = va_arg(ap, unsigned long);
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1035 va_end(ap);
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1036
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1037 sprintf(debug_buff, "ratechange: %lu\n", newrate);
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1038 debug_print(debug_buff);
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1039
6e318907bcce [gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 481
diff changeset
1040 return 1;
840
595ac7759563 [gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 838
diff changeset
1041 }
511
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 505
diff changeset
1042
771
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
1043 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
1044 va_list ap;
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
1045 char *sn;
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
1046
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
1047 va_start(ap, command);
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
1048 sn = va_arg(ap, char *);
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
1049 va_end(ap);
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
1050
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
1051 serv_got_eviled(sn, 0);
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
1052
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
1053 return 1;
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
1054 }
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
1055
829
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1056 int gaim_rateresp(struct aim_session_t *sess, struct command_rx_struct *command, ...) {
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
1057 struct gaim_connection *gc = find_gaim_conn_by_aim_sess(sess);
829
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1058 switch (command->conn->type) {
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1059 case AIM_CONN_TYPE_BOS:
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1060 aim_bos_ackrateresp(sess, command->conn);
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1061 aim_bos_reqpersonalinfo(sess, command->conn);
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1062 aim_bos_reqlocaterights(sess, command->conn);
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
1063 aim_bos_setprofile(sess, command->conn, gc->user_info, NULL, gaim_caps);
829
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1064 aim_bos_reqbuddyrights(sess, command->conn);
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1065
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
1066 serv_finish_login(gc);
1002
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1000
diff changeset
1067 account_online(gc);
829
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1068
960
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
1069 if (bud_list_cache_exists(gc))
fa681641643d [gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 946
diff changeset
1070 do_import(NULL, gc);
829
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1071
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1072 debug_print("buddy list loaded\n");
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1073
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1074 aim_addicbmparam(sess, command->conn);
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1075 aim_bos_reqicbmparaminfo(sess, command->conn);
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1076
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1077 aim_bos_reqrights(sess, command->conn);
900
e18815f5a4e9 [gaim-migrate @ 910]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 891
diff changeset
1078 aim_bos_setgroupperm(sess, command->conn, AIM_FLAG_ALLUSERS);
829
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1079 aim_bos_setprivacyflags(sess, command->conn, AIM_PRIVFLAGS_ALLOWIDLE |
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1080 AIM_PRIVFLAGS_ALLOWMEMBERSINCE);
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1081
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1082 break;
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1083 default:
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1084 sprintf(debug_buff, "got rate response for unhandled connection type %04x\n",
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1085 command->conn->type);
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1086 debug_print(debug_buff);
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1087 break;
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1088 }
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1089
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1090 return 1;
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1091 }
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1092
836
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1093 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
1094 if (command->data) {
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1095 sprintf(debug_buff, "minimum report interval: %d (seconds?)\n", aimutil_get16(command->data+10));
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1096 debug_print(debug_buff);
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1097 } else
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1098 debug_print("NULL minimum report interval!\n");
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1099 return 1;
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1100 }
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1101
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1102 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
1103 va_list ap;
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1104 u_short maxbuddies, maxwatchers;
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1105
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1106 va_start(ap, command);
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1107 maxbuddies = (u_short)va_arg(ap, u_int);
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1108 maxwatchers = (u_short)va_arg(ap, u_int);
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1109 va_end(ap);
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1110
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1111 sprintf(debug_buff, "buddy list rights: Max buddies = %d / Max watchers = %d\n", maxbuddies, maxwatchers);
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1112 debug_print(debug_buff);
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1113
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1114 return 1;
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1115 }
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1116
829
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1117 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
1118 u_short maxpermits, maxdenies;
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1119 va_list ap;
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1120
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1121 va_start(ap, command);
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1122 maxpermits = (u_short)va_arg(ap, u_int);
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1123 maxdenies = (u_short)va_arg(ap, u_int);
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1124 va_end(ap);
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1125
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1126 sprintf(debug_buff, "BOS rights: Max permit = %d / Max deny = %d\n", maxpermits, maxdenies);
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1127 debug_print(debug_buff);
15d005f8baaf [gaim-migrate @ 846]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1128
829
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1129 aim_bos_clientready(sess, command->conn);
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1130
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1131 aim_bos_reqservice(sess, command->conn, AIM_CONN_TYPE_CHATNAV);
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1132
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1133 return 1;
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1134 }
9a123b171f46 [gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 828
diff changeset
1135
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1136 static void oscar_keepalive(struct gaim_connection *gc) {
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
1137 struct oscar_data *odata = (struct oscar_data *)gc->proto_data;
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
1138 aim_flap_nop(odata->sess, odata->conn);
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1139 }
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1140
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1141 static char *oscar_name() {
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1142 return "Oscar";
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1143 }
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1144
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1145 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
1146 struct oscar_data *odata = (struct oscar_data *)gc->proto_data;
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1147 struct conversation *cnv = find_conversation(name);
1002
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1000
diff changeset
1148 if (away)
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1000
diff changeset
1149 aim_send_im(odata->sess, odata->conn, name, AIM_IMFLAGS_AWAY, message);
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1000
diff changeset
1150 else
1d8f05ea6bdf [gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1000
diff changeset
1151 aim_send_im(odata->sess, odata->conn, name, AIM_IMFLAGS_ACK, message);
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1152 }
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1153
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1154 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
1155 struct oscar_data *odata = (struct oscar_data *)g->proto_data;
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
1156 aim_getinfo(odata->sess, odata->conn, name, AIM_GETINFO_GENERALINFO);
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1157 }
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1158
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1159 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
1160 struct oscar_data *odata = (struct oscar_data *)g->proto_data;
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
1161 aim_getinfo(odata->sess, odata->conn, name, AIM_GETINFO_AWAYMESSAGE);
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1162 }
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1163
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1164 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
1165 char *maiden, char *city, char *state, char *country, int web) {
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1166 /* 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
1167 struct oscar_data *odata = (struct oscar_data *)g->proto_data;
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
1168 aim_setdirectoryinfo(odata->sess, odata->conn, first, middle, last,
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1169 maiden, NULL, NULL, city, state, NULL, 0, web);
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1170 }
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1171
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1172
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1173 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
1174 struct oscar_data *odata = (struct oscar_data *)g->proto_data;
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
1175 aim_bos_setidle(odata->sess, odata->conn, time);
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1176 }
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1177
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1178 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
1179 struct oscar_data *odata = (struct oscar_data *)g->proto_data;
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1180 if (awaymessage)
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
1181 aim_bos_setprofile(odata->sess, odata->conn, info,
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1182 awaymessage->message, gaim_caps);
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1183 else
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
1184 aim_bos_setprofile(odata->sess, odata->conn, info,
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1185 NULL, gaim_caps);
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1186 }
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1187
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1188 static void oscar_set_away(struct gaim_connection *g, char *message) {
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
1189 struct oscar_data *odata = (struct oscar_data *)g->proto_data;
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
1190 aim_bos_setprofile(odata->sess, odata->conn, g->user_info, message, gaim_caps);
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1191 }
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1192
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1193 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
1194 struct oscar_data *odata = (struct oscar_data *)g->proto_data;
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
1195 aim_send_warning(odata->sess, odata->conn, name, anon);
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1196 }
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1197
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1198 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
1199 char *maiden, char *city, char *state, char *country, char *email) {
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
1200 struct oscar_data *odata = (struct oscar_data *)g->proto_data;
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1201 if (strlen(email))
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
1202 aim_usersearch_address(odata->sess, odata->conn, email);
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1203 }
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1204
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1205 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
1206 struct oscar_data *odata = (struct oscar_data *)g->proto_data;
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
1207 aim_add_buddy(odata->sess, odata->conn, name);
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1208 }
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1209
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1210 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
1211 struct oscar_data *odata = (struct oscar_data *)g->proto_data;
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1212 char buf[MSG_LEN];
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1213 int n = 0;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1214 while (buddies) {
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1215 if (n > MSG_LEN - 18) {
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
1216 aim_bos_setbuddylist(odata->sess, odata->conn, buf);
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1217 n = 0;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1218 }
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1219 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
1220 buddies = buddies->next;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1221 }
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
1222 aim_bos_setbuddylist(odata->sess, odata->conn, buf);
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1223 }
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1224
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1225 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
1226 struct oscar_data *odata = (struct oscar_data *)g->proto_data;
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
1227 aim_remove_buddy(odata->sess, odata->conn, name);
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1228 }
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1229
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1230 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
1231 struct oscar_data *odata = (struct oscar_data *)g->proto_data;
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1232 struct aim_conn_t *cur = NULL;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1233 sprintf(debug_buff, "Attempting to join chat room %s.\n", name);
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1234 debug_print(debug_buff);
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
1235 if ((cur = aim_getconn_type(odata->sess, AIM_CONN_TYPE_CHATNAV))) {
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1236 debug_print("chatnav exists, creating room\n");
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
1237 aim_chatnav_createroom(odata->sess, cur, name, exchange);
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1238 } else {
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1239 /* this gets tricky */
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1240 debug_print("chatnav does not exist, opening chatnav\n");
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
1241 odata->create_exchange = exchange;
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
1242 odata->create_name = g_strdup(name);
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
1243 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
1244 }
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 857
diff changeset
1245 }
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 857
diff changeset
1246
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1247 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
1248 struct oscar_data *odata = (struct oscar_data *)g->proto_data;
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1249 GSList *bcs = g->buddy_chats;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1250 struct conversation *b = NULL;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1251
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1252 while (bcs) {
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1253 b = (struct conversation *)bcs->data;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1254 if (id == b->id)
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1255 break;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1256 bcs = bcs->next;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1257 b = NULL;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1258 }
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1259
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1260 if (!b)
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1261 return;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1262
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
1263 aim_chat_invite(odata->sess, odata->conn, name,
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1264 message ? message : "", 0x4, b->name, 0x0);
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1265 }
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1266
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1267 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
1268 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
1269 GSList *bcs = g->buddy_chats;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1270 struct conversation *b = NULL;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1271 struct chat_connection *c = NULL;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1272 int count = 0;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1273
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1274 while (bcs) {
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1275 count++;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1276 b = (struct conversation *)bcs->data;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1277 if (id == b->id)
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1278 break;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1279 bcs = bcs->next;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1280 b = NULL;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1281 }
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1282
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1283 if (!b)
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1284 return;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1285
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1286 sprintf(debug_buff, "Attempting to leave room %s (currently in %d rooms)\n",
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1287 b->name, count);
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1288 debug_print(debug_buff);
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1289
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1290 c = find_oscar_chat(g, b->name);
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1291 if (c != NULL) {
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
1292 if (odata)
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
1293 odata->oscar_chats = g_slist_remove(odata->oscar_chats, c);
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1294 gdk_input_remove(c->inpa);
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
1295 if (g && odata->sess)
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
1296 aim_conn_kill(odata->sess, &c->conn);
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1297 g_free(c->name);
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1298 g_free(c);
891
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 857
diff changeset
1299 }
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1300 /* 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
1301 serv_got_chat_left(g, b->id);
891
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 857
diff changeset
1302 }
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1303
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1304 static void oscar_chat_whisper(struct gaim_connection *g, int id, char *who, char *message) {
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1305 do_error_dialog("Sorry, Oscar doesn't whisper. Send an IM. (The last message was not received.)",
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1306 "Gaim - Chat");
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1307 }
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1308
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1309 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
1310 struct oscar_data *odata = (struct oscar_data *)g->proto_data;
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1311 struct aim_conn_t *cn;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1312 GSList *bcs = g->buddy_chats;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1313 struct conversation *b = NULL;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1314
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1315 while (bcs) {
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1316 b = (struct conversation *)bcs->data;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1317 if (id == b->id)
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1318 break;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1319 bcs = bcs->next;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1320 b = NULL;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1321 }
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1322 if (!b)
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1323 return;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1324
998
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
1325 cn = aim_chat_getconn(odata->sess, b->name);
70c685de2be5 [gaim-migrate @ 1008]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 988
diff changeset
1326 aim_chat_send_im(odata->sess, cn, message);
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1327 }
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1328
1000
91b7377e7b45 [gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 998
diff changeset
1329 void oscar_init(struct prpl *ret) {
981
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1330 ret->protocol = PROTO_OSCAR;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1331 ret->name = oscar_name;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1332 ret->login = oscar_login;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1333 ret->close = oscar_close;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1334 ret->send_im = oscar_send_im;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1335 ret->set_info = oscar_set_info;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1336 ret->get_info = oscar_get_info;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1337 ret->set_away = oscar_set_away;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1338 ret->get_away_msg = oscar_get_away_msg;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1339 ret->set_dir = oscar_set_dir;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1340 ret->get_dir = NULL; /* Oscar really doesn't have this */
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1341 ret->dir_search = oscar_dir_search;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1342 ret->set_idle = oscar_set_idle;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1343 ret->change_passwd = NULL; /* Oscar doesn't have this either */
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1344 ret->add_buddy = oscar_add_buddy;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1345 ret->add_buddies = oscar_add_buddies;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1346 ret->remove_buddy = oscar_remove_buddy;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1347 ret->add_permit = NULL; /* Oscar's permit/deny stuff is messed up */
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1348 ret->add_deny = NULL; /* at least, i can't figure it out :-P */
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1349 ret->warn = oscar_warn;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1350 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
1351 ret->join_chat = oscar_join_chat;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1352 ret->chat_invite = oscar_chat_invite;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1353 ret->chat_leave = oscar_chat_leave;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1354 ret->chat_whisper = oscar_chat_whisper;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1355 ret->chat_send = oscar_chat_send;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1356 ret->keepalive = oscar_keepalive;
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1357 }
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1358
7e231bc0018a [gaim-migrate @ 991]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 980
diff changeset
1359 #endif