Mercurial > pidgin.yaz
diff src/protocols/oscar/oscar.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 | 7c7e14d111bf |
children | 511003c99302 |
line wrap: on
line diff
--- a/src/protocols/oscar/oscar.c Wed Jul 23 23:42:29 2003 +0000 +++ b/src/protocols/oscar/oscar.c Thu Jul 24 02:04:19 2003 +0000 @@ -148,7 +148,7 @@ time_t signon; int caps; gboolean typingnot; - gchar *availablemsg; + gchar *availmsg; unsigned long ico_me_len; unsigned long ico_me_csum; @@ -285,7 +285,7 @@ static void oscar_free_buddyinfo(void *data) { struct buddyinfo *bi = data; - g_free(bi->availablemsg); + g_free(bi->availmsg); g_free(bi->iconcsum); g_free(bi); } @@ -1804,11 +1804,18 @@ bi->caps = caps; bi->typingnot = FALSE; bi->ico_informed = FALSE; - free(bi->availablemsg); - if (info->availablemsg) - bi->availablemsg = g_strdup(info->availablemsg); + free(bi->availmsg); + if (info->availmsg) + if (info->availmsg_encoding) { + gchar *enc = g_strdup_printf("charset=\"%s\"", info->availmsg_encoding); + bi->availmsg = oscar_encoding_to_utf8(enc, info->availmsg, info->availmsg_len); + g_free(enc); + } else { + /* No explicit encoding means utf8. Yay. */ + bi->availmsg = g_strdup(info->availmsg); + } else - bi->availablemsg = NULL; + bi->availmsg = NULL; /* Server stored icon stuff */ if (info->iconcsumlen) { @@ -5407,8 +5414,8 @@ free(tmp); } - if (bi->availablemsg && !(b->uc & UC_UNAVAILABLE)) { - gchar *escaped = g_markup_escape_text(bi->availablemsg, strlen(bi->availablemsg)); + if (bi->availmsg && !(b->uc & UC_UNAVAILABLE)) { + gchar *escaped = g_markup_escape_text(bi->availmsg, strlen(bi->availmsg)); tmp = yay; yay = g_strconcat(tmp, _("<b>Available:</b> "), escaped, "\n", NULL); free(tmp); @@ -5446,8 +5453,8 @@ ret = g_strdup(_("Away")); } else if (GAIM_BUDDY_IS_ONLINE(b)) { struct buddyinfo *bi = g_hash_table_lookup(od->buddyinfo, normalize(b->name)); - if (bi->availablemsg) - ret = g_markup_escape_text(bi->availablemsg, strlen(bi->availablemsg)); + if (bi->availmsg) + ret = g_markup_escape_text(bi->availmsg, strlen(bi->availmsg)); } else { char *gname = aim_ssi_itemlist_findparentname(od->sess->ssi.local, b->name); if (aim_ssi_waitingforauth(od->sess->ssi.local, gname, b->name))