Mercurial > pidgin.yaz
annotate src/protocols/oscar/stats.c @ 13196:f04dffe22957
[gaim-migrate @ 15559]
This fixes the GaimPluginAction crash/not working. We were freeing the data that we were using in the a
I haven't leak checked this, but it _should_ be alright..
committer: Tailor Script <tailor@pidgin.im>
author | Gary Kramlich <grim@reaperworld.com> |
---|---|
date | Thu, 09 Feb 2006 00:14:40 +0000 |
parents | 0b64f386a7b8 |
children |
rev | line source |
---|---|
3952 | 1 /* |
2 * Family 0x000b - Statistics. | |
3 * | |
4 */ | |
2086 | 5 |
6 #define FAIM_INTERNAL | |
7 #include <aim.h> | |
8 | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
9 static int reportinterval(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) |
2086 | 10 { |
4871 | 11 int ret = 0; |
12 aim_rxcallback_t userfunc; | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
13 fu16_t interval; |
2086 | 14 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
15 interval = aimbs_get16(bs); |
2086 | 16 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
17 if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) |
4871 | 18 ret = userfunc(sess, rx, interval); |
2086 | 19 |
4871 | 20 return ret; |
2086 | 21 } |
22 | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
23 static int snachandler(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) |
2086 | 24 { |
25 | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
26 if (snac->subtype == 0x0002) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
27 return reportinterval(sess, mod, rx, snac, bs); |
2086 | 28 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
29 return 0; |
2086 | 30 } |
31 | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
32 faim_internal int stats_modfirst(aim_session_t *sess, aim_module_t *mod) |
2086 | 33 { |
34 | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
35 mod->family = 0x000b; |
2672 | 36 mod->version = 0x0001; |
37 mod->toolid = 0x0104; | |
38 mod->toolversion = 0x0001; | |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
39 mod->flags = 0; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
40 strncpy(mod->name, "stats", sizeof(mod->name)); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
41 mod->snachandler = snachandler; |
2086 | 42 |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2086
diff
changeset
|
43 return 0; |
2086 | 44 } |