Mercurial > pidgin
comparison libpurple/protocols/yahoo/yahoo_profile.c @ 24667:9fc3f5bf4455
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.
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Tue, 09 Dec 2008 02:59:29 +0000 |
parents | 18a1f0fe5f40 |
children | 65cfc59858cf |
comparison
equal
deleted
inserted
replaced
24666:641fe4c2b2a5 | 24667:9fc3f5bf4455 |
---|---|
805 * happen except under unusual error conditions, as Yahoo is observed | 805 * happen except under unusual error conditions, as Yahoo is observed |
806 * to send back HTML, with a 200 status code. | 806 * to send back HTML, with a 200 status code. |
807 */ | 807 */ |
808 if (error_message != NULL || url_text == NULL || strcmp(url_text, "") == 0) { | 808 if (error_message != NULL || url_text == NULL || strcmp(url_text, "") == 0) { |
809 purple_notify_user_info_add_pair(user_info, _("Error retrieving profile"), NULL); | 809 purple_notify_user_info_add_pair(user_info, _("Error retrieving profile"), NULL); |
810 purple_notify_userinfo(info_data->gc, info_data->name, | 810 purple_notify_userinfo(info_data->gc, info_data->name, |
811 user_info, NULL, NULL); | 811 user_info, NULL, NULL); |
812 purple_notify_user_info_destroy(user_info); | 812 purple_notify_user_info_destroy(user_info); |
813 g_free(profile_url_text); | 813 g_free(profile_url_text); |
814 g_free(info_data->name); | 814 g_free(info_data->name); |
815 g_free(info_data); | 815 g_free(info_data); |
839 _("Sorry, profiles marked as containing adult content " | 839 _("Sorry, profiles marked as containing adult content " |
840 "are not supported at this time."), | 840 "are not supported at this time."), |
841 _("If you wish to view this profile, " | 841 _("If you wish to view this profile, " |
842 "you will need to visit this link in your web browser:"), | 842 "you will need to visit this link in your web browser:"), |
843 profile_url_text, profile_url_text); | 843 profile_url_text, profile_url_text); |
844 purple_notify_user_info_add_pair(user_info, NULL, tmp); | 844 purple_notify_user_info_add_pair(user_info, NULL, tmp); |
845 g_free(tmp); | 845 g_free(tmp); |
846 | 846 |
847 purple_notify_userinfo(info_data->gc, info_data->name, | 847 purple_notify_userinfo(info_data->gc, info_data->name, |
848 user_info, NULL, NULL); | 848 user_info, NULL, NULL); |
849 | 849 |
850 g_free(profile_url_text); | 850 g_free(profile_url_text); |
851 purple_notify_user_info_destroy(user_info); | 851 purple_notify_user_info_destroy(user_info); |
852 g_free(info_data->name); | 852 g_free(info_data->name); |
1191 } | 1191 } |
1192 } /* if (profile_state == PROFILE_STATE_DEFAULT) */ | 1192 } /* if (profile_state == PROFILE_STATE_DEFAULT) */ |
1193 | 1193 |
1194 if(!found) | 1194 if(!found) |
1195 { | 1195 { |
1196 GString *str = g_string_new(""); | 1196 const gchar *str; |
1197 | 1197 |
1198 g_string_append_printf(str, "<br><b>"); | 1198 purple_notify_user_info_add_section_break(user_info); |
1199 g_string_append_printf(str, _("User information for %s unavailable"), | 1199 purple_notify_user_info_add_pair(user_info, |
1200 info_data->name); | 1200 _("Error retrieving profile"), NULL); |
1201 g_string_append_printf(str, "</b><br>"); | |
1202 | 1201 |
1203 if (profile_state == PROFILE_STATE_UNKNOWN_LANGUAGE) { | 1202 if (profile_state == PROFILE_STATE_UNKNOWN_LANGUAGE) { |
1204 g_string_append_printf(str, "%s<br><br>", | 1203 str = _("This profile is in a language " |
1205 _("Sorry, this profile seems to be in a language " | 1204 "or format that is not supported at this time."); |
1206 "or format that is not supported at this time.")); | |
1207 | 1205 |
1208 } else if (profile_state == PROFILE_STATE_NOT_FOUND) { | 1206 } else if (profile_state == PROFILE_STATE_NOT_FOUND) { |
1209 PurpleBuddy *b = purple_find_buddy | 1207 PurpleBuddy *b = purple_find_buddy |
1210 (purple_connection_get_account(info_data->gc), | 1208 (purple_connection_get_account(info_data->gc), |
1211 info_data->name); | 1209 info_data->name); |
1215 * in which case the user may or may not actually exist. | 1213 * in which case the user may or may not actually exist. |
1216 * Hence this extra step. | 1214 * Hence this extra step. |
1217 */ | 1215 */ |
1218 f = yahoo_friend_find(b->account->gc, b->name); | 1216 f = yahoo_friend_find(b->account->gc, b->name); |
1219 } | 1217 } |
1220 g_string_append_printf(str, "%s<br><br>", | 1218 str = f ? _("Could not retrieve the user's profile. " |
1221 f? _("Could not retrieve the user's profile. " | |
1222 "This most likely is a temporary server-side problem. " | 1219 "This most likely is a temporary server-side problem. " |
1223 "Please try again later."): | 1220 "Please try again later.") : |
1224 _("Could not retrieve the user's profile. " | 1221 _("Could not retrieve the user's profile. " |
1225 "This most likely means that the user does not exist; " | 1222 "This most likely means that the user does not exist; " |
1226 "however, Yahoo! sometimes does fail to find a user's " | 1223 "however, Yahoo! sometimes does fail to find a user's " |
1227 "profile. If you know that the user exists, " | 1224 "profile. If you know that the user exists, " |
1228 "please try again later.")); | 1225 "please try again later."); |
1229 } else { | 1226 } else { |
1230 g_string_append_printf(str, "%s<br><br>", | 1227 str = _("The user's profile is empty."); |
1231 _("The user's profile is empty.")); | 1228 } |
1232 } | 1229 |
1233 | 1230 purple_notify_user_info_add_pair(user_info, NULL, str); |
1234 purple_notify_user_info_add_pair(user_info, NULL, str->str); | |
1235 g_string_free(str, TRUE); | |
1236 } | 1231 } |
1237 | 1232 |
1238 /* put a link to the actual profile URL */ | 1233 /* put a link to the actual profile URL */ |
1239 tmp = g_strdup_printf("<a href=\"%s\">%s</a>", profile_url_text, profile_url_text); | 1234 purple_notify_user_info_add_section_break(user_info); |
1240 purple_notify_user_info_add_pair(user_info, _("Profile URL"), tmp); | 1235 tmp = g_strdup_printf("<a href=\"%s\">%s</a>", |
1236 profile_url_text, _("View web profile")); | |
1237 purple_notify_user_info_add_pair(user_info, NULL, tmp); | |
1241 g_free(tmp); | 1238 g_free(tmp); |
1242 | 1239 |
1243 g_free(stripped); | 1240 g_free(stripped); |
1244 | 1241 |
1245 /* show it to the user */ | 1242 /* show it to the user */ |