# HG changeset patch # User Tim Ringenbach # Date 1086544892 0 # Node ID f0488214826fa0aa591b6d00b62122a8f1d838b1 # Parent ec2a51abcc71485d7efd41d7991b48b8094b0639 [gaim-migrate @ 10016] wing made yahoo profiles even better. They now include all the tooltip info, and also include a link to the profile, so you can open it in your browser with just a click. He also says: Note: I added _() to some "%s: %s" sort of strings, because otherwise the display would be very ugly. committer: Tailor Script diff -r ec2a51abcc71 -r f0488214826f src/protocols/yahoo/yahoo.c --- a/src/protocols/yahoo/yahoo.c Sun Jun 06 17:43:37 2004 +0000 +++ b/src/protocols/yahoo/yahoo.c Sun Jun 06 18:01:32 2004 +0000 @@ -2474,7 +2474,7 @@ } } -static char *yahoo_tooltip_text(GaimBuddy *b) +char *yahoo_tooltip_text(GaimBuddy *b) { struct yahoo_data *yd = (struct yahoo_data*)b->account->gc->proto_data; struct yahoo_friend *f; diff -r ec2a51abcc71 -r f0488214826f src/protocols/yahoo/yahoo.h --- a/src/protocols/yahoo/yahoo.h Sun Jun 06 17:43:37 2004 +0000 +++ b/src/protocols/yahoo/yahoo.h Sun Jun 06 18:01:32 2004 +0000 @@ -233,6 +233,9 @@ */ char *yahoo_string_decode(GaimConnection *gc, const char *str, gboolean utf8); +/* previously-static functions, now needed for yahoo_profile.c */ +char *yahoo_tooltip_text(GaimBuddy *b); + /* yahoo_profile.c */ void yahoo_get_info(GaimConnection *gc, const char *name); diff -r ec2a51abcc71 -r f0488214826f src/protocols/yahoo/yahoo_profile.c --- a/src/protocols/yahoo/yahoo_profile.c Sun Jun 06 17:43:37 2004 +0000 +++ b/src/protocols/yahoo/yahoo_profile.c Sun Jun 06 18:01:32 2004 +0000 @@ -625,10 +625,11 @@ const char *last_updated_string = NULL; char *last_updated_utf8_string; int lang, strid; + GaimBuddy *b; gaim_debug_info("yahoo", "In yahoo_got_info\n"); - /* we failed to grab the profile URL */ + /* we failed to grab the profile URL. this should never happen */ if (url_text == NULL || strcmp(url_text, "") == 0) { gaim_notify_formatted(info_data->gc, NULL, _("Buddy Information"), NULL, _("Error retrieving profile"), @@ -677,15 +678,15 @@ gaim_debug_info("yahoo", "detected profile lang = %s (%d)\n", profile_strings[strid].lang_string, lang); } - /* At the moment we don't support profile pages with languages other than - * English. The problem is, that every user may choose his/her own profile - * language. This language has nothing to do with the preferences of the - * user which looks at the profile + /* 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 (!p || profile_strings[strid].lang == XX) { if (strstr(url_text, "was not found on this server.") == NULL && strstr(url_text, "Yahoo! Member Directory - User not found") == NULL) { g_snprintf(buf, 1024, "%s%s%s%s", - _("Sorry, non-English profiles are not supported at this time.

\n"), + _("Sorry, this profile seems to be in a language " + "that is not supported at this time.

\n"), _("If you wish to view this profile, you will need to visit this link in your web browser
"), YAHOO_PROFILE_URL, info_data->name, YAHOO_PROFILE_URL, info_data->name); } else { @@ -759,8 +760,27 @@ * true, since the Yahoo! ID will always be there */ if (!gaim_markup_extract_info_field(stripped, stripped_len, s, profile_strings[strid].yahoo_id_string, 2, "\n", 0, NULL, _("Yahoo! ID"), 0, NULL)) - g_string_append_printf(s, "%s: %s
", _("Yahoo! ID"), info_data->name); + g_string_append_printf(s, _("%s: %s
"), _("Yahoo! ID"), info_data->name); + /* Display the alias, idle time, and status message below the Yahoo! ID */ + b = gaim_find_buddy(gaim_connection_get_account(info_data->gc), info_data->name); + if (b) { + 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, _("Alias: %s
"), aliastext); + g_free(aliastext); + } + if (b->idle > 0) { + char *idletime = gaim_str_seconds_to_string(time(NULL) - b->idle); + g_string_append_printf(s, _("%s: %s
"), _("Idle"), idletime); + g_free(idletime); + } + if (statustext) { + g_string_append_printf(s, "%s
", statustext); + g_free(statustext); + } + } /* extract their Email address and put it in */ found |= gaim_markup_extract_info_field(stripped, stripped_len, s, profile_strings[strid].my_email_string, 5, "\n", 0, @@ -845,9 +865,9 @@ } /* 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. + * 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 = !profile_strings[strid].no_cool_link_specified_string? NULL: strstr(stripped,profile_strings[strid].no_cool_link_specified_string); @@ -872,6 +892,12 @@ found |= gaim_markup_extract_info_field(stripped, stripped_len, s, last_updated_utf8_string, 0, "\n", '\n', NULL, _("Last Updated"), 0, NULL); + /* put a link to the actual profile URL */ + g_string_append_printf(s, _("%s: "), _("Profile URL")); + g_string_append_printf(s, "%s%s
", + YAHOO_PROFILE_URL, info_data->name, + YAHOO_PROFILE_URL, info_data->name); + /* finish off the html */ g_string_append(s, "\n"); g_free(stripped); diff -r ec2a51abcc71 -r f0488214826f src/util.c --- a/src/util.c Sun Jun 06 17:43:37 2004 +0000 +++ b/src/util.c Sun Jun 06 18:01:32 2004 +0000 @@ -786,9 +786,7 @@ (no_value_token && strncmp(p, no_value_token, strlen(no_value_token))))) { - g_string_append(dest, ""); - g_string_append(dest, display_name); - g_string_append(dest, ": "); + g_string_append_printf(dest, _("%s: "), display_name); if (is_link) {