Mercurial > pidgin
annotate libfaim/stats.c @ 2081:d83fe4ac3d7e
[gaim-migrate @ 2091]
Send keepalives.
committer: Tailor Script <tailor@pidgin.im>
author | Adam Fritzler <mid@auk.cx> |
---|---|
date | Mon, 23 Jul 2001 20:14:42 +0000 |
parents | 109cacf1ff97 |
children |
rev | line source |
---|---|
1649 | 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; | |
1839
109cacf1ff97
[gaim-migrate @ 1849]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1649
diff
changeset
|
8 aim_rxcallback_t userfunc; |
1649 | 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 } |