Mercurial > pidgin.yaz
diff src/protocols/oscar/service.c @ 5842:dbed8c87f750
[gaim-migrate @ 6273]
Another reason not to use CVS.
This saves your buddy icons to the OSCAR servers (I hope). It's not fully
tested and it may screw things up, but I wanted to get it in CVS so other people
can try to break this, and KingAnt can review my work (that libfaim wizard that
he is.) Don't use CVS.
I'd like to thank Christian Hammond, for his work on the account and prpl APIs
that made it so easy to add the hook into buddy icon changing. I'd like to thank
Mark Doliner for laying most of the groundwork and for his kind words of encouragement.
I'd like to thank myself for making the buddy icon selector real sexy-like. I'd like
to thank the Lord almighty for giving me the strength to do this.
I promised myself I wouldn't cry. I never imagined I'd be committing this.
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Thu, 12 Jun 2003 22:19:07 +0000 |
parents | a48c338dff6c |
children | ec963ca8c9ee |
line wrap: on
line diff
--- a/src/protocols/oscar/service.c Thu Jun 12 18:17:31 2003 +0000 +++ b/src/protocols/oscar/service.c Thu Jun 12 22:19:07 2003 +0000 @@ -946,26 +946,38 @@ * Subtype 0x0021 - Receive our extended status * * This is used for MAC non-away "away" messages, and maybe ICQ extended status messages? + * It's also used to tell the client whether or not it needs to upload an SSI buddy icon... who engineers this stuff, anyway? */ static int aim_parse_extstatus(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) { - int ret = 0; + int ret = 0, i; aim_rxcallback_t userfunc; - char *msg = NULL; + char *msg = NULL, *md5 = NULL; fu16_t type; - fu8_t number, length; + fu8_t number, length, cached; - type = aimbs_get16(bs); /* 0x0002 */ - number = aimbs_get8(bs); /* 0x04 */ - length = aimbs_get8(bs); /* the first length */ - msg = aimbs_getstr(bs, aimbs_get16(bs)); /* the second length is just for the message */ - - if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) - ret = userfunc(sess, rx, msg); - - free(msg); - - return ret; + type = aimbs_get16(bs); + printf("blah: %d\n", type); + if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) { + switch (type) { + case 0x0001: + case 0x0000: /* not sure what the difference between 1 and 0 is */ + cached = aimbs_get8(bs); + length = aimbs_get8(bs); + md5 = aimbs_getraw(bs, length); + ret = userfunc(sess, rx, type, cached, length, md5); + free(md5); + break; + case 0x0002: + number = aimbs_get8(bs); /* 0x04 */ + length = aimbs_get8(bs); /* the first length */ + msg = aimbs_getstr(bs, aimbs_get16(bs)); /* the second length is just for the message */ + ret = userfunc(sess, rx, msg); + free(msg); + break; + } + return ret; + } } static int snachandler(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)