comparison libpurple/protocols/yahoo/yahoo_profile.c @ 25871:65cfc59858cf

propagate from branch 'im.pidgin.pidgin' (head d5bb29138cbe033bbfd8ec689203d73818765327) to branch 'im.pidgin.pidgin.next.minor' (head 35ee8e40db640867e5b9239030cdc326e7f0a005)
author Gary Kramlich <grim@reaperworld.com>
date Sat, 13 Dec 2008 05:45:27 +0000
parents 8aa7d8bcbc7d 9fc3f5bf4455
children 510f07e1f5c1
comparison
equal deleted inserted replaced
25870:d9da15c9e2a1 25871:65cfc59858cf
806 * happen except under unusual error conditions, as Yahoo is observed 806 * happen except under unusual error conditions, as Yahoo is observed
807 * to send back HTML, with a 200 status code. 807 * to send back HTML, with a 200 status code.
808 */ 808 */
809 if (error_message != NULL || url_text == NULL || strcmp(url_text, "") == 0) { 809 if (error_message != NULL || url_text == NULL || strcmp(url_text, "") == 0) {
810 purple_notify_user_info_add_pair(user_info, _("Error retrieving profile"), NULL); 810 purple_notify_user_info_add_pair(user_info, _("Error retrieving profile"), NULL);
811 purple_notify_userinfo(info_data->gc, info_data->name, 811 purple_notify_userinfo(info_data->gc, info_data->name,
812 user_info, NULL, NULL); 812 user_info, NULL, NULL);
813 purple_notify_user_info_destroy(user_info); 813 purple_notify_user_info_destroy(user_info);
814 g_free(profile_url_text); 814 g_free(profile_url_text);
815 g_free(info_data->name); 815 g_free(info_data->name);
816 g_free(info_data); 816 g_free(info_data);
840 _("Sorry, profiles marked as containing adult content " 840 _("Sorry, profiles marked as containing adult content "
841 "are not supported at this time."), 841 "are not supported at this time."),
842 _("If you wish to view this profile, " 842 _("If you wish to view this profile, "
843 "you will need to visit this link in your web browser:"), 843 "you will need to visit this link in your web browser:"),
844 profile_url_text, profile_url_text); 844 profile_url_text, profile_url_text);
845 purple_notify_user_info_add_pair(user_info, NULL, tmp); 845 purple_notify_user_info_add_pair(user_info, NULL, tmp);
846 g_free(tmp); 846 g_free(tmp);
847 847
848 purple_notify_userinfo(info_data->gc, info_data->name, 848 purple_notify_userinfo(info_data->gc, info_data->name,
849 user_info, NULL, NULL); 849 user_info, NULL, NULL);
850 850
851 g_free(profile_url_text); 851 g_free(profile_url_text);
852 purple_notify_user_info_destroy(user_info); 852 purple_notify_user_info_destroy(user_info);
853 g_free(info_data->name); 853 g_free(info_data->name);
1192 } 1192 }
1193 } /* if (profile_state == PROFILE_STATE_DEFAULT) */ 1193 } /* if (profile_state == PROFILE_STATE_DEFAULT) */
1194 1194
1195 if(!found) 1195 if(!found)
1196 { 1196 {
1197 GString *str = g_string_new(""); 1197 const gchar *str;
1198 1198
1199 g_string_append_printf(str, "<br><b>"); 1199 purple_notify_user_info_add_section_break(user_info);
1200 g_string_append_printf(str, _("User information for %s unavailable"), 1200 purple_notify_user_info_add_pair(user_info,
1201 info_data->name); 1201 _("Error retrieving profile"), NULL);
1202 g_string_append_printf(str, "</b><br>");
1203 1202
1204 if (profile_state == PROFILE_STATE_UNKNOWN_LANGUAGE) { 1203 if (profile_state == PROFILE_STATE_UNKNOWN_LANGUAGE) {
1205 g_string_append_printf(str, "%s<br><br>", 1204 str = _("This profile is in a language "
1206 _("Sorry, this profile seems to be in a language " 1205 "or format that is not supported at this time.");
1207 "or format that is not supported at this time."));
1208 1206
1209 } else if (profile_state == PROFILE_STATE_NOT_FOUND) { 1207 } else if (profile_state == PROFILE_STATE_NOT_FOUND) {
1210 PurpleBuddy *b = purple_find_buddy 1208 PurpleBuddy *b = purple_find_buddy
1211 (purple_connection_get_account(info_data->gc), 1209 (purple_connection_get_account(info_data->gc),
1212 info_data->name); 1210 info_data->name);
1218 */ 1216 */
1219 PurpleAccount *account = purple_buddy_get_account(b); 1217 PurpleAccount *account = purple_buddy_get_account(b);
1220 f = yahoo_friend_find(purple_account_get_connection(account), 1218 f = yahoo_friend_find(purple_account_get_connection(account),
1221 purple_buddy_get_name(b)); 1219 purple_buddy_get_name(b));
1222 } 1220 }
1223 g_string_append_printf(str, "%s<br><br>", 1221 str = f ? _("Could not retrieve the user's profile. "
1224 f? _("Could not retrieve the user's profile. "
1225 "This most likely is a temporary server-side problem. " 1222 "This most likely is a temporary server-side problem. "
1226 "Please try again later."): 1223 "Please try again later.") :
1227 _("Could not retrieve the user's profile. " 1224 _("Could not retrieve the user's profile. "
1228 "This most likely means that the user does not exist; " 1225 "This most likely means that the user does not exist; "
1229 "however, Yahoo! sometimes does fail to find a user's " 1226 "however, Yahoo! sometimes does fail to find a user's "
1230 "profile. If you know that the user exists, " 1227 "profile. If you know that the user exists, "
1231 "please try again later.")); 1228 "please try again later.");
1232 } else { 1229 } else {
1233 g_string_append_printf(str, "%s<br><br>", 1230 str = _("The user's profile is empty.");
1234 _("The user's profile is empty.")); 1231 }
1235 } 1232
1236 1233 purple_notify_user_info_add_pair(user_info, NULL, str);
1237 purple_notify_user_info_add_pair(user_info, NULL, str->str);
1238 g_string_free(str, TRUE);
1239 } 1234 }
1240 1235
1241 /* put a link to the actual profile URL */ 1236 /* put a link to the actual profile URL */
1242 tmp = g_strdup_printf("<a href=\"%s\">%s</a>", profile_url_text, profile_url_text); 1237 purple_notify_user_info_add_section_break(user_info);
1243 purple_notify_user_info_add_pair(user_info, _("Profile URL"), tmp); 1238 tmp = g_strdup_printf("<a href=\"%s\">%s</a>",
1239 profile_url_text, _("View web profile"));
1240 purple_notify_user_info_add_pair(user_info, NULL, tmp);
1244 g_free(tmp); 1241 g_free(tmp);
1245 1242
1246 g_free(stripped); 1243 g_free(stripped);
1247 1244
1248 /* show it to the user */ 1245 /* show it to the user */