Mercurial > pidgin
comparison src/protocols/oscar/info.c @ 6292:6651ecdda5d6
[gaim-migrate @ 6791]
This makes umlauts and accents and other suck iso-8859-1 characters show
up in available messages--and not crash Gaim.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Thu, 24 Jul 2003 02:04:19 +0000 |
parents | 30d4c432101c |
children | 96196cfb132e |
comparison
equal
deleted
inserted
replaced
6291:9287c2897a07 | 6292:6651ecdda5d6 |
---|---|
448 } | 448 } |
449 | 449 |
450 faim_internal void aim_info_free(aim_userinfo_t *info) | 450 faim_internal void aim_info_free(aim_userinfo_t *info) |
451 { | 451 { |
452 free(info->iconcsum); | 452 free(info->iconcsum); |
453 free(info->availablemsg); | 453 free(info->availmsg_encoding); |
454 free(info->availmsg); | |
454 } | 455 } |
455 | 456 |
456 /* | 457 /* |
457 * AIM is fairly regular about providing user info. This is a generic | 458 * AIM is fairly regular about providing user info. This is a generic |
458 * routine to extract it in its standard form. | 459 * routine to extract it in its standard form. |
673 number = aimbs_get8(bs); | 674 number = aimbs_get8(bs); |
674 length2 = aimbs_get8(bs); | 675 length2 = aimbs_get8(bs); |
675 | 676 |
676 switch (type2) { | 677 switch (type2) { |
677 case 0x0000: { /* This is an official buddy icon? */ | 678 case 0x0000: { /* This is an official buddy icon? */ |
678 /* This is always 5 bytes? */ | 679 /* This is always 5 bytes of "0x02 01 d2 04 72"? */ |
679 aim_bstream_advance(bs, length2); | 680 aim_bstream_advance(bs, length2); |
680 } break; | 681 } break; |
681 | 682 |
682 case 0x0001: { /* A buddy icon checksum */ | 683 case 0x0001: { /* A buddy icon checksum */ |
683 if ((length2 > 0) && (number == 0x01)) { | 684 if ((length2 > 0) && (number == 0x01)) { |
688 aim_bstream_advance(bs, length2); | 689 aim_bstream_advance(bs, length2); |
689 } break; | 690 } break; |
690 | 691 |
691 case 0x0002: { /* An available message */ | 692 case 0x0002: { /* An available message */ |
692 if (length2 > 4) { | 693 if (length2 > 4) { |
693 free(outinfo->availablemsg); | 694 free(outinfo->availmsg); |
694 outinfo->availablemsg = aimbs_getstr(bs, aimbs_get16(bs)); | 695 outinfo->availmsg_len = aimbs_get16(bs); |
696 outinfo->availmsg = aimbs_getraw(bs, outinfo->availmsg_len); | |
697 if (aimbs_get16(bs) == 0x0001) { /* We have an encoding */ | |
698 aimbs_get16(bs); | |
699 outinfo->availmsg_encoding = aimbs_getstr(bs, aimbs_get16(bs)); | |
700 } else { | |
701 /* No explicit encoding, client should use UTF-8 */ | |
702 outinfo->availmsg_encoding = NULL; | |
703 } | |
695 } else | 704 } else |
696 aim_bstream_advance(bs, length2); | 705 aim_bstream_advance(bs, length2); |
697 } break; | 706 } break; |
698 | 707 |
699 default: { | 708 default: { |