--- a/src/protocols/yahoo/yahoo_picture.c Wed Feb 16 15:26:57 2005 -0500
+++ b/src/protocols/yahoo/yahoo_picture.c Wed Feb 16 15:31:22 2005 -0500
@@ -114,7 +114,7 @@
data->who = g_strdup(who);
data->checksum = checksum;
- gaim_url_fetch(url, FALSE, "Mozilla/4.0 (compatible; MSIE 5.0)", FALSE,
+ gaim_url_fetch(url, TRUE, "Mozilla/4.0 (compatible; MSIE 5.0)", FALSE, yahoo_fetch_picture_cb, data);
} else if (who && send_icon_info) {
yahoo_send_picture_info(gc, who);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/protocols/yahoo/yahoo_profile.c Wed Feb 16 15:31:22 2005 -0500
@@ -0,0 +1,1218 @@
+ * Gaim is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +#include "yahoo_friend.h" +typedef enum profile_lang_id { + ES_AR, ES_ES, ES_MX, ES_US, + IT, JA, KO, NO, PT, SV, + ZH_CN, ZH_HK, ZH_TW, ZH_US +typedef struct profile_lang_node { + profile_lang_id_t lang; + char *last_updated_string; +typedef struct profile_strings_node { + profile_lang_id_t lang; + char *lang_string; /* Only to make debugging output saner */ + char *no_answer_string; + char *maritalstatus_string; + char *occupation_string; + char *latest_news_string; + char *favorite_quote_string; + char *no_home_page_specified_string; + char *home_page_string; + char *no_cool_link_specified_string; + char *cool_link_1_string; + char *cool_link_2_string; + char *cool_link_3_string; +} profile_strings_node_t; +typedef enum profile_state { + PROFILE_STATE_NOT_FOUND, + PROFILE_STATE_UNKNOWN_LANGUAGE + YahooGetInfoData *info_data; + char *profile_url_text; + const profile_strings_node_t *strings; + const char *last_updated_string; + profile_state_t profile_state; +} YahooGetInfoStepTwoData; +/* Strings to determine the profile "language" (more accurately "locale"). + * Strings in this list must be in the original charset in the profile. + * The "Last Updated" string is used, but sometimes is not sufficient to + * distinguish 2 locales with this (e.g., ES_ES from ES_US, or FR_CA from + * FR_FR, or EL from EN_GB), in which case a second string is added and + * such special cases must be placed before the more general case. +static const profile_lang_node_t profile_langs[] = { + { DA, "Opdateret sidste gang ", NULL }, + { DE, "Letzter Update ", NULL }, + { EL, "Last Updated:", "http://gr.profiles.yahoo.com" }, + { EN_GB, "Last Updated ", "Favourite Quote" }, + { EN, "Last Updated:", NULL }, + { EN, "Last Updated ", NULL }, + { ES_AR, "\332ltima actualizaci\363n ", NULL }, + { ES_ES, "Actualizada el ", "http://es.profiles.yahoo.com" }, + { ES_MX, "Actualizada el ", "http://mx.profiles.yahoo.com" }, + { ES_US, "Actualizada el ", NULL }, + { FR_CA, "Derni\xe8re mise \xe0 jour", "http://cf.profiles.yahoo.com" }, + { FR_FR, "Derni\xe8re mise \xe0 jour", NULL }, + { IT, "Ultimo aggiornamento ", NULL }, + { JA, "\xba\xc7\xbd\xaa\xb9\xb9\xbf\xb7\xc6\xfc\xa1\xa7", NULL }, + { KO, "\xb0\xbb\xbd\xc5\x20\xb3\xaf\xc2\xa5 ", NULL }, + { NO, "Sist oppdatert ", NULL }, + { PT, "\332ltima atualiza\347\343o ", NULL }, + { SV, "Senast uppdaterad ", NULL }, + { ZH_CN, "\xd7\xee\xba\xf3\xd0\xde\xb8\xc4\xc8\xd5\xc6\xda", NULL }, + { ZH_HK, "\xb3\xcc\xaa\xf1\xa7\xf3\xb7\x73\xae\xc9\xb6\xa1", NULL }, + { ZH_US, "\xb3\xcc\xab\xe1\xad\xd7\xa7\xef\xa4\xe9\xb4\xc1", "http://chinese.profiles.yahoo.com" }, + { ZH_TW, "\xb3\xcc\xab\xe1\xad\xd7\xa7\xef\xa4\xe9\xb4\xc1", NULL }, +/* Strings in this list must be in UTF-8; 's should be specified as spaces. */ +static const profile_strings_node_t profile_strings[] = { + { DA, "da", "ISO-8859-1", + "Ægteskabelig status:", + "Ingen hjemmeside specificeret", + "Intet cool link specificeret", + { DE, "de", "ISO-8859-1", + "Mein Lieblingsspruch", + "Keine Homepage angegeben", + "Keinen coolen Link angegeben", + { EL, "el", "ISO-8859-7", /* EL is identical to EN, except no_answer_string */ + "No home page specified", + "No cool link specified", + { EN, "en", "ISO-8859-1", + "No home page specified", + "No cool link specified", + { EN_GB, "en_GB", "ISO-8859-1", /* Same as EN except spelling of "Favourite" */ + "No home page specified", + "No cool link specified", + { ES_AR, "es_AR", "ISO-8859-1", + "No introdujiste una respuesta", + "Mi dirección de correo electrónico", + "Ninguna página de inicio especificada", + "Ningún enlace preferido", + { ES_ES, "es_ES", "ISO-8859-1", + "Ninguna página personal especificada", + "Ningún enlace preferido", + "Enlaces Preferidos 1:", + "Enlaces Preferidos 2:", + "Enlaces Preferidos 3:", + { ES_MX, "es_MX", "ISO-8859-1", + "Mi Dirección de correo-e", + "Ninguna Página predefinida", + "Ningún Enlace preferido", + "Enlaces Preferidos 1:", + "Enlaces Preferidos 2:", + "Enlaces Preferidos 3:", + { ES_US, "es_US", "ISO-8859-1", + "No introdujo una respuesta", + "Mi Dirección de correo-e", + "Ninguna Página de inicio predefinida", + "Ningún Enlace preferido", + "Enlaces Preferidos 1:", + "Enlaces Preferidos 2:", + "Enlaces Preferidos 3:", + { FR_CA, "fr_CA", "ISO-8859-1", + "Pas de mention d'une page personnelle", + "Pas de mention d'un lien favori", + { FR_FR, "fr_FR", "ISO-8859-1", + "Situation de famille:", + "Pas de mention d'une page perso", + "Pas de mention d'un lien favori", + { IT, "it", "ISO-8859-1", + "Nessuna home page specificata", + "Nessun link specificato", + "自己PR", /* "Self description" comes before "Links" for yahoo.co.jp */ + { NO, "no", "ISO-8859-1", + "Ingen hjemmeside angitt", + "No cool link specified", + { PT, "pt", "ISO-8859-1", + "Nenhuma página pessoal especificada", + "Nenhum site legal especificado", + { SV, "sv", "ISO-8859-1", + "Ingen hemsida specificerad", + "Ingen cool länk specificerad", + { ZH_CN, "zh_CN", "GB2312", + { ZH_HK, "zh_HK", "Big5", + "最喜愛的股票叫價", /* [sic] Yahoo!'s translators don't check context */ + "沒有注明個人網頁", /* [sic] */ + "沒有注明 Cool 連結", /* [sic] */ + "Cool 連結 1:", /* TODO */ + "Cool 連結 2:", /* TODO */ + "Cool 連結 3:", /* TODO */ + { ZH_TW, "zh_TW", "Big5", + { ZH_US, "zh_US", "Big5", /* ZH_US is like ZH_TW, but also a bit like ZH_HK */ + "推薦網站連結 1:", /* TODO */ + "推薦網站連結 2:", /* TODO */ + "推薦網站連結 3:", /* TODO */ + { XX, NULL, NULL, NULL, NULL, NULL, NULL }, +static char *yahoo_remove_nonbreaking_spaces(char *str) + while ((p = strstr(str, " ")) != NULL) { + *p = ' '; /* Turn 's into ordinary blanks */ + memmove(p, p + 5, strlen(p + 5)); + str[strlen(str) - 5] = '\0'; +static char *yahoo_tooltip_info_text(YahooGetInfoData *info_data) { + GString *s = g_string_sized_new(80); /* wild guess */ + g_string_printf(s, "<span style=\"font-size: larger\"><b>%s</b></span><br>", + b = gaim_find_buddy(gaim_connection_get_account(info_data->gc), + char *statustext = yahoo_tooltip_text(b); + if(b->alias && b->alias[0]) { + char *aliastext = g_markup_escape_text(b->alias, -1); + g_string_append_printf(s, _("<b>Alias:</b> %s<br>"), aliastext); + char *idletime = gaim_str_seconds_to_string(time(NULL) - b->idle); + g_string_append_printf(s, _("<b>%s:</b> %s<br>"), _("Idle"), + g_string_append_printf(s, "%s<br>", statustext); + if ((f = yahoo_friend_find(info_data->gc, b->name))) { + if ((ip = yahoo_friend_get_ip(f))) + g_string_append_printf(s, _("<b>IP Address:</b> %s<br>"), ip); + return g_string_free(s, FALSE); +static char *yahoo_get_photo_url(const char *url_text, const char *name) { + GString *s = g_string_sized_new(strlen(name) + 8); + g_string_printf(s, " alt=\"%s\">", name); + p = strstr(url_text, s->str); + /* Search backwards for "http://". This is stupid, but it works. */ + for (; !it && p > url_text; p -= 1) { + if (strncmp(p, "\"http://", 8) == 0) { + p += 1; /* skip only the " */ + it = g_strndup(p, q - p); + g_string_free(s, TRUE); +static void yahoo_got_photo(void *data, const char *url_text, size_t len); +#endif /* PHOTO_SUPPORT */ +static void yahoo_got_info(void *data, const char *url_text, size_t len) + YahooGetInfoData *info_data = (YahooGetInfoData *)data; + YahooGetInfoStepTwoData *info2_data; + char *photo_url_text = NULL; + gboolean found = FALSE; + char *last_updated_utf8_string = NULL; + const char *last_updated_string = NULL; + char *tooltip_text = NULL; + char *profile_url_text = NULL; + const profile_strings_node_t *strings = NULL; + profile_state_t profile_state = PROFILE_STATE_DEFAULT; + if (!GAIM_CONNECTION_IS_VALID(info_data->gc)) { + g_free(info_data->name); + gaim_debug_info("yahoo", "In yahoo_got_info\n"); + yd = info_data->gc->proto_data; + title = (yd->jp? _("Yahoo! Japan Profile") : + /* Get the tooltip info string */ + tooltip_text = yahoo_tooltip_info_text(info_data); + /* We failed to grab the profile URL. This is not expected to actually + * happen except under unusual error conditions, as Yahoo is observed + * to send back HTML, with a 200 status code. + if (url_text == NULL || strcmp(url_text, "") == 0) { + g_snprintf(buf, 1024, "<html><body>%s<b>%s</b></body></html>", + tooltip_text, _("Error retrieving profile")); + gaim_notify_userinfo(info_data->gc, info_data->name, NULL, title, + NULL, buf, NULL, NULL); + g_free(profile_url_text); + g_free(info_data->name); + /* Construct the correct profile URL */ + s = g_string_sized_new(80); /* wild guess */ + g_string_printf(s, "%s%s", (yd->jp? YAHOOJP_PROFILE_URL: YAHOO_PROFILE_URL), + profile_url_text = g_string_free(s, FALSE); + /* We don't yet support the multiple link level of the warning page for + * 'adult' profiles, not to mention the fact that yahoo wants you to be + * logged in (on the website) to be able to view an 'adult' profile. For + * now, just tell them that we can't help them, and provide a link to the + * profile if they want to do the web browser thing. + p = strstr(url_text, "Adult Profiles Warning Message"); + p = strstr(url_text, "Adult Content Warning"); /* TITLE element */ + g_snprintf(buf, 1024, "<html><body>%s<b>%s</b><br><br>\n" + "%s<br><a href=\"%s\">%s</a></body></html>", + _("Sorry, profiles marked as containing adult content " + "are not supported at this time."), + _("If you wish to view this profile, " + "you will need to visit this link in your web browser"), + profile_url_text, profile_url_text); + gaim_notify_userinfo(info_data->gc, info_data->name, NULL, title, + NULL, buf, NULL, NULL); + g_free(profile_url_text); + g_free(info_data->name); + /* Check whether the profile is written in a supported language */ + for (lang = 0;; lang += 1) { + last_updated_string = profile_langs[lang].last_updated_string; + if (!last_updated_string) break; + p = strstr(url_text, last_updated_string); + if (p && profile_langs[lang].det && !strstr(url_text, profile_langs[lang].det)) { + for (strid = 0; profile_strings[strid].lang != XX; strid += 1) { + if (profile_strings[strid].lang == profile_langs[lang].lang) break; + strings = profile_strings + strid; + gaim_debug_info("yahoo", "detected profile lang = %s (%d)\n", profile_strings[strid].lang_string, lang); + /* Every user may choose his/her own profile language, and this language + * has nothing to do with the preferences of the user which looks at the + * profile. We try to support all languages, but nothing is guaranteed. + * If we cannot determine the language, it means either (1) the profile + * is written in an unsupported language, (2) our language support is + * out of date, or (3) the user is not found. + if (!p || strings->lang == XX) { + if (!strstr(url_text, "Yahoo! Member Directory - User not found") + && !strstr(url_text, "was not found on this server.") + && !strstr(url_text, "\xb8\xf8\xb3\xab\xa5\xd7\xa5\xed\xa5\xd5\xa5\xa3\xa1\xbc\xa5\xeb\xa4\xac\xb8\xab\xa4\xc4\xa4\xab\xa4\xea\xa4\xde\xa4\xbb\xa4\xf3")) { + profile_state = PROFILE_STATE_UNKNOWN_LANGUAGE; + profile_state = PROFILE_STATE_NOT_FOUND; + photo_url_text = yahoo_get_photo_url(url_text, info_data->name); + url_buffer = g_strdup(url_text); + * gaim_markup_strip_html() doesn't strip out character entities like + yahoo_remove_nonbreaking_spaces(url_buffer); + while ((p = strstr(url_buffer, "·")) != NULL) { + memmove(p, p + 6, strlen(p + 6)); + url_buffer[strlen(url_buffer) - 6] = '\0'; + /* nuke the nasty \r's */ + gaim_str_strip_cr(url_buffer); + /* Marshall the existing state */ + info2_data = g_malloc(sizeof(YahooGetInfoStepTwoData)); + info2_data->info_data = info_data; + info2_data->url_buffer = url_buffer; + info2_data->photo_url_text = photo_url_text; + info2_data->profile_url_text = profile_url_text; + info2_data->tooltip_text = tooltip_text; + info2_data->strings = strings; + info2_data->last_updated_string = last_updated_string; + info2_data->title = title; + info2_data->profile_state = profile_state; + /* Try to put the photo in there too, if there's one */ + /* User-uploaded photos use a different server that requires the Host + * header, but Yahoo Japan will use the "chunked" content encoding if + * we specify HTTP 1.1. So we have to specify 1.0 & fix gaim_url_fetch + gaim_url_fetch(photo_url_text, FALSE, NULL, FALSE, yahoo_got_photo, + /* Emulate a callback */ + yahoo_got_photo(info2_data, NULL, 0); +static void yahoo_got_photo(void *data, const char *url_text, size_t len) + YahooGetInfoStepTwoData *info2_data = (YahooGetInfoStepTwoData *)data; + gboolean found = FALSE; + /* Temporary variables */ + char *last_updated_utf8_string = NULL; + /* Unmarshall the saved state */ + YahooGetInfoData *info_data = info2_data->info_data; + char *url_buffer = info2_data->url_buffer; + GString *s = info2_data->s; + char *photo_url_text = info2_data->photo_url_text; + char *profile_url_text = info2_data->profile_url_text; + char *tooltip_text = info2_data->tooltip_text; + const profile_strings_node_t *strings = info2_data->strings; + const char *last_updated_string = info2_data->last_updated_string; + const char *title = info2_data->title; + profile_state_t profile_state = info2_data->profile_state; + /* We continue here from yahoo_got_info, as if nothing has happened */ +#endif /* PHOTO_SUPPORT */ + /* nuke the html, it's easier than trying to parse the horrid stuff */ + stripped = gaim_markup_strip_html(url_buffer); + stripped_len = strlen(stripped); + gaim_debug_misc("yahoo", "stripped = %p\n", stripped); + gaim_debug_misc("yahoo", "url_buffer = %p\n", url_buffer); + if (strings && strings->charset != XX) { + p = g_convert(stripped, -1, "utf-8", strings->charset, + p = g_locale_to_utf8(stripped, -1, NULL, NULL, NULL); + p = g_convert(stripped, -1, "utf-8", "windows-1252", + stripped = gaim_utf8_ncr_decode(p); + stripped_len = strlen(stripped); + /* "Last updated" should also be converted to utf8 and with killed */ + if (strings && strings->charset != XX) { + last_updated_utf8_string = g_convert(last_updated_string, -1, "utf-8", + strings->charset, NULL, NULL, NULL); + yahoo_remove_nonbreaking_spaces(last_updated_utf8_string); + gaim_debug_misc("yahoo", "after utf8 conversion: stripped = (%s)\n", stripped); + /* gonna re-use the memory we've already got for url_buffer */ + s = g_string_sized_new(strlen(url_buffer)); + if (profile_state == PROFILE_STATE_DEFAULT) { + /* extract their Yahoo! ID and put it in. Don't bother marking has_info as + * true, since the Yahoo! ID will always be there */ + if (!gaim_markup_extract_info_field(stripped, stripped_len, s, + strings->yahoo_id_string, 2, "\n", 0, + NULL, _("Yahoo! ID"), 0, NULL)) + /* Try to put the photo in there too, if there's one and is readable */ + if (data && url_text && len != 0) { + if (strstr(url_text, "400 Bad Request") + || strstr(url_text, "403 Forbidden") + || strstr(url_text, "404 Not Found")) { + gaim_debug_info("yahoo", "Error getting %s: %s\n", + photo_url_text, url_text); + gaim_debug_info("yahoo", "%s is %d bytes\n", photo_url_text, len); + id = gaim_imgstore_add(url_text, len, NULL); + g_string_append_printf(s, "<img id=\"%d\"><br>", id); +#endif /* PHOTO_SUPPORT */ + /* extract their Email address and put it in */ + found |= gaim_markup_extract_info_field(stripped, stripped_len, s, + strings->my_email_string, 5, "\n", 0, + strings->private_string, _("Email"), 0, NULL); + /* extract the Nickname if it exists */ + found |= gaim_markup_extract_info_field(stripped, stripped_len, s, + "Nickname:", 1, "\n", '\n', + NULL, _("Nickname"), 0, NULL); + /* extract their RealName and put it in */ + found |= gaim_markup_extract_info_field(stripped, stripped_len, s, + strings->realname_string, 1, "\n", '\n', + NULL, _("Realname"), 0, NULL); + /* extract their Location and put it in */ + found |= gaim_markup_extract_info_field(stripped, stripped_len, s, + strings->location_string, 2, "\n", '\n', + NULL, _("Location"), 0, NULL); + /* extract their Age and put it in */ + found |= gaim_markup_extract_info_field(stripped, stripped_len, s, + strings->age_string, 3, "\n", '\n', + NULL, _("Age"), 0, NULL); + /* extract their MaritalStatus and put it in */ + found |= gaim_markup_extract_info_field(stripped, stripped_len, s, + strings->maritalstatus_string, 3, "\n", '\n', + strings->no_answer_string, _("Marital Status"), 0, NULL); + /* extract their Gender and put it in */ + found |= gaim_markup_extract_info_field(stripped, stripped_len, s, + strings->gender_string, 3, "\n", '\n', + strings->no_answer_string, _("Gender"), 0, NULL); + /* extract their Occupation and put it in */ + found |= gaim_markup_extract_info_field(stripped, stripped_len, s, + strings->occupation_string, 2, "\n", '\n', + NULL, _("Occupation"), 0, NULL); + /* Hobbies, Latest News, and Favorite Quote are a bit different, since + * the values can contain embedded newlines... but any or all of them + * can also not appear. The way we delimit them is to successively + * look for the next one that _could_ appear, and if all else fails, + * we end the section by looking for the 'Links' heading, which is the + * next thing to follow this bunch. (For Yahoo Japan, we check for + * the "Description" ("Self PR") heading instead of "Links".) + if (!gaim_markup_extract_info_field(stripped, stripped_len, s, + strings->hobbies_string, 1, strings->latest_news_string, + '\n', NULL, _("Hobbies"), 0, NULL)) + if (!gaim_markup_extract_info_field(stripped, stripped_len, s, + strings->hobbies_string, 1, strings->favorite_quote_string, + '\n', NULL, _("Hobbies"), 0, NULL)) + found |= gaim_markup_extract_info_field(stripped, stripped_len, s, + strings->hobbies_string, 1, strings->links_string, + '\n', NULL, _("Hobbies"), 0, NULL); + if (!gaim_markup_extract_info_field(stripped, stripped_len, s, + strings->latest_news_string, 1, strings->favorite_quote_string, + '\n', NULL, _("Latest News"), 0, NULL)) + found |= gaim_markup_extract_info_field(stripped, stripped_len, s, + strings->latest_news_string, 1, strings->links_string, + '\n', NULL, _("Latest News"), 0, NULL); + found |= gaim_markup_extract_info_field(stripped, stripped_len, s, + strings->favorite_quote_string, 1, strings->links_string, + '\n', NULL, _("Favorite Quote"), 0, NULL); + /* Home Page will either be "No home page specified", + * or "Home Page: " and a link. + * For Yahoo! Japan, if there is no home page specified, + * neither "No home page specified" nor "Home Page:" is shown. + if (strings->home_page_string) { + p = !strings->no_home_page_specified_string? NULL: + strstr(stripped, strings->no_home_page_specified_string); + found |= gaim_markup_extract_info_field(stripped, stripped_len, s, + strings->home_page_string, 1, "\n", 0, NULL, + _("Home Page"), 1, NULL); + /* Cool Link {1,2,3} is also different. If "No cool link specified" + * exists, then we have none. If we have one however, we'll need to + * check and see if we have a second one. If we have a second one, + * we have to check to see if we have a third one. + p = !strings->no_cool_link_specified_string? NULL: + strstr(stripped,strings->no_cool_link_specified_string); + if (gaim_markup_extract_info_field(stripped, stripped_len, s, + strings->cool_link_1_string, 1, "\n", 0, NULL, + _("Cool Link 1"), 1, NULL)) + if (gaim_markup_extract_info_field(stripped, stripped_len, s, + strings->cool_link_2_string, 1, "\n", 0, NULL, + _("Cool Link 2"), 1, NULL)) + gaim_markup_extract_info_field(stripped, stripped_len, s, + strings->cool_link_3_string, 1, "\n", 0, NULL, + _("Cool Link 3"), 1, NULL); + /* see if Member Since is there, and if so, extract it. */ + found |= gaim_markup_extract_info_field(stripped, stripped_len, s, + "Member Since:", 1, last_updated_utf8_string, + '\n', NULL, _("Member Since"), 0, NULL); + /* extract the Last Updated date and put it in */ + found |= gaim_markup_extract_info_field(stripped, stripped_len, s, + last_updated_utf8_string, 0, "\n", '\n', NULL, + _("Last Updated"), 0, NULL); + } /* if (profile_state == PROFILE_STATE_DEFAULT) */ + g_string_append_printf(s, "<br><b>"); + g_string_append_printf(s, _("User information for %s unavailable"), + g_string_append_printf(s, "</b><br>"); + if (profile_state == PROFILE_STATE_UNKNOWN_LANGUAGE) { + g_string_append_printf(s, "%s<br><br>", + _("Sorry, this profile seems to be in a language " + "that is not supported at this time.")); + } else if (profile_state == PROFILE_STATE_NOT_FOUND) { + GaimBuddy *b = gaim_find_buddy + (gaim_connection_get_account(info_data->gc), + /* Someone on the buddy list can be "not on server list", + * in which case the user may or may not actually exist. + * Hence this extra step. + f = yahoo_friend_find(b->account->gc, b->name); + g_string_append_printf(s, "%s<br><br>", + f? _("Could not retrieve the user's profile. " + "This most likely is a temporary server-side problem. " + "Please try again later."): + _("Could not retrieve the user's profile. " + "This most likely means that the user does not exist; " + "however, Yahoo! sometimes does fail to find a user's " + "profile. If you know that the user exists, " + "please try again later.")); + g_string_append_printf(s, "%s<br><br>", + _("The user's profile is empty.")); + /* put a link to the actual profile URL */ + g_string_append_printf(s, _("<b>%s:</b> "), _("Profile URL")); + g_string_append_printf(s, "<br><a href=\"%s\">%s</a><br>", + profile_url_text, profile_url_text); + /* finish off the html at the end */ + g_string_append(s, "</body></html>\n"); + /* Put the Yahoo! ID, nickname, idle time, and status message in */ + g_string_prepend(s, tooltip_text); + /* finish off the html at the beginning */ + g_string_prepend(s, "<html><body>\n"); + /* show it to the user */ + gaim_notify_userinfo(info_data->gc, info_data->name, NULL, title, + NULL, s->str, NULL, NULL); + g_free(last_updated_utf8_string); + g_string_free(s, TRUE); + g_free(profile_url_text); + g_free(info_data->name); + g_free(photo_url_text); + gaim_imgstore_unref(id); +void yahoo_get_info(GaimConnection *gc, const char *name) + struct yahoo_data *yd = gc->proto_data; + YahooGetInfoData *data; + data = g_new0(YahooGetInfoData, 1); + data->name = g_strdup(name); + url = g_strdup_printf("%s%s", + (yd->jp? YAHOOJP_PROFILE_URL: YAHOO_PROFILE_URL), name); + gaim_url_fetch(url, TRUE, NULL, FALSE, yahoo_got_info, data);