# HG changeset patch # User Mark Doliner # Date 1228791569 0 # Node ID 9fc3f5bf44554540d191ee9d144f72755906cf2f # Parent 641fe4c2b2a57d45b4762b5da8f95781db0af63f Make our profile text a little cleaner and more uniform across the protocols. They all have a "View web profile" link at the bottom that opens the user's profile in a browser. I'm open to suggestions on the wording. I also wasn't sure if it was better for the link to be at the bottom of the profile or the top. diff -r 641fe4c2b2a5 -r 9fc3f5bf4455 libpurple/protocols/msn/msn.c --- a/libpurple/protocols/msn/msn.c Mon Dec 08 02:22:59 2008 +0000 +++ b/libpurple/protocols/msn/msn.c Tue Dec 09 02:59:29 2008 +0000 @@ -1811,7 +1811,7 @@ if (b->server_alias) { char *nicktext = g_markup_escape_text(b->server_alias, -1); - tmp = g_strdup_printf("%s
", nicktext); + tmp = g_strdup_printf("%s", nicktext); purple_notify_user_info_add_pair(user_info, _("Nickname"), tmp); g_free(tmp); g_free(nicktext); @@ -1917,9 +1917,8 @@ if (error_message != NULL || url_text == NULL || strcmp(url_text, "") == 0) { - tmp = g_strdup_printf("%s", _("Error retrieving profile")); - purple_notify_user_info_add_pair(user_info, NULL, tmp); - g_free(tmp); + purple_notify_user_info_add_pair(user_info, + _("Error retrieving profile"), NULL); purple_notify_userinfo(info_data->gc, info_data->name, user_info, NULL, NULL); purple_notify_user_info_destroy(user_info); @@ -2260,21 +2259,24 @@ char *p = strstr(url_buffer, "
gc), info_data->name); - purple_notify_user_info_add_pair(user_info, _("Error retrieving profile"), - ((p && b) ? _("The user has not created a public profile.") : - (p ? _("MSN reported not being able to find the user's profile. " - "This either means that the user does not exist, " - "or that the user exists " - "but has not created a public profile.") : - _("Could not find " /* This should never happen */ - "any information in the user's profile. " - "The user most likely does not exist.")))); + purple_notify_user_info_add_pair(user_info, + _("Error retrieving profile"), NULL); + purple_notify_user_info_add_pair(user_info, NULL, + ((p && b) ? _("The user has not created a public profile.") : + (p ? _("MSN reported not being able to find the user's profile. " + "This either means that the user does not exist, " + "or that the user exists " + "but has not created a public profile.") : + _("Could not find " /* This should never happen */ + "any information in the user's profile. " + "The user most likely does not exist.")))); } /* put a link to the actual profile URL */ - tmp = g_strdup_printf("%s%s", - PROFILE_URL, info_data->name, PROFILE_URL, info_data->name); - purple_notify_user_info_add_pair(user_info, _("Profile URL"), tmp); + purple_notify_user_info_add_section_break(user_info); + tmp = g_strdup_printf("%s", + PROFILE_URL, info_data->name, _("View web profile")); + purple_notify_user_info_add_pair(user_info, NULL, tmp); g_free(tmp); #if PHOTO_SUPPORT diff -r 641fe4c2b2a5 -r 9fc3f5bf4455 libpurple/protocols/myspace/user.c --- a/libpurple/protocols/myspace/user.c Mon Dec 08 02:22:59 2008 +0000 +++ b/libpurple/protocols/myspace/user.c Tue Dec 09 02:59:29 2008 +0000 @@ -107,17 +107,6 @@ uid = purple_blist_node_get_int(&user->buddy->node, "UserID"); - if (full) { - /* TODO: link to username, if available */ - if (uid) { - char *profile = g_strdup_printf("http://myspace.com/%d", - uid, uid); - purple_notify_user_info_add_pair(user_info, _("Profile"), profile); - g_free(profile); - } - } - - /* a/s/l...the vitals */ if (user->age) { char age[16]; @@ -180,6 +169,16 @@ purple_notify_user_info_add_pair(user_info, _("Client Version"), client); g_free(client); } + + if (full && uid) { + /* TODO: link to username, if available */ + char *profile; + purple_notify_user_info_add_section_break(user_info); + profile = g_strdup_printf("%s", + uid, _("View web profile")); + purple_notify_user_info_add_pair(user_info, NULL, profile); + g_free(profile); + } } /** Set the currently playing song artist and or title. diff -r 641fe4c2b2a5 -r 9fc3f5bf4455 libpurple/protocols/oscar/oscar.c --- a/libpurple/protocols/oscar/oscar.c Mon Dec 08 02:22:59 2008 +0000 +++ b/libpurple/protocols/oscar/oscar.c Tue Dec 09 02:59:29 2008 +0000 @@ -3187,6 +3187,12 @@ } } + purple_notify_user_info_add_section_break(user_info); + tmp = g_strdup_printf("%s", + purple_normalize(account, userinfo->sn), _("View web profile")); + purple_notify_user_info_add_pair(user_info, NULL, tmp); + g_free(tmp); + purple_notify_userinfo(gc, userinfo->sn, user_info, NULL, NULL); purple_notify_user_info_destroy(user_info); diff -r 641fe4c2b2a5 -r 9fc3f5bf4455 libpurple/protocols/yahoo/yahoo_profile.c --- a/libpurple/protocols/yahoo/yahoo_profile.c Mon Dec 08 02:22:59 2008 +0000 +++ b/libpurple/protocols/yahoo/yahoo_profile.c Tue Dec 09 02:59:29 2008 +0000 @@ -807,7 +807,7 @@ */ if (error_message != NULL || url_text == NULL || strcmp(url_text, "") == 0) { purple_notify_user_info_add_pair(user_info, _("Error retrieving profile"), NULL); - purple_notify_userinfo(info_data->gc, info_data->name, + purple_notify_userinfo(info_data->gc, info_data->name, user_info, NULL, NULL); purple_notify_user_info_destroy(user_info); g_free(profile_url_text); @@ -841,10 +841,10 @@ _("If you wish to view this profile, " "you will need to visit this link in your web browser:"), profile_url_text, profile_url_text); - purple_notify_user_info_add_pair(user_info, NULL, tmp); + purple_notify_user_info_add_pair(user_info, NULL, tmp); g_free(tmp); - purple_notify_userinfo(info_data->gc, info_data->name, + purple_notify_userinfo(info_data->gc, info_data->name, user_info, NULL, NULL); g_free(profile_url_text); @@ -1193,17 +1193,15 @@ if(!found) { - GString *str = g_string_new(""); + const gchar *str; - g_string_append_printf(str, "
"); - g_string_append_printf(str, _("User information for %s unavailable"), - info_data->name); - g_string_append_printf(str, "
"); + purple_notify_user_info_add_section_break(user_info); + purple_notify_user_info_add_pair(user_info, + _("Error retrieving profile"), NULL); if (profile_state == PROFILE_STATE_UNKNOWN_LANGUAGE) { - g_string_append_printf(str, "%s

