Mercurial > pidgin
annotate src/protocols/oscar/stats.c @ 5129:c19cc54f4df6
[gaim-migrate @ 5492]
Stuff I did (in order from most important to least):
-Made set away message and set profile count the number of bytes
rather than the number of characters. This fixes the lack of a
warning dialog when setting info that needs an encoding other than
ascii or iso8859-1. (Because "hi" in UCS-2BE is 4 bytes but "hi"
in utf8 is only 2.)
-Created an oscar_encoding_to_utf8 function to convert from a given
encoding to utf8. This is AIM/ICQ specific.
-Added a "Profile:" and "Away Message:" line to the get info response
window. Is it better this way or without it? I thought it would be
good if there was a way for users to tell which text was the away
message and which was the info, but I also think this solution could
be nicer looking.
-Added a little check for some server icon stuff because someone
reported an obscure crash.
-Shuffled some stuff around in oscar.c
-Bouldered on the little wall outside of the gym today. It's much
more difficult than climbing inside. I think my forearms are just
a bit too weak. The holds are tiny, though.
committer: Tailor Script <tailor@pidgin.im>
| author | Mark Doliner <mark@kingant.net> |
|---|---|
| date | Mon, 14 Apr 2003 04:52:42 +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 } |
