2086
|
1
|
|
2 #define FAIM_INTERNAL
|
|
3 #include <aim.h>
|
|
4
|
|
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)
|
|
6 {
|
|
7 unsigned short interval;
|
|
8 aim_rxcallback_t userfunc;
|
|
9
|
|
10 interval = aimutil_get16(data);
|
|
11
|
|
12 if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype)))
|
|
13 return userfunc(sess, rx, interval);
|
|
14
|
|
15 return 0;
|
|
16 }
|
|
17
|
|
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)
|
|
19 {
|
|
20
|
|
21 if (snac->subtype == 0x0002)
|
|
22 return reportinterval(sess, mod, rx, snac, data, datalen);
|
|
23
|
|
24 return 0;
|
|
25 }
|
|
26
|
|
27 faim_internal int stats_modfirst(struct aim_session_t *sess, aim_module_t *mod)
|
|
28 {
|
|
29
|
|
30 mod->family = 0x000b;
|
|
31 mod->version = 0x0000;
|
|
32 mod->flags = 0;
|
|
33 strncpy(mod->name, "stats", sizeof(mod->name));
|
|
34 mod->snachandler = snachandler;
|
|
35
|
|
36 return 0;
|
|
37 }
|