", - _("Sorry, this profile seems to be in a language " - "or format that is not supported at this time.")); + str = _("This profile is in a language " + "or format that is not supported at this time."); } else if (profile_state == PROFILE_STATE_NOT_FOUND) { PurpleBuddy *b = purple_find_buddy @@ -1217,27 +1215,26 @@ */ f = yahoo_friend_find(b->account->gc, b->name); } - g_string_append_printf(str, "%s

", - f? _("Could not retrieve the user's profile. " + str = f ? _("Could not retrieve the user's profile. " "This most likely is a temporary server-side problem. " - "Please try again later."): + "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.")); + "please try again later."); } else { - g_string_append_printf(str, "%s

", - _("The user's profile is empty.")); + str = _("The user's profile is empty."); } - - purple_notify_user_info_add_pair(user_info, NULL, str->str); - g_string_free(str, TRUE); + + purple_notify_user_info_add_pair(user_info, NULL, str); } /* put a link to the actual profile URL */ - tmp = g_strdup_printf("%s", profile_url_text, profile_url_text); - purple_notify_user_info_add_pair(user_info, _("Profile URL"), tmp); + purple_notify_user_info_add_section_break(user_info); + tmp = g_strdup_printf("%s", + profile_url_text, _("View web profile")); + purple_notify_user_info_add_pair(user_info, NULL, tmp); g_free(tmp); g_free(stripped);