gaim/gaim

Patch #1230036 from Joshua Honeycutt
oldstatus
2005-06-30, Richard Laager
a99a17a99a8f
Parents 8243b4e04e18
Children ae0b15352b0c
Patch #1230036 from Joshua Honeycutt
"Should fix all text issues with the new yahoo profile page. Not sure if the change to util.c will be allowable, hopefully tags aren't really used anywhere else"

Patch #1230122 from Bleeter
"Following on from the excellent strings substitution work by Coweater, this profile patch includes the fix for picture display."
...
"ONLY EN and EN_GB profiles are re-supported."
--- a/COPYRIGHT Thu Jun 30 01:43:44 2005 -0400
+++ b/COPYRIGHT Thu Jun 30 02:23:34 2005 -0400
@@ -83,6 +83,7 @@
Benjamin Herrenschmidt
Fernando Herrera
Casey Ho
+Joshua Honeycutt
Nigel Horne
Iain Holmes
Magnus Hult
--- a/ChangeLog Thu Jun 30 01:43:44 2005 -0400
+++ b/ChangeLog Thu Jun 30 02:23:34 2005 -0400
@@ -6,6 +6,8 @@
* Fixed a bug where buddy icon cache files were left in the icon
cache directory after they were no longer in use.
* Attempt to detect the file type of a buddy icon when saving.
+ * Fixed handling of the new Yahoo! profile page. (Joshua Honeycutt,
+ Peter Lawler)
version 1.3.1 (6/9/2005):
* The file transfer details section now also displays the full path to
--- a/src/protocols/yahoo/yahoo_profile.c Thu Jun 30 01:43:44 2005 -0400
+++ b/src/protocols/yahoo/yahoo_profile.c Thu Jun 30 02:23:34 2005 -0400
@@ -116,9 +116,9 @@
{ 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 },
+ { EN_GB, "Last Update ", "Favourite Quote" },
+ { EN, "Last Update:", NULL },
+ { EN, "Last Update ", 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" },
@@ -213,46 +213,46 @@
"Yahoo! ID:",
"Private",
"No Answer",
- "My Email",
+ "My Email:",
"Real Name:",
"Location:",
"Age:",
"Marital Status:",
"Gender:",
"Occupation:",
- "Hobbies:",
+ "Hobbies",
"Latest News",
"Favorite Quote",
"Links",
"No home page specified",
"Home Page:",
"No cool link specified",
- "Cool Link 1:",
- "Cool Link 2:",
- "Cool Link 3:",
+ "Cool Link 1",
+ "Cool Link 2",
+ "Cool Link 3",
NULL
},
{ EN_GB, "en_GB", "ISO-8859-1", /* Same as EN except spelling of "Favourite" */
"Yahoo! ID:",
"Private",
"No Answer",
- "My Email",
+ "My Email:",
"Real Name:",
"Location:",
"Age:",
"Marital Status:",
"Gender:",
"Occupation:",
- "Hobbies:",
+ "Hobbies",
"Latest News",
"Favourite Quote",
"Links",
"No home page specified",
"Home Page:",
"No cool link specified",
- "Cool Link 1:",
- "Cool Link 2:",
- "Cool Link 3:",
+ "Cool Link 1",
+ "Cool Link 2",
+ "Cool Link 3",
NULL
},
{ ES_AR, "es_AR", "ISO-8859-1",
@@ -674,9 +674,7 @@
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);
}
@@ -687,16 +685,20 @@
char *p;
char *it = NULL;
- g_string_printf(s, " alt=\"%s\">", name);
+ /*g_string_printf(s, " alt=\"%s\">", name);*/
+ /* Y! newformat */
+ g_string_printf(s, " alt=%s>", name);
p = strstr(url_text, s->str);
if (p) {
/* Search backwards for "http://". This is stupid, but it works. */
for (; !it && p > url_text; p -= 1) {
- if (strncmp(p, "\"http://", 8) == 0) {
+ /*if (strncmp(p, "\"http://", 8) == 0) {*/
+ /* Y! newformat*/
+ if (strncmp(p, "=http://", 8) == 0) {
char *q;
- p += 1; /* skip only the " */
- q = strchr(p, '"');
+ p += 1; /* skip only the ' ' */
+ q = strchr(p, ' ');
if (q) {
it = g_strndup(p, q - p);
}
@@ -830,7 +832,8 @@
* 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.
+ * out of date, or (3) the user is not found, or (4) Y! have changed their
+ * webpage layout
*/
if (!p || strings->lang == XX) {
if (!strstr(url_text, "Yahoo! Member Directory - User not found")
@@ -864,7 +867,6 @@
gaim_str_strip_cr(url_buffer);
#if PHOTO_SUPPORT
-
/* Marshall the existing state */
info2_data = g_malloc(sizeof(YahooGetInfoStepTwoData));
info2_data->info_data = info_data;
@@ -919,8 +921,13 @@
/* We continue here from yahoo_got_info, as if nothing has happened */
#endif /* PHOTO_SUPPORT */
+ /* Jun 29 05 Bleeter: Y! changed their profile pages. Terminators now seem to be */
+ /* </dd> and not \n. The prpl's need to be audited before it can be moved */
+ /* in to gaim_markup_strip_html*/
+ char *fudged_buffer;
+ fudged_buffer = gaim_strcasereplace(url_buffer, "</dd>", "</dd><br>");
/* nuke the html, it's easier than trying to parse the horrid stuff */
- stripped = gaim_markup_strip_html(url_buffer);
+ stripped = gaim_markup_strip_html(fudged_buffer);
stripped_len = strlen(stripped);
gaim_debug_misc("yahoo", "stripped = %p\n", stripped);
@@ -965,7 +972,7 @@
/* 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,
+ strings->yahoo_id_string, 10, "\n", 0,
NULL, _("Yahoo! ID"), 0, NULL))
;
#endif
@@ -991,7 +998,7 @@
/* 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->my_email_string, 1, " ", 0,
strings->private_string, _("Email"), 0, NULL);
/* extract the Nickname if it exists */
@@ -1040,15 +1047,15 @@
if (!gaim_markup_extract_info_field(stripped, stripped_len, s,
strings->hobbies_string, 1, strings->latest_news_string,
- '\n', NULL, _("Hobbies"), 0, NULL))
+ '\n', "\n", _("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))
+ '\n', "\n", _("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);
+ '\n', "\n", _("Hobbies"), 0, NULL);
}
else
found = TRUE;
@@ -1058,18 +1065,18 @@
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))
+ '\n', "\n", _("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);
+ '\n', "\n", _("Latest News"), 0, NULL);
}
else
found = TRUE;
found |= gaim_markup_extract_info_field(stripped, stripped_len, s,
strings->favorite_quote_string, 1, strings->links_string,
- '\n', NULL, _("Favorite Quote"), 0, NULL);
+ '\n', "\n", _("Favorite Quote"), 0, NULL);
/* Home Page will either be "No home page specified",
* or "Home Page: " and a link.
@@ -1119,9 +1126,8 @@
/* 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);
-
+ last_updated_utf8_string, 1, " ", '\n', NULL,
+ _("Last Update"), 0, NULL);
} /* if (profile_state == PROFILE_STATE_DEFAULT) */
if(!found)
@@ -1185,6 +1191,7 @@
g_free(last_updated_utf8_string);
g_free(url_buffer);
+ g_free(fudged_buffer);
g_string_free(s, TRUE);
g_free(profile_url_text);
g_free(tooltip_text);