comparison src/protocols/oscar/locate.c @ 12349:2a1961c1a345

[gaim-migrate @ 14653] Get rid of oscar's copy of the available message and use the one in the status API everywhere. Also, I don't think 'available' message is technically correct. I think it could potentially be used for other stuff. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Mon, 05 Dec 2005 06:52:30 +0000
parents cfffd6fdb073
children b33b4e326c90
comparison
equal deleted inserted replaced
12348:4f7797a3024b 12349:2a1961c1a345
488 { 488 {
489 free(info->sn); 489 free(info->sn);
490 free(info->iconcsum); 490 free(info->iconcsum);
491 free(info->info); 491 free(info->info);
492 free(info->info_encoding); 492 free(info->info_encoding);
493 free(info->avail); 493 free(info->status);
494 free(info->avail_encoding); 494 free(info->status_encoding);
495 free(info->away); 495 free(info->away);
496 free(info->away_encoding); 496 free(info->away_encoding);
497 } 497 }
498 498
499 /* 499 /*
716 716
717 } else if (type == 0x001d) { 717 } else if (type == 0x001d) {
718 /* 718 /*
719 * Type = 0x001d 719 * Type = 0x001d
720 * 720 *
721 * Buddy icon information and available messages. 721 * Buddy icon information and status/available messages.
722 * 722 *
723 * This almost seems like the AIM protocol guys gave 723 * This almost seems like the AIM protocol guys gave
724 * the iChat guys a Type, and the iChat guys tried to 724 * the iChat guys a Type, and the iChat guys tried to
725 * cram as much cool shit into it as possible. Then 725 * cram as much cool shit into it as possible. Then
726 * the Windows AIM guys were like, "hey, that's 726 * the Windows AIM guys were like, "hey, that's
727 * pretty neat, let's copy those prawns." 727 * pretty neat, let's copy those prawns."
728 * 728 *
729 * In that spirit, this can contain a custom message, 729 * In that spirit, this can contain a custom message,
730 * kind of like an away message, but you're not away 730 * kind of like an away message, but you're not away
731 * (it's called an "available" message). Or it can 731 * (it's called an "available" message). Or it can
732 * contain information about the buddy icon the user 732 * contain information about the buddy icon the user
733 * has stored on the server. 733 * has stored on the server.
734 */ 734 */
735 int type2, number, length2; 735 int type2, number, length2;
736 736
737 while (aim_bstream_curpos(bs) < endpos) { 737 while (aim_bstream_curpos(bs) < endpos) {
753 outinfo->iconcsumlen = length2; 753 outinfo->iconcsumlen = length2;
754 } else 754 } else
755 aim_bstream_advance(bs, length2); 755 aim_bstream_advance(bs, length2);
756 } break; 756 } break;
757 757
758 case 0x0002: { /* An available message */ 758 case 0x0002: { /* An status/available message */
759 free(outinfo->avail); 759 free(outinfo->status);
760 free(outinfo->avail_encoding); 760 free(outinfo->status_encoding);
761 if (length2 >= 4) { 761 if (length2 >= 4) {
762 outinfo->avail_len = aimbs_get16(bs); 762 outinfo->status_len = aimbs_get16(bs);
763 outinfo->avail = aimbs_getstr(bs, outinfo->avail_len); 763 outinfo->status = aimbs_getstr(bs, outinfo->status_len);
764 if (aimbs_get16(bs) == 0x0001) { /* We have an encoding */ 764 if (aimbs_get16(bs) == 0x0001) { /* We have an encoding */
765 aimbs_get16(bs); 765 aimbs_get16(bs);
766 outinfo->avail_encoding = aimbs_getstr(bs, aimbs_get16(bs)); 766 outinfo->status_encoding = aimbs_getstr(bs, aimbs_get16(bs));
767 } else { 767 } else {
768 /* No explicit encoding, client should use UTF-8 */ 768 /* No explicit encoding, client should use UTF-8 */
769 outinfo->avail_encoding = NULL; 769 outinfo->status_encoding = NULL;
770 } 770 }
771 } else { 771 } else {
772 aim_bstream_advance(bs, length2); 772 aim_bstream_advance(bs, length2);
773 outinfo->avail_len = 0; 773 outinfo->status_len = 0;
774 outinfo->avail = g_strdup(""); 774 outinfo->status = g_strdup("");
775 outinfo->avail_encoding = NULL; 775 outinfo->status_encoding = NULL;
776 } 776 }
777 } break; 777 } break;
778 778
779 default: { 779 default: {
780 aim_bstream_advance(bs, length2); 780 aim_bstream_advance(bs, length2);