Mercurial > pidgin
comparison src/protocols/oscar/info.c @ 4853:fbfdacf7c611
[gaim-migrate @ 5180]
This is better auto-getting of icons for oscar.
Ethan made me write a tobase16 fucntion and a from16 function (and he
done gave me some good advice for that, too) which convert to and
from arbitrary data and a null terminated string of hex. I use these
to get and store the md5 checksum for each icon sent to you. This way,
Gaim will request the icon when the md5sum differs. Er, so the md5sum
is stored in blist.xml.
Previously, Gaim would only request the icon if you did not have any
buddy icon for the other person. Now it will request it if the local
md5sum differs from the server md5sum.
To sum it up again, if their icon changes, gaim will request the new one.
I tried using the base64 functions, but they look like they want to
work with null terminated strings, rather than arbitrary data.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sat, 22 Mar 2003 07:29:34 +0000 |
parents | a4d3243499bb |
children | 773135edda4a |
comparison
equal
deleted
inserted
replaced
4852:d1c17e81055e | 4853:fbfdacf7c611 |
---|---|
631 * | 631 * |
632 * Buddy icon information. This contains the info | 632 * Buddy icon information. This contains the info |
633 * about the buddy icon that the user has stored on | 633 * about the buddy icon that the user has stored on |
634 * the server. | 634 * the server. |
635 */ | 635 */ |
636 int type, subtype, len; | 636 int flags, number, len; |
637 char *iconstr; | 637 fu8_t *csum; |
638 | |
638 while (aim_bstream_curpos(bs) < endpos) { | 639 while (aim_bstream_curpos(bs) < endpos) { |
639 type = aimbs_get16(bs); | 640 flags = aimbs_get16(bs); |
640 subtype = aimbs_get8(bs); | 641 number = aimbs_get8(bs); |
641 if ((type != 0x0001) || (subtype != 0x01)) { | 642 len = aimbs_get8(bs); |
642 aim_bstream_advance(bs, aimbs_get8(bs)); | 643 if ((flags & 0x0001) && (number == 0x01) && (len < 30)) { |
643 } else { | 644 csum = aimbs_getraw(bs, len); |
644 len = aimbs_get8(bs); | 645 memcpy(outinfo->iconcsum, csum, len); |
645 if (len < 30) { | 646 outinfo->iconcsumlen = len; |
646 iconstr = aimbs_getraw(bs, len); | 647 free(csum); |
647 memcpy(outinfo->iconstr, iconstr, len); | 648 } else |
648 outinfo->iconstrlen = len; | 649 aim_bstream_advance(bs, len); |
649 free(iconstr); | |
650 } else { | |
651 aim_bstream_advance(bs, len); | |
652 } | |
653 } | |
654 } | 650 } |
655 | 651 |
656 } else if (type == 0x001e) { | 652 } else if (type == 0x001e) { |
657 /* | 653 /* |
658 * Type 30: Unknown. | 654 * Type 30: Unknown. |