Mercurial > pidgin
comparison libpurple/protocols/oscar/oscar.c @ 28232:3b820f5d7d6a
If an oscar buddy on our buddy list is away and we have not yet
fetched their HTML info, then fallback to using their plaintext
status message when fetching the buddies status text.
Fixes #9843
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sun, 06 Sep 2009 21:53:15 +0000 |
parents | 8d5380556f12 |
children | 3161c687d7bc |
comparison
equal
deleted
inserted
replaced
28231:a0bff269046a | 28232:3b820f5d7d6a |
---|---|
827 /* If we have both b and userinfo we favor userinfo, because if we're | 827 /* If we have both b and userinfo we favor userinfo, because if we're |
828 viewing someone's profile then we want the HTML away message, and | 828 viewing someone's profile then we want the HTML away message, and |
829 the "message" attribute of the status contains only the plaintext | 829 the "message" attribute of the status contains only the plaintext |
830 message. */ | 830 message. */ |
831 if (userinfo) { | 831 if (userinfo) { |
832 if ((userinfo->flags & AIM_FLAG_AWAY)) { | 832 if ((userinfo->flags & AIM_FLAG_AWAY) |
833 /* Away message? */ | 833 && userinfo->away_len > 0 |
834 if ((userinfo->flags & AIM_FLAG_AWAY) && (userinfo->away_len > 0) && (userinfo->away != NULL) && (userinfo->away_encoding != NULL)) { | 834 && userinfo->away != NULL |
835 tmp = oscar_encoding_extract(userinfo->away_encoding); | 835 && userinfo->away_encoding != NULL) |
836 message = oscar_encoding_to_utf8(account, tmp, userinfo->away, | 836 { |
837 userinfo->away_len); | 837 /* Away message */ |
838 g_free(tmp); | 838 tmp = oscar_encoding_extract(userinfo->away_encoding); |
839 } | 839 message = oscar_encoding_to_utf8(account, |
840 tmp, userinfo->away, userinfo->away_len); | |
841 g_free(tmp); | |
840 } else { | 842 } else { |
841 /* Available message? */ | 843 /* |
844 * Available message or non-HTML away message (because that's | |
845 * all we have right now. | |
846 */ | |
842 if ((userinfo->status != NULL) && userinfo->status[0] != '\0') { | 847 if ((userinfo->status != NULL) && userinfo->status[0] != '\0') { |
843 message = oscar_encoding_to_utf8(account, userinfo->status_encoding, | 848 message = oscar_encoding_to_utf8(account, |
844 userinfo->status, userinfo->status_len); | 849 userinfo->status_encoding, userinfo->status, |
850 userinfo->status_len); | |
845 } | 851 } |
846 #if defined (_WIN32) || defined (__APPLE__) | 852 #if defined (_WIN32) || defined (__APPLE__) |
847 if (userinfo->itmsurl && (userinfo->itmsurl[0] != '\0')) | 853 if (userinfo->itmsurl && (userinfo->itmsurl[0] != '\0')) |
848 itmsurl = oscar_encoding_to_utf8(account, userinfo->itmsurl_encoding, | 854 itmsurl = oscar_encoding_to_utf8(account, userinfo->itmsurl_encoding, |
849 userinfo->itmsurl, userinfo->itmsurl_len); | 855 userinfo->itmsurl, userinfo->itmsurl_len); |