Mercurial > pidgin.yaz
comparison src/protocols/oscar/oscar.c @ 5872:059d95c67cda
[gaim-migrate @ 6304]
The legendary Header File Cleanup! Files now only include what they need.
This should reduce the number of files that must recompile when a header
file changes. It's a lot nicer. Trust me on it. I also added a couple new
header files. I hope I didn't break TOO much!
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Sat, 14 Jun 2003 23:21:02 +0000 |
parents | d048e5f2af27 |
children | da8939ad60b6 |
comparison
equal
deleted
inserted
replaced
5871:508adf90fbb9 | 5872:059d95c67cda |
---|---|
17 * You should have received a copy of the GNU General Public License | 17 * You should have received a copy of the GNU General Public License |
18 * along with this program; if not, write to the Free Software | 18 * along with this program; if not, write to the Free Software |
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
20 * | 20 * |
21 */ | 21 */ |
22 | 22 #include "internal.h" |
23 #ifdef HAVE_CONFIG_H | 23 |
24 #include <config.h> | 24 #include "account.h" |
25 #endif | |
26 | |
27 #include <sys/types.h> | |
28 /* this must happen before sys/socket.h or freebsd won't compile */ | |
29 | |
30 #ifndef _WIN32 | |
31 #include <netdb.h> | |
32 #include <netinet/in.h> | |
33 #include <arpa/inet.h> | |
34 #include <sys/socket.h> | |
35 #include <unistd.h> | |
36 #endif | |
37 | |
38 #include <errno.h> | |
39 #include <ctype.h> | |
40 #include <string.h> | |
41 #include <stdlib.h> | |
42 #include <stdio.h> | |
43 #include <time.h> | |
44 #include <sys/stat.h> | |
45 #include <signal.h> | |
46 | |
47 #include "gaim.h" | |
48 #include "accountopt.h" | 25 #include "accountopt.h" |
26 #include "conversation.h" | |
27 #include "debug.h" | |
28 #include "ft.h" | |
49 #include "multi.h" | 29 #include "multi.h" |
30 #include "notify.h" | |
31 #include "privacy.h" | |
50 #include "prpl.h" | 32 #include "prpl.h" |
51 #include "core.h" | |
52 #include "proxy.h" | 33 #include "proxy.h" |
34 #include "request.h" | |
35 #include "util.h" | |
36 | |
53 #include "aim.h" | 37 #include "aim.h" |
54 #include "md5.h" | 38 #include "md5.h" |
55 | 39 |
56 #ifdef _WIN32 | 40 /* XXX */ |
57 #include "win32dep.h" | 41 #include "gaim.h" |
58 #endif | 42 #include "ui.h" |
59 | 43 |
60 | 44 |
61 #define UC_AOL 0x02 | 45 #define UC_AOL 0x02 |
62 #define UC_ADMIN 0x04 | 46 #define UC_ADMIN 0x04 |
63 #define UC_UNCONFIRMED 0x08 | 47 #define UC_UNCONFIRMED 0x08 |
3014 case 0x0000: { /* Text has been cleared */ | 2998 case 0x0000: { /* Text has been cleared */ |
3015 serv_got_typing_stopped(gc, sn); | 2999 serv_got_typing_stopped(gc, sn); |
3016 } break; | 3000 } break; |
3017 | 3001 |
3018 case 0x0001: { /* Paused typing */ | 3002 case 0x0001: { /* Paused typing */ |
3019 serv_got_typing(gc, sn, 0, TYPED); | 3003 serv_got_typing(gc, sn, 0, GAIM_TYPED); |
3020 } break; | 3004 } break; |
3021 | 3005 |
3022 case 0x0002: { /* Typing */ | 3006 case 0x0002: { /* Typing */ |
3023 serv_got_typing(gc, sn, 0, TYPING); | 3007 serv_got_typing(gc, sn, 0, GAIM_TYPING); |
3024 } break; | 3008 } break; |
3025 | 3009 |
3026 default: { | 3010 default: { |
3027 gaim_debug(GAIM_DEBUG_ERROR, "oscar", "Received unknown typing notification message from %s. Type1 is 0x%04x and type2 is 0x%04hx.\n", sn, type1, type2); | 3011 gaim_debug(GAIM_DEBUG_ERROR, "oscar", "Received unknown typing notification message from %s. Type1 is 0x%04x and type2 is 0x%04hx.\n", sn, type1, type2); |
3028 } break; | 3012 } break; |
4220 | 4204 |
4221 static int oscar_send_typing(GaimConnection *gc, char *name, int typing) { | 4205 static int oscar_send_typing(GaimConnection *gc, char *name, int typing) { |
4222 struct oscar_data *od = (struct oscar_data *)gc->proto_data; | 4206 struct oscar_data *od = (struct oscar_data *)gc->proto_data; |
4223 struct direct_im *dim = find_direct_im(od, name); | 4207 struct direct_im *dim = find_direct_im(od, name); |
4224 if (dim) | 4208 if (dim) |
4225 if (typing == TYPING) | 4209 if (typing == GAIM_TYPING) |
4226 aim_odc_send_typing(od->sess, dim->conn, 0x0002); | 4210 aim_odc_send_typing(od->sess, dim->conn, 0x0002); |
4227 else if (typing == TYPED) | 4211 else if (typing == GAIM_TYPED) |
4228 aim_odc_send_typing(od->sess, dim->conn, 0x0001); | 4212 aim_odc_send_typing(od->sess, dim->conn, 0x0001); |
4229 else | 4213 else |
4230 aim_odc_send_typing(od->sess, dim->conn, 0x0000); | 4214 aim_odc_send_typing(od->sess, dim->conn, 0x0000); |
4231 else { | 4215 else { |
4232 /* Don't send if this turkey is in our deny list */ | 4216 /* Don't send if this turkey is in our deny list */ |
4233 GSList *list; | 4217 GSList *list; |
4234 for (list=gc->account->deny; (list && aim_sncmp(name, list->data)); list=list->next); | 4218 for (list=gc->account->deny; (list && aim_sncmp(name, list->data)); list=list->next); |
4235 if (!list) { | 4219 if (!list) { |
4236 struct buddyinfo *bi = g_hash_table_lookup(od->buddyinfo, normalize(name)); | 4220 struct buddyinfo *bi = g_hash_table_lookup(od->buddyinfo, normalize(name)); |
4237 if (bi && bi->typingnot) { | 4221 if (bi && bi->typingnot) { |
4238 if (typing == TYPING) | 4222 if (typing == GAIM_TYPING) |
4239 aim_im_sendmtn(od->sess, 0x0001, name, 0x0002); | 4223 aim_im_sendmtn(od->sess, 0x0001, name, 0x0002); |
4240 else if (typing == TYPED) | 4224 else if (typing == GAIM_TYPED) |
4241 aim_im_sendmtn(od->sess, 0x0001, name, 0x0001); | 4225 aim_im_sendmtn(od->sess, 0x0001, name, 0x0001); |
4242 else | 4226 else |
4243 aim_im_sendmtn(od->sess, 0x0001, name, 0x0000); | 4227 aim_im_sendmtn(od->sess, 0x0001, name, 0x0000); |
4244 } | 4228 } |
4245 } | 4229 } |
5625 | 5609 |
5626 if (typing == 0x0002) { | 5610 if (typing == 0x0002) { |
5627 /* I had to leave this. It's just too funny. It reminds me of my sister. */ | 5611 /* I had to leave this. It's just too funny. It reminds me of my sister. */ |
5628 gaim_debug(GAIM_DEBUG_INFO, "oscar", | 5612 gaim_debug(GAIM_DEBUG_INFO, "oscar", |
5629 "ohmigod! %s has started typing (DirectIM). He's going to send you a message! *squeal*\n", sn); | 5613 "ohmigod! %s has started typing (DirectIM). He's going to send you a message! *squeal*\n", sn); |
5630 serv_got_typing(gc, sn, 0, TYPING); | 5614 serv_got_typing(gc, sn, 0, GAIM_TYPING); |
5631 } else if (typing == 0x0001) | 5615 } else if (typing == 0x0001) |
5632 serv_got_typing(gc, sn, 0, TYPED); | 5616 serv_got_typing(gc, sn, 0, GAIM_TYPED); |
5633 else | 5617 else |
5634 serv_got_typing_stopped(gc, sn); | 5618 serv_got_typing_stopped(gc, sn); |
5635 return 1; | 5619 return 1; |
5636 } | 5620 } |
5637 | 5621 |