annotate libfaim/stats.c @ 1676:a3d857c8984e

[gaim-migrate @ 1686] IRC got away message support. committer: Tailor Script <tailor@pidgin.im>
author Rob Flynn <gaim@robflynn.com>
date Sat, 31 Mar 2001 22:46:54 +0000
parents 3fe5799b7823
children 109cacf1ff97
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1649
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents:
diff changeset
1
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents:
diff changeset
2 #define FAIM_INTERNAL
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents:
diff changeset
3 #include <aim.h>
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents:
diff changeset
4
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents:
diff changeset
5 static int reportinterval(struct aim_session_t *sess, aim_module_t *mod, struct command_rx_struct *rx, aim_modsnac_t *snac, unsigned char *data, int datalen)
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents:
diff changeset
6 {
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents:
diff changeset
7 unsigned short interval;
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents:
diff changeset
8 rxcallback_t userfunc;
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents:
diff changeset
9
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents:
diff changeset
10 interval = aimutil_get16(data);
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents:
diff changeset
11
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents:
diff changeset
12 if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype)))
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents:
diff changeset
13 return userfunc(sess, rx, interval);
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents:
diff changeset
14
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents:
diff changeset
15 return 0;
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents:
diff changeset
16 }
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents:
diff changeset
17
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents:
diff changeset
18 static int snachandler(struct aim_session_t *sess, aim_module_t *mod, struct command_rx_struct *rx, aim_modsnac_t *snac, unsigned char *data, int datalen)
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents:
diff changeset
19 {
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents:
diff changeset
20
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents:
diff changeset
21 if (snac->subtype == 0x0002)
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents:
diff changeset
22 return reportinterval(sess, mod, rx, snac, data, datalen);
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents:
diff changeset
23
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents:
diff changeset
24 return 0;
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents:
diff changeset
25 }
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents:
diff changeset
26
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents:
diff changeset
27 faim_internal int stats_modfirst(struct aim_session_t *sess, aim_module_t *mod)
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents:
diff changeset
28 {
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents:
diff changeset
29
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents:
diff changeset
30 mod->family = 0x000b;
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents:
diff changeset
31 mod->version = 0x0000;
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents:
diff changeset
32 mod->flags = 0;
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents:
diff changeset
33 strncpy(mod->name, "stats", sizeof(mod->name));
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents:
diff changeset
34 mod->snachandler = snachandler;
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents:
diff changeset
35
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents:
diff changeset
36 return 0;
3fe5799b7823 [gaim-migrate @ 1659]
Adam Fritzler <mid@auk.cx>
parents:
diff changeset
37 }