annotate src/server.c @ 910:568bb0f5c921

[gaim-migrate @ 920] it would be good if every little display option didn't affect every convo window committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Thu, 14 Sep 2000 22:27:33 +0000
parents e1a7fc4482b9
children 59d9e1177ab5
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 * Copyright (C) 1998-1999, Mark Spencer <markster@marko.net>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
5 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
6 * This program is free software; you can redistribute it and/or modify
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
7 * 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
8 * the Free Software Foundation; either version 2 of the License, or
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
9 * (at your option) any later version.
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
10 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
11 * This program is distributed in the hope that it will be useful,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
14 * GNU General Public License for more details.
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
15 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
16 * You should have received a copy of the GNU General Public License
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
17 * along with this program; if not, write to the Free Software
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
19 *
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
349
b402a23f35df [gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 338
diff changeset
22 #ifdef HAVE_CONFIG_H
b402a23f35df [gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 338
diff changeset
23 #include "../config.h"
b402a23f35df [gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 338
diff changeset
24 #endif
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
25 #include <time.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
26 #include <stdio.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
27 #include <string.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
28 #include <sys/types.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
29 #include <sys/stat.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
30 #include <sys/time.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
31 #include <unistd.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
32 #include <gtk/gtk.h>
338
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 335
diff changeset
33 #include <aim.h>
276
9e6fc62490cd [gaim-migrate @ 286]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 273
diff changeset
34 extern int gaim_caps;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
35 #include "gaim.h"
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
36
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
37 static int idle_timer = -1;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
38 static time_t lastsent = 0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
39 static time_t login_time = 0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
40 static int is_idle = 0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
41
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
42 int correction_time = 0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
43
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
44 int serv_login(char *username, char *password)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
45 {
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
46 if (!(general_options & OPT_GEN_USE_OSCAR)) {
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
47 USE_OSCAR = 0;
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
48 return toc_login(username, password);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
49 } else {
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
50 USE_OSCAR = 1;
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
51 debug_print("Logging in using Oscar. Expect problems.\n");
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
52 return oscar_login(username, password);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
53 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
54 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
55
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
56 void serv_close()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
57 {
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
58 if (!USE_OSCAR)
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
59 toc_close();
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
60 else
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
61 oscar_close();
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
62
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
63 gtk_timeout_remove(idle_timer);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
64 idle_timer = -1;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
65 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
66
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
67
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
68 void serv_touch_idle()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
69 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
70 /* Are we idle? If so, not anymore */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
71 if (is_idle > 0) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
72 is_idle = 0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
73 serv_set_idle(0);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
74 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
75 time(&lastsent);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
76 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
77
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
78
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
79 static gint check_idle()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
80 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
81 time_t t;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
82
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
83 /* Not idle, really... :) */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
84 update_all_buddies();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
85
834
bac7089491c1 [gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 831
diff changeset
86 plugin_event(event_blist_update, 0, 0, 0);
bac7089491c1 [gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 831
diff changeset
87
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
88 time(&t);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
89
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
90 if (report_idle != IDLE_GAIM)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
91 return TRUE;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
92
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
93
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
94 if (is_idle)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
95 return TRUE;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
96
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
97 if ((t - lastsent) > 600) { /* 15 minutes! */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
98 serv_set_idle((int)t - lastsent);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
99 is_idle = 1;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
100 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
101
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
102 return TRUE;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
103
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
104 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
105
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
106
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
107 void serv_finish_login()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
108 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
109 char *buf;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
110
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
111 if (strlen(current_user->user_info)) {
79
bfdc427b936d [gaim-migrate @ 89]
Rob Flynn <gaim@robflynn.com>
parents: 45
diff changeset
112 buf = g_malloc(strlen(current_user->user_info) * 4);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
113 strcpy(buf, current_user->user_info);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
114 escape_text(buf);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
115 serv_set_info(buf);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
116 g_free(buf);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
117 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
118
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
119 if (idle_timer != -1)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
120 gtk_timeout_remove(idle_timer);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
121
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
122 idle_timer = gtk_timeout_add(20000, (GtkFunction)check_idle, NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
123 serv_touch_idle();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
124
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
125 time(&login_time);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
126
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
127 serv_add_buddy(current_user->username);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
128
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
129 if (!(general_options & OPT_GEN_REGISTERED))
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
130 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
131 show_register_dialog();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
132 save_prefs();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
133 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
134 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
135
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
136
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
137
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
138 void serv_send_im(char *name, char *message, int away)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
139 {
511
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
140 struct conversation *cnv = find_conversation(name);
518
091d081a269d [gaim-migrate @ 528]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 516
diff changeset
141 if (cnv && cnv->is_direct) {
091d081a269d [gaim-migrate @ 528]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 516
diff changeset
142 if (!USE_OSCAR) {
834
bac7089491c1 [gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 831
diff changeset
143 /* Direct IM TOC FIXME */
518
091d081a269d [gaim-migrate @ 528]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 516
diff changeset
144 } else {
091d081a269d [gaim-migrate @ 528]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 516
diff changeset
145 sprintf(debug_buff, "Sending DirectIM to %s\n", name);
091d081a269d [gaim-migrate @ 528]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 516
diff changeset
146 debug_print(debug_buff);
091d081a269d [gaim-migrate @ 528]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 516
diff changeset
147 aim_send_im_direct(gaim_sess, cnv->conn, message);
091d081a269d [gaim-migrate @ 528]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 516
diff changeset
148 }
091d081a269d [gaim-migrate @ 528]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 516
diff changeset
149 } else {
511
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
150 if (!USE_OSCAR) {
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
151 char buf[MSG_LEN - 7];
94
9f6ce50ffb78 [gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
152
511
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
153 g_snprintf(buf, MSG_LEN - 8, "toc_send_im %s \"%s\"%s", normalize(name),
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
154 message, ((away) ? " auto" : ""));
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
155 sflap_send(buf, strlen(buf), TYPE_DATA);
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
156 } else {
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
157 if (away)
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
158 aim_send_im(gaim_sess, gaim_conn, name, AIM_IMFLAGS_AWAY, message);
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
159 else
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
160 aim_send_im(gaim_sess, gaim_conn, name, AIM_IMFLAGS_ACK, message);
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
161 }
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
162 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
163 if (!away)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
164 serv_touch_idle();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
165 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
166
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
167 void serv_get_info(char *name)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
168 {
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
169 if (!USE_OSCAR) {
511
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
170 char buf[MSG_LEN];
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
171 g_snprintf(buf, MSG_LEN, "toc_get_info %s", normalize(name));
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
172 sflap_send(buf, -1, TYPE_DATA);
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
173 } else {
511
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
174 aim_getinfo(gaim_sess, gaim_conn, name, AIM_GETINFO_GENERALINFO);
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
175 }
249
810c595258c8 [gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 248
diff changeset
176 }
810c595258c8 [gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 248
diff changeset
177
810c595258c8 [gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 248
diff changeset
178 void serv_get_away_msg(char *name)
810c595258c8 [gaim-migrate @ 259]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 248
diff changeset
179 {
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
180 if (!USE_OSCAR) {
511
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
181 /* HAHA! TOC doesn't have this yet */
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
182 } else {
511
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
183 aim_getinfo(gaim_sess, gaim_conn, name, AIM_GETINFO_AWAYMESSAGE);
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
184 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
185 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
186
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
187 void serv_get_dir(char *name)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
188 {
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
189 if (!USE_OSCAR) {
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
190 char buf[MSG_LEN];
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
191 g_snprintf(buf, MSG_LEN, "toc_get_dir %s", normalize(name));
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
192 sflap_send(buf, -1, TYPE_DATA);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
193 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
194 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
195
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
196 void serv_set_dir(char *first, char *middle, char *last, char *maiden,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
197 char *city, char *state, char *country, int web)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
198 {
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
199 if (!USE_OSCAR) {
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 200
diff changeset
200 char buf2[BUF_LEN*4], buf[BUF_LEN];
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
201 g_snprintf(buf2, sizeof(buf2), "%s:%s:%s:%s:%s:%s:%s:%s", first,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
202 middle, last, maiden, city, state, country,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
203 (web == 1) ? "Y" : "");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
204 escape_text(buf2);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
205 g_snprintf(buf, sizeof(buf), "toc_set_dir %s", buf2);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
206 sflap_send(buf, -1, TYPE_DATA);
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
207 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
208 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
209
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
210 void serv_dir_search(char *first, char *middle, char *last, char *maiden,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
211 char *city, char *state, char *country, char *email)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
212 {
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
213 if (!USE_OSCAR) {
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
214 char buf[BUF_LONG];
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
215 g_snprintf(buf, sizeof(buf)/2, "toc_dir_search %s:%s:%s:%s:%s:%s:%s:%s", first, middle, last, maiden, city, state, country, email);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
216 sprintf(debug_buff,"Searching for: %s,%s,%s,%s,%s,%s,%s\n", first, middle, last, maiden, city, state, country);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
217 debug_print(debug_buff);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
218 sflap_send(buf, -1, TYPE_DATA);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
219 } else {
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
220 if (strlen(email))
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
221 aim_usersearch_address(gaim_sess, gaim_conn, email);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
222 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
223 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
224
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
225
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
226 void serv_set_away(char *message)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
227 {
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
228 if (!USE_OSCAR) {
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
229 char buf[MSG_LEN];
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
230 if (message)
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
231 g_snprintf(buf, MSG_LEN, "toc_set_away \"%s\"", message);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
232 else
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
233 g_snprintf(buf, MSG_LEN, "toc_set_away \"\"");
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
234 sflap_send(buf, -1, TYPE_DATA);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
235 } else {
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
236 aim_bos_setprofile(gaim_sess, gaim_conn, current_user->user_info,
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
237 message, gaim_caps);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
238 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
239 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
240
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
241 void serv_set_info(char *info)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
242 {
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
243 if (!USE_OSCAR) {
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
244 char buf[MSG_LEN];
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
245 g_snprintf(buf, sizeof(buf), "toc_set_info \"%s\n\"", info);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
246 sflap_send(buf, -1, TYPE_DATA);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
247 } else {
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
248 if (awaymessage)
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
249 aim_bos_setprofile(gaim_sess, gaim_conn, info,
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
250 awaymessage->message, gaim_caps);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
251 else
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
252 aim_bos_setprofile(gaim_sess, gaim_conn, info,
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
253 NULL, gaim_caps);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
254 }
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 200
diff changeset
255 }
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 200
diff changeset
256
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 200
diff changeset
257 void serv_change_passwd(char *orig, char *new) {
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
258 if (!USE_OSCAR) {
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
259 char *buf = g_malloc(BUF_LONG);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
260 g_snprintf(buf, BUF_LONG, "toc_change_passwd %s %s", orig, new);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
261 sflap_send(buf, strlen(buf), TYPE_DATA);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
262 g_free(buf);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
263 } else {
834
bac7089491c1 [gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 831
diff changeset
264 /* Oscar change_passwd FIXME */
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
265 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
266 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
267
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
268 void serv_add_buddy(char *name)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
269 {
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
270 if (!USE_OSCAR) {
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
271 char buf[1024];
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
272 g_snprintf(buf, sizeof(buf), "toc_add_buddy %s", normalize(name));
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
273 sflap_send(buf, -1, TYPE_DATA);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
274 } else {
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
275 aim_add_buddy(gaim_sess, gaim_conn, name);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
276 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
277 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
278
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
279 void serv_add_buddies(GList *buddies)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
280 {
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
281 if (!USE_OSCAR) {
447
5db3734a1fe6 [gaim-migrate @ 457]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
282 char buf[MSG_LEN];
5db3734a1fe6 [gaim-migrate @ 457]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
283 int n, num = 0;
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 200
diff changeset
284
447
5db3734a1fe6 [gaim-migrate @ 457]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
285 n = g_snprintf(buf, sizeof(buf), "toc_add_buddy");
5db3734a1fe6 [gaim-migrate @ 457]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
286 while(buddies) {
5db3734a1fe6 [gaim-migrate @ 457]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
287 /* i don't know why we choose 8, it just seems good */
5db3734a1fe6 [gaim-migrate @ 457]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
288 if (strlen(normalize(buddies->data)) > MSG_LEN - n - 8) {
5db3734a1fe6 [gaim-migrate @ 457]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
289 sflap_send(buf, -1, TYPE_DATA);
5db3734a1fe6 [gaim-migrate @ 457]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
290 n = g_snprintf(buf, sizeof(buf), "toc_add_buddy");
5db3734a1fe6 [gaim-migrate @ 457]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
291 num = 0;
5db3734a1fe6 [gaim-migrate @ 457]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
292 }
5db3734a1fe6 [gaim-migrate @ 457]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
293 ++num;
5db3734a1fe6 [gaim-migrate @ 457]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
294 n += g_snprintf(buf + n, sizeof(buf) - n, " %s", normalize(buddies->data));
5db3734a1fe6 [gaim-migrate @ 457]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
295 buddies = buddies->next;
5db3734a1fe6 [gaim-migrate @ 457]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
296 }
5db3734a1fe6 [gaim-migrate @ 457]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
297 sflap_send(buf, -1, TYPE_DATA);
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
298 } else {
447
5db3734a1fe6 [gaim-migrate @ 457]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
299 char buf[MSG_LEN];
5db3734a1fe6 [gaim-migrate @ 457]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
300 int n = 0;
5db3734a1fe6 [gaim-migrate @ 457]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
301 while(buddies) {
5db3734a1fe6 [gaim-migrate @ 457]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
302 if (n > MSG_LEN - 18) {
5db3734a1fe6 [gaim-migrate @ 457]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
303 aim_bos_setbuddylist(gaim_sess, gaim_conn, buf);
5db3734a1fe6 [gaim-migrate @ 457]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
304 n = 0;
5db3734a1fe6 [gaim-migrate @ 457]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
305 }
5db3734a1fe6 [gaim-migrate @ 457]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
306 n += g_snprintf(buf + n, sizeof(buf) - n, "%s&",
5db3734a1fe6 [gaim-migrate @ 457]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
307 (char *)buddies->data);
5db3734a1fe6 [gaim-migrate @ 457]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
308 buddies = buddies->next;
319
cea40691706c [gaim-migrate @ 329]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 318
diff changeset
309 }
447
5db3734a1fe6 [gaim-migrate @ 457]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 423
diff changeset
310 aim_bos_setbuddylist(gaim_sess, gaim_conn, buf);
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
311 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
312 }
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
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
315 void serv_remove_buddy(char *name)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
316 {
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
317 if (!USE_OSCAR) {
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
318 char buf[1024];
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
319 g_snprintf(buf, sizeof(buf), "toc_remove_buddy %s", normalize(name));
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
320 sflap_send(buf, -1, TYPE_DATA);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
321 } else {
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
322 aim_remove_buddy(gaim_sess, gaim_conn, name);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
323 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
324 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
325
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
326 void serv_add_permit(char *name)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
327 {
752
870fcc64a709 [gaim-migrate @ 762]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
328 permdeny = 3;
870fcc64a709 [gaim-migrate @ 762]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
329 build_permit_tree();
793
57cc66fbfa8e [gaim-migrate @ 803]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 780
diff changeset
330 serv_set_permit_deny();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
331 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
332
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
333
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
334
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
335 void serv_add_deny(char *name)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
336 {
752
870fcc64a709 [gaim-migrate @ 762]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
337 permdeny = 4;
870fcc64a709 [gaim-migrate @ 762]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
338 build_permit_tree();
793
57cc66fbfa8e [gaim-migrate @ 803]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 780
diff changeset
339 serv_set_permit_deny();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
340 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
341
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
342
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
343
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
344 void serv_set_permit_deny()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
345 {
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
346 if (!USE_OSCAR) {
678
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
347 char buf[MSG_LEN];
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
348 int at;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
349 GList *list;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
350
678
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
351 switch (permdeny) {
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
352 case PERMIT_ALL:
752
870fcc64a709 [gaim-migrate @ 762]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
353 sprintf(buf, "toc_add_permit %s", current_user->username);
870fcc64a709 [gaim-migrate @ 762]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
354 sflap_send(buf, -1, TYPE_DATA);
870fcc64a709 [gaim-migrate @ 762]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
355 sprintf(buf, "toc_add_deny");
678
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
356 sflap_send(buf, -1, TYPE_DATA);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
357 break;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
358 case PERMIT_NONE:
752
870fcc64a709 [gaim-migrate @ 762]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
359 sprintf(buf, "toc_add_deny %s", current_user->username);
870fcc64a709 [gaim-migrate @ 762]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
360 sflap_send(buf, -1, TYPE_DATA);
870fcc64a709 [gaim-migrate @ 762]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
361 sprintf(buf, "toc_add_permit");
678
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
362 sflap_send(buf, -1, TYPE_DATA);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
363 break;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
364 case PERMIT_SOME:
684
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 680
diff changeset
365 at = g_snprintf(buf, sizeof(buf), "toc_add_permit");
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 680
diff changeset
366 list = permit;
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 680
diff changeset
367 while (list) {
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 680
diff changeset
368 at += g_snprintf(&buf[at], sizeof(buf) - at, " %s", normalize(list->data));
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 680
diff changeset
369 list = list->next;
678
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
370 }
684
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 680
diff changeset
371 buf[at] = 0; /* is this necessary? */
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 680
diff changeset
372 sflap_send(buf, -1, TYPE_DATA);
678
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
373 break;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
374 case DENY_SOME:
685
94a27f7567c5 [gaim-migrate @ 695]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 684
diff changeset
375 /* you'll still see people as being online, but they won't see you, and you
94a27f7567c5 [gaim-migrate @ 695]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 684
diff changeset
376 * won't get updates for them. that's why i thought this was broken. */
684
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 680
diff changeset
377 at = g_snprintf(buf, sizeof(buf), "toc_add_deny");
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 680
diff changeset
378 list = deny;
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 680
diff changeset
379 while (list) {
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 680
diff changeset
380 at += g_snprintf(&buf[at], sizeof(buf) - at, " %s", normalize(list->data));
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 680
diff changeset
381 list = list->next;
678
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
382 }
684
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 680
diff changeset
383 buf[at] = 0; /* is this necessary? */
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 680
diff changeset
384 sflap_send(buf, -1, TYPE_DATA);
678
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
385 break;
318
35796808896a [gaim-migrate @ 328]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 314
diff changeset
386 }
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
387 } else {
707
668b4d544afe [gaim-migrate @ 717]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 694
diff changeset
388 /*
678
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
389 int at;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
390 GList *list;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
391 char buf[MSG_LEN];
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
392
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
393 switch (permdeny) {
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
394 case PERMIT_ALL:
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
395 aim_bos_changevisibility(gaim_sess, gaim_conn,
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
396 AIM_VISIBILITYCHANGE_DENYADD, current_user->username);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
397 break;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
398 case PERMIT_NONE:
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
399 aim_bos_changevisibility(gaim_sess, gaim_conn,
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
400 AIM_VISIBILITYCHANGE_PERMITADD, current_user->username);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
401 break;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
402 case PERMIT_SOME:
679
71b2477033cb [gaim-migrate @ 689]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 678
diff changeset
403 at = g_snprintf(buf, sizeof(buf), "%s", current_user->username);
71b2477033cb [gaim-migrate @ 689]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 678
diff changeset
404 list = permit;
71b2477033cb [gaim-migrate @ 689]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 678
diff changeset
405 while (list) {
71b2477033cb [gaim-migrate @ 689]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 678
diff changeset
406 at += g_snprintf(&buf[at], sizeof(buf) - at, "&");
71b2477033cb [gaim-migrate @ 689]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 678
diff changeset
407 at += g_snprintf(&buf[at], sizeof(buf) - at, "%s", list->data);
71b2477033cb [gaim-migrate @ 689]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 678
diff changeset
408 list = list->next;
281
7b06ba09ffe2 [gaim-migrate @ 291]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 280
diff changeset
409 }
679
71b2477033cb [gaim-migrate @ 689]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 678
diff changeset
410 aim_bos_changevisibility(gaim_sess, gaim_conn,
71b2477033cb [gaim-migrate @ 689]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 678
diff changeset
411 AIM_VISIBILITYCHANGE_PERMITADD, buf);
678
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
412 break;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
413 case DENY_SOME:
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
414 if (deny) {
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
415 at = 0;
680
acdbee5a9492 [gaim-migrate @ 690]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 679
diff changeset
416 list = deny;
678
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
417 while (list) {
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
418 at += g_snprintf(&buf[at], sizeof(buf) - at, "%s", list->data);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
419 list = list->next;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
420 if (list)
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
421 at += g_snprintf(&buf[at], sizeof(buf) - at, "&");
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
422 }
684
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 680
diff changeset
423 sprintf(debug_buff, "denying %s\n", buf);
b29c92be568b [gaim-migrate @ 694]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 680
diff changeset
424 debug_print(debug_buff);
678
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
425 aim_bos_changevisibility(gaim_sess, gaim_conn,
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
426 AIM_VISIBILITYCHANGE_DENYADD, buf);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
427 } else {
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
428 aim_bos_changevisibility(gaim_sess, gaim_conn,
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
429 AIM_VISIBILITYCHANGE_DENYADD, current_user->username);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
430 }
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
431 break;
281
7b06ba09ffe2 [gaim-migrate @ 291]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 280
diff changeset
432 }
707
668b4d544afe [gaim-migrate @ 717]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 694
diff changeset
433 */
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
434 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
435 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
436
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
437 void serv_set_idle(int time)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
438 {
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
439 if (!USE_OSCAR) {
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
440 char buf[256];
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
441 g_snprintf(buf, sizeof(buf), "toc_set_idle %d", time);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
442 sflap_send(buf, -1, TYPE_DATA);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
443 } else {
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
444 aim_bos_setidle(gaim_sess, gaim_conn, time);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
445 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
446 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
447
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
448
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
449 void serv_warn(char *name, int anon)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
450 {
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
451 if (!USE_OSCAR) {
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
452 char *send = g_malloc(256);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
453 g_snprintf(send, 255, "toc_evil %s %s", name,
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
454 ((anon) ? "anon" : "norm"));
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
455 sflap_send(send, -1, TYPE_DATA);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
456 g_free(send);
771
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 765
diff changeset
457 } else {
72e556f6b99d [gaim-migrate @ 781]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 765
diff changeset
458 aim_send_warning(gaim_sess, gaim_conn, name, anon);
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
459 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
460 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
461
710
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 707
diff changeset
462 void serv_build_config(char *buf, int len, gboolean show) {
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 707
diff changeset
463 toc_build_config(buf, len, show);
237
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 200
diff changeset
464 }
6ced2f1c8b24 [gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 200
diff changeset
465
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
466
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
467 void serv_save_config()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
468 {
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
469 if (!USE_OSCAR) {
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
470 char *buf = g_malloc(BUF_LONG);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
471 char *buf2 = g_malloc(MSG_LEN);
710
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 707
diff changeset
472 serv_build_config(buf, BUF_LONG / 2, FALSE);
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
473 g_snprintf(buf2, MSG_LEN, "toc_set_config {%s}", buf);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
474 sflap_send(buf2, -1, TYPE_DATA);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
475 g_free(buf2);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
476 g_free(buf);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
477 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
478 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
479
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
480
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
481 void serv_accept_chat(int i)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
482 {
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
483 if (!USE_OSCAR) {
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
484 char *buf = g_malloc(256);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
485 g_snprintf(buf, 255, "toc_chat_accept %d", i);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
486 sflap_send(buf, -1, TYPE_DATA);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
487 g_free(buf);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
488 } else {
252
4a41f8323022 [gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 249
diff changeset
489 /* this should never get called because libfaim doesn't use the id
4a41f8323022 [gaim-migrate @ 262]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 249
diff changeset
490 * (i'm not even sure Oscar does). go through serv_join_chat instead */
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
491 }
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
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
494 void serv_join_chat(int exchange, char *name)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
495 {
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
496 if (!USE_OSCAR) {
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
497 char buf[BUF_LONG];
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
498 g_snprintf(buf, sizeof(buf)/2, "toc_chat_join %d \"%s\"", exchange, name);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
499 sflap_send(buf, -1, TYPE_DATA);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
500 } else {
904
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 888
diff changeset
501 struct aim_conn_t *cur = NULL;
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
502 sprintf(debug_buff, "Attempting to join chat room %s.\n", name);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
503 debug_print(debug_buff);
904
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 888
diff changeset
504 if ((cur = aim_getconn_type(gaim_sess, AIM_CONN_TYPE_CHATNAV))) {
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 888
diff changeset
505 debug_print("chatnav exists, creating room\n");
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 888
diff changeset
506 aim_chatnav_createroom(gaim_sess, cur, name, exchange);
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 888
diff changeset
507 } else {
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 888
diff changeset
508 /* this gets tricky */
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 888
diff changeset
509 debug_print("chatnav does not exist, opening chatnav\n");
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 888
diff changeset
510 create_exchange = exchange;
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 888
diff changeset
511 create_name = g_strdup(name);
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 888
diff changeset
512 aim_bos_reqservice(gaim_sess, gaim_conn, AIM_CONN_TYPE_CHATNAV);
e1a7fc4482b9 [gaim-migrate @ 914]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 888
diff changeset
513 }
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
514 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
515 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
516
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
517 void serv_chat_invite(int id, char *message, char *name)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
518 {
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
519 if (!USE_OSCAR) {
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
520 char buf[BUF_LONG];
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
521 g_snprintf(buf, sizeof(buf)/2, "toc_chat_invite %d \"%s\" %s", id, message, normalize(name));
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
522 sflap_send(buf, -1, TYPE_DATA);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
523 } else {
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
524 GList *bcs = buddy_chats;
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 447
diff changeset
525 struct conversation *b = NULL;
258
1eeece1c7b7b [gaim-migrate @ 268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 256
diff changeset
526
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
527 while (bcs) {
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 447
diff changeset
528 b = (struct conversation *)bcs->data;
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
529 if (id == b->id)
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
530 break;
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
531 bcs = bcs->next;
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
532 b = NULL;
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
533 }
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
534
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
535 if (!b)
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
536 return;
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
537
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
538 aim_chat_invite(gaim_sess, gaim_conn, name, message, 0x4, b->name, 0x1);
258
1eeece1c7b7b [gaim-migrate @ 268]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 256
diff changeset
539 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
540 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
541
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
542 void serv_chat_leave(int id)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
543 {
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
544 if (!USE_OSCAR) {
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
545 char *buf = g_malloc(256);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
546 g_snprintf(buf, 255, "toc_chat_leave %d", id);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
547 sflap_send(buf, -1, TYPE_DATA);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
548 g_free(buf);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
549 } else {
692
f4026275bc9f [gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 685
diff changeset
550 GList *bcs = buddy_chats;
f4026275bc9f [gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 685
diff changeset
551 struct conversation *b = NULL;
f4026275bc9f [gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 685
diff changeset
552 struct chat_connection *c = NULL;
f4026275bc9f [gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 685
diff changeset
553 int count = 0;
248
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
554
692
f4026275bc9f [gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 685
diff changeset
555 while (bcs) {
f4026275bc9f [gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 685
diff changeset
556 count++;
f4026275bc9f [gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 685
diff changeset
557 b = (struct conversation *)bcs->data;
f4026275bc9f [gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 685
diff changeset
558 if (id == b->id)
f4026275bc9f [gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 685
diff changeset
559 break;
f4026275bc9f [gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 685
diff changeset
560 bcs = bcs->next;
f4026275bc9f [gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 685
diff changeset
561 b = NULL;
f4026275bc9f [gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 685
diff changeset
562 }
248
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
563
692
f4026275bc9f [gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 685
diff changeset
564 if (!b)
f4026275bc9f [gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 685
diff changeset
565 return;
248
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
566
692
f4026275bc9f [gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 685
diff changeset
567 sprintf(debug_buff, "Attempting to leave room %s (currently in %d rooms)\n",
f4026275bc9f [gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 685
diff changeset
568 b->name, count);
f4026275bc9f [gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 685
diff changeset
569 debug_print(debug_buff);
368
9bf1f77985d2 [gaim-migrate @ 378]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
570
692
f4026275bc9f [gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 685
diff changeset
571 c = find_oscar_chat(b->name);
f4026275bc9f [gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 685
diff changeset
572 if (c != NULL) {
f4026275bc9f [gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 685
diff changeset
573 oscar_chats = g_list_remove(oscar_chats, c);
f4026275bc9f [gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 685
diff changeset
574 gdk_input_remove(c->inpa);
834
bac7089491c1 [gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 831
diff changeset
575 if (gaim_sess)
bac7089491c1 [gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 831
diff changeset
576 aim_conn_kill(gaim_sess, &c->conn);
692
f4026275bc9f [gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 685
diff changeset
577 g_free(c->name);
f4026275bc9f [gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 685
diff changeset
578 g_free(c);
f4026275bc9f [gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 685
diff changeset
579 }
f4026275bc9f [gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 685
diff changeset
580 /* we do this because with Oscar it doesn't tell us we left */
f4026275bc9f [gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 685
diff changeset
581 serv_got_chat_left(b->id);
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
582 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
583 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
584
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
585 void serv_chat_whisper(int id, char *who, char *message)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
586 {
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
587 if (!USE_OSCAR) {
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
588 char buf2[MSG_LEN];
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
589 g_snprintf(buf2, sizeof(buf2), "toc_chat_whisper %d %s \"%s\"", id, who, message);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
590 sflap_send(buf2, -1, TYPE_DATA);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
591 } else {
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
592 do_error_dialog("Sorry, Oscar doesn't whisper. Send an IM. (The last message was not received.)",
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
593 "Gaim - Chat");
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
594 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
595 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
596
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
597 void serv_chat_send(int id, char *message)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
598 {
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
599 if (!USE_OSCAR) {
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
600 char buf[MSG_LEN];
528
d9e638d13e5a [gaim-migrate @ 538]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 518
diff changeset
601 escape_text(message);
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
602 g_snprintf(buf, sizeof(buf), "toc_chat_send %d \"%s\"",id, message);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
603 sflap_send(buf, -1, TYPE_DATA);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
604 } else {
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
605 struct aim_conn_t *cn;
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
606 GList *bcs = buddy_chats;
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 447
diff changeset
607 struct conversation *b = NULL;
248
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
608
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
609 while (bcs) {
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 447
diff changeset
610 b = (struct conversation *)bcs->data;
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
611 if (id == b->id)
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
612 break;
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
613 bcs = bcs->next;
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
614 b = NULL;
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
615 }
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
616 if (!b)
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
617 return;
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
618
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
619 cn = aim_chat_getconn(gaim_sess, b->name);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
620 aim_chat_send_im(gaim_sess, cn, message);
248
cfc73b8501a7 [gaim-migrate @ 258]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 247
diff changeset
621 }
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 447
diff changeset
622 serv_touch_idle();
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
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
625
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
626
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
627 void serv_got_im(char *name, char *message, int away)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
628 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
629 struct conversation *cnv;
764
a566fc987db9 [gaim-migrate @ 774]
Todd Kulesza <fflewddur>
parents: 752
diff changeset
630 int is_idle = -1;
a566fc987db9 [gaim-migrate @ 774]
Todd Kulesza <fflewddur>
parents: 752
diff changeset
631 int new_conv = 0;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
632
391
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 368
diff changeset
633 char *buffy = g_strdup(message);
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 368
diff changeset
634 char *angel = g_strdup(name);
780
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 771
diff changeset
635 plugin_event(event_im_recv, &angel, &buffy, 0);
391
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 368
diff changeset
636 if (!buffy || !angel)
94
9f6ce50ffb78 [gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
637 return;
391
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 368
diff changeset
638 g_snprintf(message, strlen(message) + 1, "%s", buffy);
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 368
diff changeset
639 g_free(buffy);
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 368
diff changeset
640 g_snprintf(name, strlen(name) + 1, "%s", angel);
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 368
diff changeset
641 g_free(angel);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
642
736
d05d746384a7 [gaim-migrate @ 746]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 710
diff changeset
643 if ((general_options & OPT_GEN_TIK_HACK) && awaymessage &&
764
a566fc987db9 [gaim-migrate @ 774]
Todd Kulesza <fflewddur>
parents: 752
diff changeset
644 !strcmp(message, ">>>Automated Message: Getting Away Message<<<"))
a566fc987db9 [gaim-migrate @ 774]
Todd Kulesza <fflewddur>
parents: 752
diff changeset
645 {
831
97f1ae636ed7 [gaim-migrate @ 841]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 809
diff changeset
646 char *tmpmsg = stylize(awaymessage->message, MSG_LEN);
97f1ae636ed7 [gaim-migrate @ 841]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 809
diff changeset
647 serv_send_im(name, tmpmsg, 1);
97f1ae636ed7 [gaim-migrate @ 841]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 809
diff changeset
648 g_free(tmpmsg);
736
d05d746384a7 [gaim-migrate @ 746]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 710
diff changeset
649 return;
d05d746384a7 [gaim-migrate @ 746]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 710
diff changeset
650 }
d05d746384a7 [gaim-migrate @ 746]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 710
diff changeset
651
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
652 cnv = find_conversation(name);
616
874ed877c854 [gaim-migrate @ 626]
Rob Flynn <gaim@robflynn.com>
parents: 592
diff changeset
653
874ed877c854 [gaim-migrate @ 626]
Rob Flynn <gaim@robflynn.com>
parents: 592
diff changeset
654 if (general_options & OPT_GEN_SEND_LINKS) {
874ed877c854 [gaim-migrate @ 626]
Rob Flynn <gaim@robflynn.com>
parents: 592
diff changeset
655 linkify_text(message);
874ed877c854 [gaim-migrate @ 626]
Rob Flynn <gaim@robflynn.com>
parents: 592
diff changeset
656 }
874ed877c854 [gaim-migrate @ 626]
Rob Flynn <gaim@robflynn.com>
parents: 592
diff changeset
657
764
a566fc987db9 [gaim-migrate @ 774]
Todd Kulesza <fflewddur>
parents: 752
diff changeset
658 if (away)
a566fc987db9 [gaim-migrate @ 774]
Todd Kulesza <fflewddur>
parents: 752
diff changeset
659 away = WFLAG_AUTO;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
660
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
661 if (awaymessage != NULL) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
662 if (!(general_options & OPT_GEN_DISCARD_WHEN_AWAY)) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
663 if (cnv == NULL) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
664 new_conv = 1;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
665 cnv = new_conversation(name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
666 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
667 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
668 if (cnv != NULL) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
669 if (sound_options & OPT_SOUND_WHEN_AWAY)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
670 play_sound(AWAY);
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 447
diff changeset
671 write_to_conv(cnv, message, away | WFLAG_RECV, NULL);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
672 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
673
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
674 } else {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
675 if (cnv == NULL) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
676 new_conv = 1;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
677 cnv = new_conversation(name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
678 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
679 if (new_conv && (sound_options & OPT_SOUND_FIRST_RCV)) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
680 play_sound(FIRST_RECEIVE);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
681 } else {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
682 if (cnv->makesound && (sound_options & OPT_SOUND_RECV))
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
683 play_sound(RECEIVE);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
684 }
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 447
diff changeset
685 write_to_conv(cnv, message, away | WFLAG_RECV, NULL);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
686 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
687
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
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
690
764
a566fc987db9 [gaim-migrate @ 774]
Todd Kulesza <fflewddur>
parents: 752
diff changeset
691 if (awaymessage != NULL) {
a566fc987db9 [gaim-migrate @ 774]
Todd Kulesza <fflewddur>
parents: 752
diff changeset
692 time_t t;
765
bf31bf916f53 [gaim-migrate @ 775]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 764
diff changeset
693 char *tmpmsg;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
694
764
a566fc987db9 [gaim-migrate @ 774]
Todd Kulesza <fflewddur>
parents: 752
diff changeset
695 time(&t);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
696
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
697
764
a566fc987db9 [gaim-migrate @ 774]
Todd Kulesza <fflewddur>
parents: 752
diff changeset
698 if ((cnv == NULL) || (t - cnv->sent_away) < 120)
a566fc987db9 [gaim-migrate @ 774]
Todd Kulesza <fflewddur>
parents: 752
diff changeset
699 return;
a566fc987db9 [gaim-migrate @ 774]
Todd Kulesza <fflewddur>
parents: 752
diff changeset
700
a566fc987db9 [gaim-migrate @ 774]
Todd Kulesza <fflewddur>
parents: 752
diff changeset
701 cnv->sent_away = t;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
702
764
a566fc987db9 [gaim-migrate @ 774]
Todd Kulesza <fflewddur>
parents: 752
diff changeset
703 if (is_idle)
a566fc987db9 [gaim-migrate @ 774]
Todd Kulesza <fflewddur>
parents: 752
diff changeset
704 is_idle = -1;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
705
764
a566fc987db9 [gaim-migrate @ 774]
Todd Kulesza <fflewddur>
parents: 752
diff changeset
706 /* apply default fonts and colors */
765
bf31bf916f53 [gaim-migrate @ 775]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 764
diff changeset
707 tmpmsg = stylize(awaymessage->message, MSG_LEN);
764
a566fc987db9 [gaim-migrate @ 774]
Todd Kulesza <fflewddur>
parents: 752
diff changeset
708
263
8aa7368baae7 [gaim-migrate @ 273]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 260
diff changeset
709 escape_text(tmpmsg);
8aa7368baae7 [gaim-migrate @ 273]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 260
diff changeset
710 escape_message(tmpmsg);
764
a566fc987db9 [gaim-migrate @ 774]
Todd Kulesza <fflewddur>
parents: 752
diff changeset
711 serv_send_im(name, away_subs(tmpmsg, name), 1);
831
97f1ae636ed7 [gaim-migrate @ 841]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 809
diff changeset
712 g_free(tmpmsg);
97f1ae636ed7 [gaim-migrate @ 841]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 809
diff changeset
713 tmpmsg = stylize(awaymessage->message, MSG_LEN);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
714
764
a566fc987db9 [gaim-migrate @ 774]
Todd Kulesza <fflewddur>
parents: 752
diff changeset
715 if (is_idle == -1)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
716 is_idle = 1;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
717
764
a566fc987db9 [gaim-migrate @ 774]
Todd Kulesza <fflewddur>
parents: 752
diff changeset
718 if (cnv != NULL)
765
bf31bf916f53 [gaim-migrate @ 775]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 764
diff changeset
719 write_to_conv(cnv, away_subs(tmpmsg, name), WFLAG_SEND | WFLAG_AUTO, NULL);
bf31bf916f53 [gaim-migrate @ 775]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 764
diff changeset
720 g_free(tmpmsg);
764
a566fc987db9 [gaim-migrate @ 774]
Todd Kulesza <fflewddur>
parents: 752
diff changeset
721 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
722 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
723
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
724
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
725
513
eaddaa0dbbcb [gaim-migrate @ 523]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 511
diff changeset
726 void serv_got_update(char *name, int loggedin, int evil, time_t signon, time_t idle, int type, u_short caps)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
727 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
728 struct buddy *b;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
729 char *nname;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
730
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
731 b = find_buddy(name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
732
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
733 nname = g_strdup(normalize(name));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
734 if (!strcasecmp(nname, normalize(current_user->username))) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
735 correction_time = (int)(signon - login_time);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
736 update_all_buddies();
25
c56db1b46b0d [gaim-migrate @ 34]
Rob Flynn <gaim@robflynn.com>
parents: 14
diff changeset
737 if (!b) {
c56db1b46b0d [gaim-migrate @ 34]
Rob Flynn <gaim@robflynn.com>
parents: 14
diff changeset
738 g_free(nname);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
739 return;
25
c56db1b46b0d [gaim-migrate @ 34]
Rob Flynn <gaim@robflynn.com>
parents: 14
diff changeset
740 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
741 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
742
25
c56db1b46b0d [gaim-migrate @ 34]
Rob Flynn <gaim@robflynn.com>
parents: 14
diff changeset
743 g_free(nname);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
744
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
745 if (!b) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
746 sprintf(debug_buff,"Error, no such person\n");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
747 debug_print(debug_buff);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
748 return;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
749 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
750
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
751 /* This code will 'align' the name from the TOC */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
752 /* server with what's in our record. We want to */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
753 /* store things how THEY want it... */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
754 if (strcmp(name, b->name)) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
755 GList *cnv = conversations;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
756 struct conversation *cv;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
757
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
758 char *who = g_malloc(80);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
759
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
760 strcpy(who, normalize(name));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
761
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
762 while(cnv) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
763 cv = (struct conversation *)cnv->data;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
764 if (!strcasecmp(who, normalize(cv->name))) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
765 g_snprintf(cv->name, sizeof(cv->name), "%s", name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
766 if (find_log_info(name) || (general_options & OPT_GEN_LOG_ALL))
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
767 g_snprintf(who, 63, LOG_CONVERSATION_TITLE, name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
768 else
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
769 g_snprintf(who, 63, CONVERSATION_TITLE, name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
770 gtk_window_set_title(GTK_WINDOW(cv->window), who);
79
bfdc427b936d [gaim-migrate @ 89]
Rob Flynn <gaim@robflynn.com>
parents: 45
diff changeset
771 /* was g_free(buf), but break gives us that
bfdc427b936d [gaim-migrate @ 89]
Rob Flynn <gaim@robflynn.com>
parents: 45
diff changeset
772 * and freeing twice is not good --Sumner */
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
773 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
774 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
775 cnv = cnv->next;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
776 }
45
939455223459 [gaim-migrate @ 54]
Rob Flynn <gaim@robflynn.com>
parents: 25
diff changeset
777 g_free(who);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
778 g_snprintf(b->name, sizeof(b->name), "%s", name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
779 /*gtk_label_set_text(GTK_LABEL(b->label), b->name);*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
780
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
781 /* okay lets save the new config... */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
782
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
783 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
784
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
785 b->idle = idle;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
786 b->evil = evil;
780
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 771
diff changeset
787
136
4e91b92f91a7 [gaim-migrate @ 146]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 115
diff changeset
788 if ((b->uc & UC_UNAVAILABLE) && !(type & UC_UNAVAILABLE)) {
780
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 771
diff changeset
789 plugin_event(event_buddy_back, b->name, 0, 0);
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 771
diff changeset
790 } else if (!(b->uc & UC_UNAVAILABLE) && (type & UC_UNAVAILABLE)) {
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 771
diff changeset
791 plugin_event(event_buddy_away, b->name, 0, 0);
136
4e91b92f91a7 [gaim-migrate @ 146]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 115
diff changeset
792 }
780
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 771
diff changeset
793
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
794 b->uc = type;
515
b33ed0a7f49b [gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 513
diff changeset
795 if (caps) b->caps = caps;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
796
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
797 b->signon = signon;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
798
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
799 if (loggedin) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
800 if (!b->present) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
801 b->present = 1;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
802 do_pounce(b->name);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
803 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
804 } else
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
805 b->present = 0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
806
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
807 set_buddy(b);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
808 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
809
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
810 static
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
811 void close_warned(GtkWidget *w, GtkWidget *w2)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
812 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
813 gtk_widget_destroy(w2);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
814 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
815
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
816
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
817
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
818 void serv_got_eviled(char *name, int lev)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
819 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
820 char *buf2 = g_malloc(1024);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
821 GtkWidget *d, *label, *close;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
822
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
823
780
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 771
diff changeset
824 plugin_event(event_warned, name, (void *)lev, 0);
391
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 368
diff changeset
825
400
bb87776942c4 [gaim-migrate @ 410]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 391
diff changeset
826 g_snprintf(buf2, 1023, "You have just been warned by %s.\nYour new warning level is %d%%",
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
827 ((name == NULL) ? "an anonymous person" : name) , lev);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
828
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
829
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
830 d = gtk_dialog_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
831 gtk_widget_realize(d);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
832 aol_icon(d->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
833
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
834 label = gtk_label_new(buf2);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
835 gtk_widget_show(label);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
836 close = gtk_button_new_with_label("Close");
535
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 528
diff changeset
837 if (display_options & OPT_DISP_COOL_LOOK)
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 528
diff changeset
838 gtk_button_set_relief(GTK_BUTTON(close), GTK_RELIEF_NONE);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
839 gtk_widget_show(close);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
840 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(d)->vbox),
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
841 label, FALSE, FALSE, 5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
842 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(d)->action_area),
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
843 close, FALSE, FALSE, 5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
844
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
845 gtk_window_set_title(GTK_WINDOW(d), "Warned");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
846 gtk_signal_connect(GTK_OBJECT(close), "clicked", GTK_SIGNAL_FUNC(close_warned), d);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
847 gtk_widget_show(d);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
848 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
849
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
850
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
851
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
852 static void close_invite(GtkWidget *w, GtkWidget *w2)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
853 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
854 gtk_widget_destroy(w2);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
855 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
856
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
857 static void chat_invite_callback(GtkWidget *w, GtkWidget *w2)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
858 {
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
859 if (!USE_OSCAR) {
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
860 int i = (int)gtk_object_get_user_data(GTK_OBJECT(w2));
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
861 serv_accept_chat(i);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
862 gtk_widget_destroy(w2);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
863 } else {
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
864 char *i = (char *)gtk_object_get_user_data(GTK_OBJECT(w2));
693
30a8e386849d [gaim-migrate @ 703]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 692
diff changeset
865 int id = (int)gtk_object_get_user_data(GTK_OBJECT(w));
30a8e386849d [gaim-migrate @ 703]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 692
diff changeset
866 serv_join_chat(id, i);
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
867 g_free(i);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
868 gtk_widget_destroy(w2);
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
869 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
870 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
871
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
872
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
873
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
874 void serv_got_chat_invite(char *name, int id, char *who, char *message)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
875 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
876 GtkWidget *d;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
877 GtkWidget *label;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
878 GtkWidget *yesbtn;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
879 GtkWidget *nobtn;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
880
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
881 char buf2[BUF_LONG];
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
882
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
883
780
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 771
diff changeset
884 plugin_event(event_chat_invited, who, name, message);
391
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 368
diff changeset
885
414
f9dc74875833 [gaim-migrate @ 424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
886 if (message)
f9dc74875833 [gaim-migrate @ 424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
887 g_snprintf(buf2, sizeof(buf2), "User '%s' invites you to buddy chat room: '%s'\n%s", who, name, message);
f9dc74875833 [gaim-migrate @ 424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
888 else
f9dc74875833 [gaim-migrate @ 424]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
889 g_snprintf(buf2, sizeof(buf2), "User '%s' invites you to buddy chat room: '%s'\n", who, name);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
890
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
891 d = gtk_dialog_new();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
892 gtk_widget_realize(d);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
893 aol_icon(d->window);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
894
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
895
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
896 label = gtk_label_new(buf2);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
897 gtk_widget_show(label);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
898 yesbtn = gtk_button_new_with_label("Yes");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
899 gtk_widget_show(yesbtn);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
900 nobtn = gtk_button_new_with_label("No");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
901 gtk_widget_show(nobtn);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
902 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(d)->vbox),
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
903 label, FALSE, FALSE, 5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
904 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(d)->action_area),
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
905 yesbtn, FALSE, FALSE, 5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
906 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(d)->action_area),
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
907 nobtn, FALSE, FALSE, 5);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
908
535
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 528
diff changeset
909 if (display_options & OPT_DISP_COOL_LOOK)
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 528
diff changeset
910 gtk_button_set_relief(GTK_BUTTON(yesbtn), GTK_RELIEF_NONE);
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 528
diff changeset
911 if (display_options & OPT_DISP_COOL_LOOK)
f03f041c1aa9 [gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 528
diff changeset
912 gtk_button_set_relief(GTK_BUTTON(nobtn), GTK_RELIEF_NONE);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
913
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
914 /* gtk_widget_set_usize(d, 200, 110); */
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
915
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
916 if (!USE_OSCAR)
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
917 gtk_object_set_user_data(GTK_OBJECT(d), (void *)id);
693
30a8e386849d [gaim-migrate @ 703]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 692
diff changeset
918 else {
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
919 gtk_object_set_user_data(GTK_OBJECT(d), (void *)g_strdup(name));
693
30a8e386849d [gaim-migrate @ 703]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 692
diff changeset
920 gtk_object_set_user_data(GTK_OBJECT(yesbtn), (void *)id);
30a8e386849d [gaim-migrate @ 703]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 692
diff changeset
921 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
922
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
923
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
924 gtk_window_set_title(GTK_WINDOW(d), "Buddy chat invite");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
925 gtk_signal_connect(GTK_OBJECT(nobtn), "clicked", GTK_SIGNAL_FUNC(close_invite), d);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
926 gtk_signal_connect(GTK_OBJECT(yesbtn), "clicked", GTK_SIGNAL_FUNC(chat_invite_callback), d);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
927
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
928
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
929 gtk_widget_show(d);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
930 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
931
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
932 void serv_got_joined_chat(int id, char *name)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
933 {
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 447
diff changeset
934 struct conversation *b;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
935
780
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 771
diff changeset
936 plugin_event(event_chat_join, name, 0, 0);
391
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 368
diff changeset
937
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 447
diff changeset
938 b = (struct conversation *)g_new0(struct conversation, 1);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
939 buddy_chats = g_list_append(buddy_chats, b);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
940
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 447
diff changeset
941 b->is_chat = TRUE;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
942 b->ignored = NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
943 b->in_room = NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
944 b->id = id;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
945 g_snprintf(b->name, 80, "%s", name);
888
38ffd1faa31a [gaim-migrate @ 898]
Rob Flynn <gaim@robflynn.com>
parents: 834
diff changeset
946
38ffd1faa31a [gaim-migrate @ 898]
Rob Flynn <gaim@robflynn.com>
parents: 834
diff changeset
947 if ((general_options & OPT_GEN_LOG_ALL) || find_log_info(b->name)) {
38ffd1faa31a [gaim-migrate @ 898]
Rob Flynn <gaim@robflynn.com>
parents: 834
diff changeset
948 FILE *fd;
38ffd1faa31a [gaim-migrate @ 898]
Rob Flynn <gaim@robflynn.com>
parents: 834
diff changeset
949 char *filename;
38ffd1faa31a [gaim-migrate @ 898]
Rob Flynn <gaim@robflynn.com>
parents: 834
diff changeset
950
38ffd1faa31a [gaim-migrate @ 898]
Rob Flynn <gaim@robflynn.com>
parents: 834
diff changeset
951 filename = (char *)malloc(100);
38ffd1faa31a [gaim-migrate @ 898]
Rob Flynn <gaim@robflynn.com>
parents: 834
diff changeset
952 snprintf(filename, 100, "%s.chat", b->name);
38ffd1faa31a [gaim-migrate @ 898]
Rob Flynn <gaim@robflynn.com>
parents: 834
diff changeset
953
38ffd1faa31a [gaim-migrate @ 898]
Rob Flynn <gaim@robflynn.com>
parents: 834
diff changeset
954 fd = open_log_file(filename);
38ffd1faa31a [gaim-migrate @ 898]
Rob Flynn <gaim@robflynn.com>
parents: 834
diff changeset
955 if (!(general_options & OPT_GEN_STRIP_HTML))
38ffd1faa31a [gaim-migrate @ 898]
Rob Flynn <gaim@robflynn.com>
parents: 834
diff changeset
956 fprintf(fd, "<HR><BR><H3 Align=Center> ---- New Conversation @ %s ----</H3><BR>\n", full_date());
38ffd1faa31a [gaim-migrate @ 898]
Rob Flynn <gaim@robflynn.com>
parents: 834
diff changeset
957 else
38ffd1faa31a [gaim-migrate @ 898]
Rob Flynn <gaim@robflynn.com>
parents: 834
diff changeset
958 fprintf(fd, "---- New Conversation @ %s ----\n", full_date());
38ffd1faa31a [gaim-migrate @ 898]
Rob Flynn <gaim@robflynn.com>
parents: 834
diff changeset
959
38ffd1faa31a [gaim-migrate @ 898]
Rob Flynn <gaim@robflynn.com>
parents: 834
diff changeset
960 fclose(fd);
38ffd1faa31a [gaim-migrate @ 898]
Rob Flynn <gaim@robflynn.com>
parents: 834
diff changeset
961 free(filename);
38ffd1faa31a [gaim-migrate @ 898]
Rob Flynn <gaim@robflynn.com>
parents: 834
diff changeset
962 }
38ffd1faa31a [gaim-migrate @ 898]
Rob Flynn <gaim@robflynn.com>
parents: 834
diff changeset
963
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
964 show_new_buddy_chat(b);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
965 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
966
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
967 void serv_got_chat_left(int id)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
968 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
969 GList *bcs = buddy_chats;
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 447
diff changeset
970 struct conversation *b = NULL;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
971
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
972
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
973 while(bcs) {
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 447
diff changeset
974 b = (struct conversation *)bcs->data;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
975 if (id == b->id) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
976 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
977 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
978 b = NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
979 bcs = bcs->next;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
980 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
981
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
982 if (!b)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
983 return;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
984
780
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 771
diff changeset
985 plugin_event(event_chat_leave, b->name, 0, 0);
391
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 368
diff changeset
986
368
9bf1f77985d2 [gaim-migrate @ 378]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
987 sprintf(debug_buff, "Leaving room %s.\n", b->name);
9bf1f77985d2 [gaim-migrate @ 378]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
988 debug_print(debug_buff);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
989
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
990 buddy_chats = g_list_remove(buddy_chats, b);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
991
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
992 g_free(b);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
993 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
994
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
995 void serv_got_chat_in(int id, char *who, int whisper, char *message)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
996 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
997 int w;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
998 GList *bcs = buddy_chats;
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 447
diff changeset
999 struct conversation *b = NULL;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1000
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1001 while(bcs) {
472
6a92cd7322cc [gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 447
diff changeset
1002 b = (struct conversation *)bcs->data;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1003 if (id == b->id)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1004 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1005 bcs = bcs->next;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1006 b = NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1007
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1008 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1009 if (!b)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1010 return;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1011
780
c714def9cebb [gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 771
diff changeset
1012 plugin_event(event_chat_recv, b->name, who, message);
391
be408b41c172 [gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 368
diff changeset
1013
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1014 if (whisper)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1015 w = WFLAG_WHISPER;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1016 else
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1017 w = 0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1018
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1019 chat_write(b, who, w, message);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1020 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1021
260
325d9804df10 [gaim-migrate @ 270]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 258
diff changeset
1022 void serv_rvous_accept(char *name, char *cookie, char *uid)
325d9804df10 [gaim-migrate @ 270]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 258
diff changeset
1023 {
423
0d4e80bdb96b [gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 414
diff changeset
1024 /* Oscar doesn't matter here because this won't ever be called for it */
260
325d9804df10 [gaim-migrate @ 270]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 258
diff changeset
1025 char buf[MSG_LEN];
325d9804df10 [gaim-migrate @ 270]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 258
diff changeset
1026 g_snprintf(buf, MSG_LEN, "toc_rvous_accept %s %s %s", normalize(name),
325d9804df10 [gaim-migrate @ 270]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 258
diff changeset
1027 cookie, uid);
325d9804df10 [gaim-migrate @ 270]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 258
diff changeset
1028 sflap_send(buf, strlen(buf), TYPE_DATA);
325d9804df10 [gaim-migrate @ 270]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 258
diff changeset
1029 }
325d9804df10 [gaim-migrate @ 270]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 258
diff changeset
1030
325d9804df10 [gaim-migrate @ 270]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 258
diff changeset
1031 void serv_rvous_cancel(char *name, char *cookie, char *uid)
325d9804df10 [gaim-migrate @ 270]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 258
diff changeset
1032 {
325d9804df10 [gaim-migrate @ 270]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 258
diff changeset
1033 char buf[MSG_LEN];
325d9804df10 [gaim-migrate @ 270]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 258
diff changeset
1034 g_snprintf(buf, MSG_LEN, "toc_rvous_cancel %s %s %s", normalize(name),
325d9804df10 [gaim-migrate @ 270]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 258
diff changeset
1035 cookie, uid);
325d9804df10 [gaim-migrate @ 270]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 258
diff changeset
1036 sflap_send(buf, strlen(buf), TYPE_DATA);
325d9804df10 [gaim-migrate @ 270]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 258
diff changeset
1037 }
511
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
1038
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
1039 void serv_do_imimage(GtkWidget *w, char *name) {
515
b33ed0a7f49b [gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 513
diff changeset
1040 struct conversation *cnv = find_conversation(name);
b33ed0a7f49b [gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 513
diff changeset
1041 if (!cnv) cnv = new_conversation(name);
b33ed0a7f49b [gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 513
diff changeset
1042
511
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
1043 if (!USE_OSCAR) {
834
bac7089491c1 [gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 831
diff changeset
1044 /* Direct IM TOC FIXME */
511
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
1045 } else {
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
1046 oscar_do_directim(name);
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
1047 }
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
1048 }
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
1049
515
b33ed0a7f49b [gaim-migrate @ 525]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 513
diff changeset
1050 void serv_got_imimage(char *name, char *cookie, char *ip, struct aim_conn_t *conn, int watcher)
511
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
1051 {
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
1052 if (!USE_OSCAR) {
834
bac7089491c1 [gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 831
diff changeset
1053 /* Direct IM TOC FIXME */
511
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
1054 } else {
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
1055 struct conversation *cnv = find_conversation(name);
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
1056 if (!cnv) cnv = new_conversation(name);
516
ee4e18868584 [gaim-migrate @ 526]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 515
diff changeset
1057 make_direct(cnv, TRUE, conn, watcher);
511
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
1058 }
3133ab511d92 [gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 503
diff changeset
1059 }