Sat, 03 Aug 2013 19:20:57 +0200
HTTP: Use PurpleHttpConnectionSet instead of GSLists of PurpleHttpConnection structs
| 9162 | 1 | /* |
| 15884 | 2 | * purple |
| 9162 | 3 | * |
| 15884 | 4 | * Purple is the legal property of its developers, whose names are too numerous |
| 9162 | 5 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 6 | * source distribution. | |
| 7 | * | |
| 8 | * This program is free software; you can redistribute it and/or modify | |
| 9 | * it under the terms of the GNU General Public License as published by | |
| 10 | * the Free Software Foundation; either version 2 of the License, or | |
| 11 | * (at your option) any later version. | |
| 12 | * | |
| 13 | * This program is distributed in the hope that it will be useful, | |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 16 | * GNU General Public License for more details. | |
| 17 | * | |
| 18 | * You should have received a copy of the GNU General Public License | |
| 19 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
18795
diff
changeset
|
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 9162 | 21 | * |
| 22 | */ | |
| 23 | ||
| 9242 | 24 | #define PHOTO_SUPPORT 1 |
| 25 | ||
| 9162 | 26 | #include "internal.h" |
| 27 | #include "debug.h" | |
|
34227
6d016a081401
HTTP: migrate purple_util_fetch_url to new API for prpls
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33774
diff
changeset
|
28 | #include "http.h" |
| 9162 | 29 | #include "notify.h" |
| 30 | #include "util.h" | |
| 9242 | 31 | #if PHOTO_SUPPORT |
| 32 | #include "imgstore.h" | |
|
27335
06a805d4e690
Strip trailing whitespace and comment #endif marcos that close #ifdef macros
Mark Doliner <markdoliner@pidgin.im>
parents:
25119
diff
changeset
|
33 | #endif /* PHOTO_SUPPORT */ |
| 9162 | 34 | |
|
27555
afb7cb5c350c
Update for file renames.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
27335
diff
changeset
|
35 | #include "libymsg.h" |
| 9281 | 36 | #include "yahoo_friend.h" |
| 9162 | 37 | |
| 38 | typedef struct { | |
| 15884 | 39 | PurpleConnection *gc; |
| 9162 | 40 | char *name; |
| 41 | } YahooGetInfoData; | |
| 42 | ||
| 43 | typedef enum profile_lang_id { | |
|
27335
06a805d4e690
Strip trailing whitespace and comment #endif marcos that close #ifdef macros
Mark Doliner <markdoliner@pidgin.im>
parents:
25119
diff
changeset
|
44 | XX, DA, DE, EL, |
|
06a805d4e690
Strip trailing whitespace and comment #endif marcos that close #ifdef macros
Mark Doliner <markdoliner@pidgin.im>
parents:
25119
diff
changeset
|
45 | EN, EN_GB, |
| 9162 | 46 | ES_AR, ES_ES, ES_MX, ES_US, |
|
27335
06a805d4e690
Strip trailing whitespace and comment #endif marcos that close #ifdef macros
Mark Doliner <markdoliner@pidgin.im>
parents:
25119
diff
changeset
|
47 | FR_CA, FR_FR, |
|
06a805d4e690
Strip trailing whitespace and comment #endif marcos that close #ifdef macros
Mark Doliner <markdoliner@pidgin.im>
parents:
25119
diff
changeset
|
48 | IT, JA, KO, NO, PT, SV, |
|
18795
8c4b65aae6e0
Patch from Mauro Brasil to support Brazilian profiles on Yahoo. Fixes #2091.
Daniel Atallah <datallah@pidgin.im>
parents:
16539
diff
changeset
|
49 | ZH_CN, ZH_HK, ZH_TW, ZH_US, PT_BR |
| 9162 | 50 | } profile_lang_id_t; |
| 51 | ||
| 52 | typedef struct profile_lang_node { | |
| 53 | profile_lang_id_t lang; | |
| 54 | char *last_updated_string; | |
| 55 | char *det; | |
| 56 | } profile_lang_node_t; | |
| 57 | ||
| 58 | typedef struct profile_strings_node { | |
| 59 | profile_lang_id_t lang; | |
| 60 | char *lang_string; /* Only to make debugging output saner */ | |
| 61 | char *charset; | |
| 62 | char *yahoo_id_string; | |
| 63 | char *private_string; | |
| 64 | char *no_answer_string; | |
| 65 | char *my_email_string; | |
| 66 | char *realname_string; | |
| 67 | char *location_string; | |
| 68 | char *age_string; | |
| 69 | char *maritalstatus_string; | |
| 70 | char *gender_string; | |
| 71 | char *occupation_string; | |
| 72 | char *hobbies_string; | |
| 73 | char *latest_news_string; | |
| 74 | char *favorite_quote_string; | |
| 75 | char *links_string; | |
| 76 | char *no_home_page_specified_string; | |
| 77 | char *home_page_string; | |
| 78 | char *no_cool_link_specified_string; | |
| 79 | char *cool_link_1_string; | |
| 80 | char *cool_link_2_string; | |
| 81 | char *cool_link_3_string; | |
| 82 | char *dummy; | |
| 83 | } profile_strings_node_t; | |
| 84 | ||
| 9510 | 85 | typedef enum profile_state { |
| 86 | PROFILE_STATE_DEFAULT, | |
| 87 | PROFILE_STATE_NOT_FOUND, | |
| 88 | PROFILE_STATE_UNKNOWN_LANGUAGE | |
| 89 | } profile_state_t; | |
| 90 | ||
| 9242 | 91 | typedef struct { |
| 92 | YahooGetInfoData *info_data; | |
| 15884 | 93 | PurpleNotifyUserInfo *user_info; |
| 9242 | 94 | char *url_buffer; |
| 95 | char *photo_url_text; | |
| 96 | char *profile_url_text; | |
| 97 | const profile_strings_node_t *strings; | |
| 98 | const char *last_updated_string; | |
| 9510 | 99 | const char *title; |
| 100 | profile_state_t profile_state; | |
| 9242 | 101 | } YahooGetInfoStepTwoData; |
| 102 | ||
| 9162 | 103 | /* Strings to determine the profile "language" (more accurately "locale"). |
| 104 | * Strings in this list must be in the original charset in the profile. | |
| 105 | * The "Last Updated" string is used, but sometimes is not sufficient to | |
| 106 | * distinguish 2 locales with this (e.g., ES_ES from ES_US, or FR_CA from | |
| 107 | * FR_FR, or EL from EN_GB), in which case a second string is added and | |
| 108 | * such special cases must be placed before the more general case. | |
| 109 | */ | |
| 110 | static const profile_lang_node_t profile_langs[] = { | |
| 111 | { DA, "Opdateret sidste gang ", NULL }, | |
| 112 | { DE, "Letzter Update ", NULL }, | |
| 113 | { EL, "Last Updated:", "http://gr.profiles.yahoo.com" }, | |
|
11045
722a562fedeb
[gaim-migrate @ 12961]
Joshua Honeycutt <coweater@users.sourceforge.net>
parents:
10604
diff
changeset
|
114 | { EN_GB, "Last Update ", "Favourite Quote" }, |
|
722a562fedeb
[gaim-migrate @ 12961]
Joshua Honeycutt <coweater@users.sourceforge.net>
parents:
10604
diff
changeset
|
115 | { EN, "Last Update:", NULL }, |
|
722a562fedeb
[gaim-migrate @ 12961]
Joshua Honeycutt <coweater@users.sourceforge.net>
parents:
10604
diff
changeset
|
116 | { EN, "Last Update ", NULL }, |
| 9162 | 117 | { ES_AR, "\332ltima actualizaci\363n ", NULL }, |
| 118 | { ES_ES, "Actualizada el ", "http://es.profiles.yahoo.com" }, | |
| 119 | { ES_MX, "Actualizada el ", "http://mx.profiles.yahoo.com" }, | |
| 120 | { ES_US, "Actualizada el ", NULL }, | |
| 121 | { FR_CA, "Derni\xe8re mise \xe0 jour", "http://cf.profiles.yahoo.com" }, | |
| 122 | { FR_FR, "Derni\xe8re mise \xe0 jour", NULL }, | |
| 11626 | 123 | { IT, "Ultimo aggiornamento:", NULL }, |
| 9162 | 124 | { JA, "\xba\xc7\xbd\xaa\xb9\xb9\xbf\xb7\xc6\xfc\xa1\xa7", NULL }, |
| 125 | { KO, "\xb0\xbb\xbd\xc5\x20\xb3\xaf\xc2\xa5 ", NULL }, | |
| 126 | { NO, "Sist oppdatert ", NULL }, | |
| 127 | { PT, "\332ltima atualiza\347\343o ", NULL }, | |
|
18795
8c4b65aae6e0
Patch from Mauro Brasil to support Brazilian profiles on Yahoo. Fixes #2091.
Daniel Atallah <datallah@pidgin.im>
parents:
16539
diff
changeset
|
128 | { PT_BR, "\332ltima atualiza\347\343o:", NULL }, |
| 9162 | 129 | { SV, "Senast uppdaterad ", NULL }, |
| 130 | { ZH_CN, "\xd7\xee\xba\xf3\xd0\xde\xb8\xc4\xc8\xd5\xc6\xda", NULL }, | |
| 131 | { ZH_HK, "\xb3\xcc\xaa\xf1\xa7\xf3\xb7\x73\xae\xc9\xb6\xa1", NULL }, | |
| 132 | { ZH_US, "\xb3\xcc\xab\xe1\xad\xd7\xa7\xef\xa4\xe9\xb4\xc1", "http://chinese.profiles.yahoo.com" }, | |
| 133 | { ZH_TW, "\xb3\xcc\xab\xe1\xad\xd7\xa7\xef\xa4\xe9\xb4\xc1", NULL }, | |
| 134 | { XX, NULL, NULL } | |
| 135 | }; | |
| 136 | ||
| 137 | /* Strings in this list must be in UTF-8; 's should be specified as spaces. */ | |
| 138 | static const profile_strings_node_t profile_strings[] = { | |
| 139 | { DA, "da", "ISO-8859-1", | |
| 140 | "Yahoo! ID:", | |
| 141 | "Privat", | |
| 142 | "Intet svar", | |
| 143 | "Min Email", | |
| 144 | "Rigtige navn:", | |
| 145 | "Opholdssted:", | |
| 146 | "Alder:", | |
| 147 | "Ægteskabelig status:", | |
| 148 | "Køn:", | |
| 149 | "Erhverv:", | |
| 150 | "Hobbyer:", | |
| 151 | "Sidste nyt:", | |
| 152 | "Favoritcitat", | |
| 153 | "Links", | |
| 154 | "Ingen hjemmeside specificeret", | |
| 155 | "Forside:", | |
| 156 | "Intet cool link specificeret", | |
| 157 | "Cool link 1:", | |
| 158 | "Cool link 2:", | |
| 159 | "Cool link 3:", | |
| 160 | NULL | |
| 161 | }, | |
| 162 | { DE, "de", "ISO-8859-1", | |
| 163 | "Yahoo!-ID:", | |
| 164 | "Privat", | |
| 165 | "Keine Antwort", | |
| 166 | "Meine E-Mail", | |
| 167 | "Realer Name:", | |
| 168 | "Ort:", | |
| 169 | "Alter:", | |
| 170 | "Familienstand:", | |
| 171 | "Geschlecht:", | |
| 172 | "Beruf:", | |
| 173 | "Hobbys:", | |
| 174 | "Neuste Nachrichten:", | |
| 175 | "Mein Lieblingsspruch", | |
| 176 | "Links", | |
| 177 | "Keine Homepage angegeben", | |
| 178 | "Homepage:", | |
| 179 | "Keinen coolen Link angegeben", | |
| 180 | "Cooler Link 1:", | |
| 181 | "Cooler Link 2:", | |
| 182 | "Cooler Link 3:", | |
| 183 | NULL | |
| 184 | }, | |
| 185 | { EL, "el", "ISO-8859-7", /* EL is identical to EN, except no_answer_string */ | |
| 186 | "Yahoo! ID:", | |
| 187 | "Private", | |
| 188 | "Καμία απάντηση", | |
| 189 | "My Email", | |
| 190 | "Real Name:", | |
| 191 | "Location:", | |
| 192 | "Age:", | |
| 193 | "Marital Status:", | |
| 194 | "Gender:", | |
| 195 | "Occupation:", | |
| 196 | "Hobbies:", | |
| 197 | "Latest News", | |
| 198 | "Favorite Quote", | |
| 199 | "Links", | |
| 200 | "No home page specified", | |
| 201 | "Home Page:", | |
| 202 | "No cool link specified", | |
| 203 | "Cool Link 1:", | |
| 204 | "Cool Link 2:", | |
| 205 | "Cool Link 3:", | |
| 206 | NULL | |
| 207 | }, | |
| 208 | { EN, "en", "ISO-8859-1", | |
| 209 | "Yahoo! ID:", | |
| 210 | "Private", | |
| 211 | "No Answer", | |
|
11045
722a562fedeb
[gaim-migrate @ 12961]
Joshua Honeycutt <coweater@users.sourceforge.net>
parents:
10604
diff
changeset
|
212 | "My Email:", |
| 9162 | 213 | "Real Name:", |
| 214 | "Location:", | |
| 215 | "Age:", | |
| 216 | "Marital Status:", | |
| 12578 | 217 | "Sex:", |
| 9162 | 218 | "Occupation:", |
|
11045
722a562fedeb
[gaim-migrate @ 12961]
Joshua Honeycutt <coweater@users.sourceforge.net>
parents:
10604
diff
changeset
|
219 | "Hobbies", |
| 9162 | 220 | "Latest News", |
| 221 | "Favorite Quote", | |
| 222 | "Links", | |
| 223 | "No home page specified", | |
| 224 | "Home Page:", | |
| 225 | "No cool link specified", | |
|
11045
722a562fedeb
[gaim-migrate @ 12961]
Joshua Honeycutt <coweater@users.sourceforge.net>
parents:
10604
diff
changeset
|
226 | "Cool Link 1", |
|
722a562fedeb
[gaim-migrate @ 12961]
Joshua Honeycutt <coweater@users.sourceforge.net>
parents:
10604
diff
changeset
|
227 | "Cool Link 2", |
|
722a562fedeb
[gaim-migrate @ 12961]
Joshua Honeycutt <coweater@users.sourceforge.net>
parents:
10604
diff
changeset
|
228 | "Cool Link 3", |
| 9162 | 229 | NULL |
| 230 | }, | |
| 231 | { EN_GB, "en_GB", "ISO-8859-1", /* Same as EN except spelling of "Favourite" */ | |
| 232 | "Yahoo! ID:", | |
| 233 | "Private", | |
| 234 | "No Answer", | |
|
11045
722a562fedeb
[gaim-migrate @ 12961]
Joshua Honeycutt <coweater@users.sourceforge.net>
parents:
10604
diff
changeset
|
235 | "My Email:", |
| 9162 | 236 | "Real Name:", |
| 237 | "Location:", | |
| 238 | "Age:", | |
| 239 | "Marital Status:", | |
| 12578 | 240 | "Sex:", |
| 9162 | 241 | "Occupation:", |
|
11045
722a562fedeb
[gaim-migrate @ 12961]
Joshua Honeycutt <coweater@users.sourceforge.net>
parents:
10604
diff
changeset
|
242 | "Hobbies", |
| 9162 | 243 | "Latest News", |
| 244 | "Favourite Quote", | |
| 245 | "Links", | |
| 246 | "No home page specified", | |
| 247 | "Home Page:", | |
| 248 | "No cool link specified", | |
|
11045
722a562fedeb
[gaim-migrate @ 12961]
Joshua Honeycutt <coweater@users.sourceforge.net>
parents:
10604
diff
changeset
|
249 | "Cool Link 1", |
|
722a562fedeb
[gaim-migrate @ 12961]
Joshua Honeycutt <coweater@users.sourceforge.net>
parents:
10604
diff
changeset
|
250 | "Cool Link 2", |
|
722a562fedeb
[gaim-migrate @ 12961]
Joshua Honeycutt <coweater@users.sourceforge.net>
parents:
10604
diff
changeset
|
251 | "Cool Link 3", |
| 9162 | 252 | NULL |
| 253 | }, | |
| 254 | { ES_AR, "es_AR", "ISO-8859-1", | |
| 255 | "Usuario de Yahoo!:", | |
| 256 | "Privado", | |
| 257 | "No introdujiste una respuesta", | |
| 258 | "Mi dirección de correo electrónico", | |
| 259 | "Nombre real:", | |
| 260 | "Ubicación:", | |
| 261 | "Edad:", | |
| 262 | "Estado civil:", | |
| 263 | "Sexo:", | |
| 264 | "Ocupación:", | |
| 265 | "Pasatiempos:", | |
| 266 | "Últimas noticias:", | |
| 267 | "Tu cita favorita", | |
| 268 | "Enlaces", | |
| 269 | "Ninguna página de inicio especificada", | |
| 270 | "Página de inicio:", | |
| 271 | "Ningún enlace preferido", | |
| 272 | "Enlace genial 1:", | |
| 273 | "Enlace genial 2:", | |
| 274 | "Enlace genial 3:", | |
| 275 | NULL | |
| 276 | }, | |
| 277 | { ES_ES, "es_ES", "ISO-8859-1", | |
| 278 | "ID de Yahoo!:", | |
| 279 | "Privado", | |
| 280 | "Sin respuesta", | |
| 281 | "Mi correo-e", | |
| 282 | "Nombre verdadero:", | |
| 283 | "Lugar:", | |
| 284 | "Edad:", | |
| 285 | "Estado civil:", | |
| 286 | "Sexo:", | |
| 287 | "Ocupación:", | |
| 288 | "Aficiones:", | |
| 289 | "Ultimas Noticias:", | |
| 290 | "Tu cita Favorita", | |
| 291 | "Enlace", | |
| 292 | "Ninguna página personal especificada", | |
| 293 | "Página de Inicio:", | |
| 294 | "Ningún enlace preferido", | |
| 295 | "Enlaces Preferidos 1:", | |
| 296 | "Enlaces Preferidos 2:", | |
| 297 | "Enlaces Preferidos 3:", | |
| 298 | NULL | |
| 299 | }, | |
| 300 | { ES_MX, "es_MX", "ISO-8859-1", | |
| 301 | "ID de Yahoo!:", | |
| 302 | "Privado", | |
| 303 | "Sin responder", | |
| 304 | "Mi Dirección de correo-e", | |
| 305 | "Nombre real:", | |
| 306 | "Ubicación:", | |
| 307 | "Edad:", | |
| 308 | "Estado civil:", | |
| 309 | "Sexo:", | |
| 310 | "Ocupación:", | |
| 311 | "Pasatiempos:", | |
| 312 | "Ultimas Noticias:", | |
| 313 | "Su cita favorita", | |
| 314 | "Enlaces", | |
| 315 | "Ninguna Página predefinida", | |
| 316 | "Página web:", | |
| 317 | "Ningún Enlace preferido", | |
| 318 | "Enlaces Preferidos 1:", | |
| 319 | "Enlaces Preferidos 2:", | |
| 320 | "Enlaces Preferidos 3:", | |
| 321 | NULL | |
| 322 | }, | |
| 323 | { ES_US, "es_US", "ISO-8859-1", | |
| 324 | "ID de Yahoo!:", | |
| 325 | "Privado", | |
| 326 | "No introdujo una respuesta", | |
| 327 | "Mi Dirección de correo-e", | |
| 328 | "Nombre real:", | |
| 329 | "Localidad:", | |
| 330 | "Edad:", | |
| 331 | "Estado civil:", | |
| 332 | "Sexo:", | |
| 333 | "Ocupación:", | |
| 334 | "Pasatiempos:", | |
| 335 | "Ultimas Noticias:", | |
| 336 | "Su cita Favorita", | |
| 337 | "Enlaces", | |
| 338 | "Ninguna Página de inicio predefinida", | |
| 339 | "Página de inicio:", | |
| 340 | "Ningún Enlace preferido", | |
| 341 | "Enlaces Preferidos 1:", | |
| 342 | "Enlaces Preferidos 2:", | |
| 343 | "Enlaces Preferidos 3:", | |
| 344 | NULL | |
| 345 | }, | |
| 346 | { FR_CA, "fr_CA", "ISO-8859-1", | |
| 347 | "Compte Yahoo!:", | |
| 348 | "Privé", | |
| 349 | "Sans réponse", | |
| 350 | "Mon courriel", | |
| 351 | "Nom réel:", | |
| 352 | "Lieu:", | |
| 353 | "Âge:", | |
| 354 | "État civil:", | |
| 355 | "Sexe:", | |
| 356 | "Profession:", | |
| 357 | "Passe-temps:", | |
| 358 | "Actualités:", | |
| 359 | "Citation préférée", | |
| 360 | "Liens", | |
| 361 | "Pas de mention d'une page personnelle", | |
| 362 | "Page personnelle:", | |
| 363 | "Pas de mention d'un lien favori", | |
| 364 | "Lien préféré 1:", | |
| 365 | "Lien préféré 2:", | |
| 366 | "Lien préféré 3:", | |
| 367 | NULL | |
| 368 | }, | |
| 369 | { FR_FR, "fr_FR", "ISO-8859-1", | |
| 370 | "Compte Yahoo!:", | |
| 371 | "Privé", | |
| 372 | "Sans réponse", | |
| 373 | "Mon E-mail", | |
| 374 | "Nom réel:", | |
| 375 | "Lieu:", | |
| 376 | "Âge:", | |
| 377 | "Situation de famille:", | |
| 378 | "Sexe:", | |
| 379 | "Profession:", | |
| 380 | "Centres d'intérêts:", | |
| 381 | "Actualités:", | |
| 382 | "Citation préférée", | |
| 383 | "Liens", | |
| 384 | "Pas de mention d'une page perso", | |
| 385 | "Page perso:", | |
| 386 | "Pas de mention d'un lien favori", | |
| 387 | "Lien préféré 1:", | |
| 388 | "Lien préféré 2:", | |
| 389 | "Lien préféré 3:", | |
| 390 | NULL | |
| 391 | }, | |
| 392 | { IT, "it", "ISO-8859-1", | |
| 11626 | 393 | "Yahoo! ID:", |
| 9162 | 394 | "Non pubblica", |
| 395 | "Nessuna risposta", | |
| 11626 | 396 | "La mia e-mail:", |
| 9162 | 397 | "Nome vero:", |
| 398 | "Località:", | |
| 11626 | 399 | "Età:", |
| 9162 | 400 | "Stato civile:", |
| 401 | "Sesso:", | |
| 402 | "Occupazione:", | |
| 11626 | 403 | "Hobby", |
| 404 | "Ultime notizie", | |
| 9162 | 405 | "Citazione preferita", |
| 406 | "Link", | |
| 407 | "Nessuna home page specificata", | |
| 408 | "Inizio:", | |
| 409 | "Nessun link specificato", | |
| 11626 | 410 | "Cool Link 1", |
| 411 | "Cool Link 2", | |
| 412 | "Cool Link 3", | |
| 9162 | 413 | NULL |
| 414 | }, | |
| 415 | { JA, "ja", "EUC-JP", | |
| 416 | "Yahoo! JAPAN ID:", | |
| 417 | "非公開", | |
| 418 | "無回答", | |
| 419 | "メール:", | |
| 420 | "名前:", | |
| 421 | "住所:", | |
| 422 | "年齢:", | |
| 423 | "未婚/既婚:", | |
| 424 | "性別:", | |
| 425 | "職業:", | |
| 426 | "趣味:", | |
| 427 | "最近の出来事:", | |
| 428 | NULL, | |
| 429 | #if 0 | |
| 430 | "おすすめサイト", | |
| 431 | #else | |
| 432 | "自己PR", /* "Self description" comes before "Links" for yahoo.co.jp */ | |
| 433 | #endif | |
| 434 | NULL, | |
| 435 | NULL, | |
| 436 | NULL, | |
| 437 | "おすすめサイト1:", | |
| 438 | "おすすめサイト2:", | |
| 439 | "おすすめサイト3:", | |
| 440 | NULL | |
| 441 | }, | |
| 442 | { KO, "ko", "EUC-KR", | |
| 443 | "야후! ID:", | |
| 444 | "비공개", | |
| 445 | "비공개", | |
| 446 | "My Email", | |
| 447 | "실명:", | |
| 448 | "거주지:", | |
| 449 | "나이:", | |
| 450 | "결혼 여부:", | |
| 451 | "성별:", | |
| 452 | "직업:", | |
| 453 | "취미:", | |
| 454 | "자기 소개:", | |
| 455 | "좋아하는 명언", | |
| 456 | "링크", | |
| 457 | "홈페이지를 지정하지 않았습니다.", | |
| 458 | "홈페이지:", | |
| 459 | "추천 사이트가 없습니다.", | |
| 460 | "추천 사이트 1:", | |
| 461 | "추천 사이트 2:", | |
| 462 | "추천 사이트 3:", | |
| 463 | NULL | |
| 464 | }, | |
| 465 | { NO, "no", "ISO-8859-1", | |
| 466 | "Yahoo! ID:", | |
| 467 | "Privat", | |
| 468 | "Ikke noe svar", | |
| 469 | "Min e-post", | |
| 470 | "Virkelig navn:", | |
| 471 | "Sted:", | |
| 472 | "Alder:", | |
| 473 | "Sivilstatus:", | |
| 474 | "Kjønn:", | |
| 475 | "Yrke:", | |
| 476 | "Hobbyer:", | |
| 477 | "Siste nytt:", | |
| 478 | "Yndlingssitat", | |
| 479 | "Lenker", | |
| 480 | "Ingen hjemmeside angitt", | |
| 481 | "Hjemmeside:", | |
| 482 | "No cool link specified", | |
| 483 | "Bra lenke 1:", | |
| 484 | "Bra lenke 2:", | |
| 485 | "Bra lenke 3:", | |
| 486 | NULL | |
| 487 | }, | |
| 488 | { PT, "pt", "ISO-8859-1", | |
| 489 | "ID Yahoo!:", | |
| 490 | "Particular", | |
| 491 | "Sem resposta", | |
| 492 | "Meu e-mail", | |
| 493 | "Nome verdadeiro:", | |
| 494 | "Local:", | |
| 495 | "Idade:", | |
| 496 | "Estado civil:", | |
| 497 | "Sexo:", | |
| 498 | "Ocupação:", | |
| 499 | "Hobbies:", | |
| 500 | "Últimas notícias:", | |
| 501 | "Frase favorita", | |
| 502 | "Links", | |
| 503 | "Nenhuma página pessoal especificada", | |
| 504 | "Página pessoal:", | |
| 505 | "Nenhum site legal especificado", | |
| 506 | "Site legal 1:", | |
| 507 | "Site legal 2:", | |
| 508 | "Site legal 3:", | |
| 509 | NULL | |
| 510 | }, | |
|
18795
8c4b65aae6e0
Patch from Mauro Brasil to support Brazilian profiles on Yahoo. Fixes #2091.
Daniel Atallah <datallah@pidgin.im>
parents:
16539
diff
changeset
|
511 | { PT_BR, "pt_br", "ISO-8859-1", |
|
8c4b65aae6e0
Patch from Mauro Brasil to support Brazilian profiles on Yahoo. Fixes #2091.
Daniel Atallah <datallah@pidgin.im>
parents:
16539
diff
changeset
|
512 | "ID Yahoo!:", |
|
8c4b65aae6e0
Patch from Mauro Brasil to support Brazilian profiles on Yahoo. Fixes #2091.
Daniel Atallah <datallah@pidgin.im>
parents:
16539
diff
changeset
|
513 | "Particular", |
|
8c4b65aae6e0
Patch from Mauro Brasil to support Brazilian profiles on Yahoo. Fixes #2091.
Daniel Atallah <datallah@pidgin.im>
parents:
16539
diff
changeset
|
514 | "Sem resposta", |
|
8c4b65aae6e0
Patch from Mauro Brasil to support Brazilian profiles on Yahoo. Fixes #2091.
Daniel Atallah <datallah@pidgin.im>
parents:
16539
diff
changeset
|
515 | "Meu e-mail", |
|
8c4b65aae6e0
Patch from Mauro Brasil to support Brazilian profiles on Yahoo. Fixes #2091.
Daniel Atallah <datallah@pidgin.im>
parents:
16539
diff
changeset
|
516 | "Nome verdadeiro:", |
|
8c4b65aae6e0
Patch from Mauro Brasil to support Brazilian profiles on Yahoo. Fixes #2091.
Daniel Atallah <datallah@pidgin.im>
parents:
16539
diff
changeset
|
517 | "Localização:", |
|
8c4b65aae6e0
Patch from Mauro Brasil to support Brazilian profiles on Yahoo. Fixes #2091.
Daniel Atallah <datallah@pidgin.im>
parents:
16539
diff
changeset
|
518 | "Idade:", |
|
8c4b65aae6e0
Patch from Mauro Brasil to support Brazilian profiles on Yahoo. Fixes #2091.
Daniel Atallah <datallah@pidgin.im>
parents:
16539
diff
changeset
|
519 | "Estado civil:", |
|
8c4b65aae6e0
Patch from Mauro Brasil to support Brazilian profiles on Yahoo. Fixes #2091.
Daniel Atallah <datallah@pidgin.im>
parents:
16539
diff
changeset
|
520 | "Sexo:", |
|
8c4b65aae6e0
Patch from Mauro Brasil to support Brazilian profiles on Yahoo. Fixes #2091.
Daniel Atallah <datallah@pidgin.im>
parents:
16539
diff
changeset
|
521 | "Ocupação:", |
|
8c4b65aae6e0
Patch from Mauro Brasil to support Brazilian profiles on Yahoo. Fixes #2091.
Daniel Atallah <datallah@pidgin.im>
parents:
16539
diff
changeset
|
522 | "Pasatiempos:", |
|
8c4b65aae6e0
Patch from Mauro Brasil to support Brazilian profiles on Yahoo. Fixes #2091.
Daniel Atallah <datallah@pidgin.im>
parents:
16539
diff
changeset
|
523 | "Últimas novidades:", |
|
8c4b65aae6e0
Patch from Mauro Brasil to support Brazilian profiles on Yahoo. Fixes #2091.
Daniel Atallah <datallah@pidgin.im>
parents:
16539
diff
changeset
|
524 | "Frase preferida:", |
|
8c4b65aae6e0
Patch from Mauro Brasil to support Brazilian profiles on Yahoo. Fixes #2091.
Daniel Atallah <datallah@pidgin.im>
parents:
16539
diff
changeset
|
525 | "Links", |
|
8c4b65aae6e0
Patch from Mauro Brasil to support Brazilian profiles on Yahoo. Fixes #2091.
Daniel Atallah <datallah@pidgin.im>
parents:
16539
diff
changeset
|
526 | "Nenhuma home page especificada", |
|
8c4b65aae6e0
Patch from Mauro Brasil to support Brazilian profiles on Yahoo. Fixes #2091.
Daniel Atallah <datallah@pidgin.im>
parents:
16539
diff
changeset
|
527 | "Página Web:", |
|
8c4b65aae6e0
Patch from Mauro Brasil to support Brazilian profiles on Yahoo. Fixes #2091.
Daniel Atallah <datallah@pidgin.im>
parents:
16539
diff
changeset
|
528 | "Nenhum site legal especificado", |
|
8c4b65aae6e0
Patch from Mauro Brasil to support Brazilian profiles on Yahoo. Fixes #2091.
Daniel Atallah <datallah@pidgin.im>
parents:
16539
diff
changeset
|
529 | "Link legal 1", |
|
8c4b65aae6e0
Patch from Mauro Brasil to support Brazilian profiles on Yahoo. Fixes #2091.
Daniel Atallah <datallah@pidgin.im>
parents:
16539
diff
changeset
|
530 | "Link legal 2", |
|
8c4b65aae6e0
Patch from Mauro Brasil to support Brazilian profiles on Yahoo. Fixes #2091.
Daniel Atallah <datallah@pidgin.im>
parents:
16539
diff
changeset
|
531 | "Link legal 3", |
|
8c4b65aae6e0
Patch from Mauro Brasil to support Brazilian profiles on Yahoo. Fixes #2091.
Daniel Atallah <datallah@pidgin.im>
parents:
16539
diff
changeset
|
532 | NULL |
|
8c4b65aae6e0
Patch from Mauro Brasil to support Brazilian profiles on Yahoo. Fixes #2091.
Daniel Atallah <datallah@pidgin.im>
parents:
16539
diff
changeset
|
533 | }, |
| 9162 | 534 | { SV, "sv", "ISO-8859-1", |
| 535 | "Yahoo!-ID:", | |
| 536 | "Privat", | |
| 537 | "Inget svar", | |
| 538 | "Min mail", | |
| 539 | "Riktigt namn:", | |
| 540 | "Plats:", | |
| 541 | "Ålder:", | |
| 542 | "Civilstånd:", | |
| 543 | "Kön:", | |
| 544 | "Yrke:", | |
| 545 | "Hobby:", | |
| 546 | "Senaste nytt:", | |
| 547 | "Favoritcitat", | |
| 548 | "Länkar", | |
| 549 | "Ingen hemsida specificerad", | |
| 550 | "Hemsida:", | |
| 551 | "Ingen cool länk specificerad", | |
| 552 | "Coola länkar 1:", | |
| 553 | "Coola länkar 2:", | |
| 554 | "Coola länkar 3:", | |
| 555 | NULL | |
| 556 | }, | |
| 557 | { ZH_CN, "zh_CN", "GB2312", | |
| 558 | "Yahoo! ID:", | |
| 559 | "没有提供", | |
| 560 | "没有回答", | |
| 561 | "个人电邮地址", | |
| 562 | "真实姓名:", | |
| 563 | "所在地点:", | |
| 564 | "年龄:", | |
| 565 | "婚姻状况:", | |
| 566 | "性别:", | |
| 567 | "职业:", | |
| 568 | "业余爱好:", | |
| 569 | "个人近况:", | |
| 570 | "喜欢的引言", | |
| 571 | "链接", | |
| 572 | "没有个人主页", | |
| 573 | "个人主页:", | |
| 574 | "没有推荐网站链接", | |
| 575 | "推荐网站链接 1:", | |
| 576 | "推荐网站链接 2:", | |
| 577 | "推荐网站链接 3:", | |
| 578 | NULL | |
| 579 | }, | |
| 580 | { ZH_HK, "zh_HK", "Big5", | |
| 581 | "Yahoo! ID:", | |
| 582 | "私人的", | |
| 583 | "沒有回答", | |
| 584 | "電子信箱", | |
| 585 | "真實姓名:", | |
| 586 | "地點:", | |
| 587 | "年齡:", | |
| 588 | "婚姻狀況:", | |
| 589 | "性別:", | |
| 590 | "職業:", | |
| 591 | "嗜好:", | |
| 592 | "最新消息:", | |
| 593 | "最喜愛的股票叫價", /* [sic] Yahoo!'s translators don't check context */ | |
| 594 | "連結", | |
| 595 | "沒有注明個人網頁", /* [sic] */ | |
| 596 | "個人網頁:", | |
| 597 | "沒有注明 Cool 連結", /* [sic] */ | |
| 598 | "Cool 連結 1:", /* TODO */ | |
| 599 | "Cool 連結 2:", /* TODO */ | |
| 600 | "Cool 連結 3:", /* TODO */ | |
| 601 | NULL | |
| 602 | }, | |
| 603 | { ZH_TW, "zh_TW", "Big5", | |
| 604 | "帳 號:", | |
| 605 | "沒有提供", | |
| 606 | "沒有回應", | |
| 607 | "電子信箱", | |
| 608 | "姓名:", | |
| 609 | "地點:", | |
| 610 | "年齡:", | |
| 611 | "婚姻狀態:", | |
| 612 | "性別:", | |
| 613 | "職業:", | |
| 614 | "興趣:", | |
| 615 | "個人近況:", | |
| 616 | "喜歡的名句", | |
| 617 | "連結", | |
| 618 | "沒有個人網頁", | |
| 619 | "個人網頁:", | |
| 620 | "沒有推薦網站連結", | |
| 621 | "推薦網站連結 1:", | |
| 622 | "推薦網站連結 2:", | |
| 623 | "推薦網站連結 3:", | |
| 624 | NULL | |
| 625 | }, | |
| 626 | { ZH_US, "zh_US", "Big5", /* ZH_US is like ZH_TW, but also a bit like ZH_HK */ | |
| 627 | "Yahoo! ID:", | |
| 628 | "沒有提供", | |
| 629 | "沒有回答", | |
| 630 | "個人Email地址", | |
| 631 | "真實姓名:", | |
| 632 | "地點:", | |
| 633 | "年齡:", | |
| 634 | "婚姻狀態:", | |
| 635 | "性別:", | |
| 636 | "職業:", | |
| 637 | "嗜好:", | |
| 638 | "個人近況:", | |
| 639 | "喜歡的名句", | |
| 640 | "連結", | |
| 641 | "沒有個人網頁", | |
| 642 | "個人網頁:", | |
| 643 | "沒有推薦網站連結", | |
| 644 | "推薦網站連結 1:", /* TODO */ | |
| 645 | "推薦網站連結 2:", /* TODO */ | |
| 646 | "推薦網站連結 3:", /* TODO */ | |
| 647 | NULL | |
| 648 | }, | |
|
12600
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12578
diff
changeset
|
649 | { XX, NULL, NULL, |
|
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12578
diff
changeset
|
650 | NULL, |
|
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12578
diff
changeset
|
651 | NULL, |
|
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12578
diff
changeset
|
652 | NULL, |
|
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12578
diff
changeset
|
653 | NULL, |
|
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12578
diff
changeset
|
654 | NULL, |
|
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12578
diff
changeset
|
655 | NULL, |
|
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12578
diff
changeset
|
656 | NULL, |
|
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12578
diff
changeset
|
657 | NULL, |
|
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12578
diff
changeset
|
658 | NULL, |
|
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12578
diff
changeset
|
659 | NULL, |
|
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12578
diff
changeset
|
660 | NULL, |
|
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12578
diff
changeset
|
661 | NULL, |
|
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12578
diff
changeset
|
662 | NULL, |
|
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12578
diff
changeset
|
663 | NULL, |
|
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12578
diff
changeset
|
664 | NULL, |
|
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12578
diff
changeset
|
665 | NULL, |
|
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12578
diff
changeset
|
666 | NULL, |
|
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12578
diff
changeset
|
667 | NULL, |
|
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12578
diff
changeset
|
668 | NULL, |
|
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12578
diff
changeset
|
669 | NULL, |
|
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12578
diff
changeset
|
670 | NULL |
|
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12578
diff
changeset
|
671 | }, |
| 9162 | 672 | }; |
| 673 | ||
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
12970
diff
changeset
|
674 | static char *yahoo_info_date_reformat(const char *field, size_t len) |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
12970
diff
changeset
|
675 | { |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
12970
diff
changeset
|
676 | char *tmp = g_strndup(field, len); |
| 15884 | 677 | time_t t = purple_str_to_time(tmp, FALSE, NULL, NULL, NULL); |
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
12970
diff
changeset
|
678 | |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
12970
diff
changeset
|
679 | g_free(tmp); |
| 15884 | 680 | return g_strdup(purple_date_format_short(localtime(&t))); |
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
12970
diff
changeset
|
681 | } |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
12970
diff
changeset
|
682 | |
| 9162 | 683 | static char *yahoo_remove_nonbreaking_spaces(char *str) |
| 684 | { | |
| 685 | char *p; | |
| 686 | while ((p = strstr(str, " ")) != NULL) { | |
| 687 | *p = ' '; /* Turn 's into ordinary blanks */ | |
| 688 | p += 1; | |
| 689 | memmove(p, p + 5, strlen(p + 5)); | |
| 690 | str[strlen(str) - 5] = '\0'; | |
| 691 | } | |
| 692 | return str; | |
| 693 | } | |
| 694 | ||
| 15884 | 695 | static void yahoo_extract_user_info_text(PurpleNotifyUserInfo *user_info, YahooGetInfoData *info_data) { |
| 696 | PurpleBuddy *b; | |
| 9281 | 697 | YahooFriend *f; |
| 9242 | 698 | |
| 15884 | 699 | b = purple_find_buddy(purple_connection_get_account(info_data->gc), |
| 9242 | 700 | info_data->name); |
| 701 | ||
| 702 | if (b) { | |
|
24950
143f594f0cd0
Alias foo. I think blist.h structs are now completely hidden.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24398
diff
changeset
|
703 | const char *balias = purple_buddy_get_local_buddy_alias(b); |
|
143f594f0cd0
Alias foo. I think blist.h structs are now completely hidden.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24398
diff
changeset
|
704 | if(balias && balias[0]) { |
|
30537
9f833935ecd7
Add a purple_notify_user_info_add_pair_plaintext function that accepts a
Mark Doliner <markdoliner@pidgin.im>
parents:
27959
diff
changeset
|
705 | purple_notify_user_info_add_pair_plaintext(user_info, _("Alias"), balias); |
| 9242 | 706 | } |
| 9984 | 707 | #if 0 |
| 9242 | 708 | if (b->idle > 0) { |
| 15884 | 709 | char *idletime = purple_str_seconds_to_string(time(NULL) - b->idle); |
|
30537
9f833935ecd7
Add a purple_notify_user_info_add_pair_plaintext function that accepts a
Mark Doliner <markdoliner@pidgin.im>
parents:
27959
diff
changeset
|
710 | purple_notify_user_info_add_pair_plaintext(user_info, _("Idle"), idletime); |
| 9242 | 711 | g_free(idletime); |
| 712 | } | |
| 9984 | 713 | #endif |
|
12970
c2f3b4dcf711
[gaim-migrate @ 15323]
Richard Laager <rlaager@pidgin.im>
parents:
12943
diff
changeset
|
714 | |
|
15205
f642029b2f97
[gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents:
14751
diff
changeset
|
715 | /* Add the normal tooltip pairs */ |
|
f642029b2f97
[gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents:
14751
diff
changeset
|
716 | yahoo_tooltip_text(b, user_info, TRUE); |
|
12970
c2f3b4dcf711
[gaim-migrate @ 15323]
Richard Laager <rlaager@pidgin.im>
parents:
12943
diff
changeset
|
717 | |
|
24398
4865c2ee6ea8
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24181
diff
changeset
|
718 | if ((f = yahoo_friend_find(info_data->gc, purple_buddy_get_name(b)))) { |
| 9281 | 719 | const char *ip; |
| 720 | if ((ip = yahoo_friend_get_ip(f))) | |
|
30537
9f833935ecd7
Add a purple_notify_user_info_add_pair_plaintext function that accepts a
Mark Doliner <markdoliner@pidgin.im>
parents:
27959
diff
changeset
|
721 | purple_notify_user_info_add_pair_plaintext(user_info, _("IP Address"), ip); |
| 9281 | 722 | } |
| 9242 | 723 | } |
| 724 | } | |
| 725 | ||
| 726 | #if PHOTO_SUPPORT | |
| 727 | ||
| 728 | static char *yahoo_get_photo_url(const char *url_text, const char *name) { | |
| 729 | GString *s = g_string_sized_new(strlen(name) + 8); | |
| 730 | char *p; | |
| 731 | char *it = NULL; | |
| 732 | ||
|
11045
722a562fedeb
[gaim-migrate @ 12961]
Joshua Honeycutt <coweater@users.sourceforge.net>
parents:
10604
diff
changeset
|
733 | /*g_string_printf(s, " alt=\"%s\">", name);*/ |
|
722a562fedeb
[gaim-migrate @ 12961]
Joshua Honeycutt <coweater@users.sourceforge.net>
parents:
10604
diff
changeset
|
734 | /* Y! newformat */ |
|
722a562fedeb
[gaim-migrate @ 12961]
Joshua Honeycutt <coweater@users.sourceforge.net>
parents:
10604
diff
changeset
|
735 | g_string_printf(s, " alt=%s>", name); |
| 9242 | 736 | p = strstr(url_text, s->str); |
| 737 | ||
| 738 | if (p) { | |
| 739 | /* Search backwards for "http://". This is stupid, but it works. */ | |
| 740 | for (; !it && p > url_text; p -= 1) { | |
|
11045
722a562fedeb
[gaim-migrate @ 12961]
Joshua Honeycutt <coweater@users.sourceforge.net>
parents:
10604
diff
changeset
|
741 | /*if (strncmp(p, "\"http://", 8) == 0) {*/ |
|
722a562fedeb
[gaim-migrate @ 12961]
Joshua Honeycutt <coweater@users.sourceforge.net>
parents:
10604
diff
changeset
|
742 | /* Y! newformat*/ |
|
722a562fedeb
[gaim-migrate @ 12961]
Joshua Honeycutt <coweater@users.sourceforge.net>
parents:
10604
diff
changeset
|
743 | if (strncmp(p, "=http://", 8) == 0) { |
| 9242 | 744 | char *q; |
|
11045
722a562fedeb
[gaim-migrate @ 12961]
Joshua Honeycutt <coweater@users.sourceforge.net>
parents:
10604
diff
changeset
|
745 | p += 1; /* skip only the ' ' */ |
|
722a562fedeb
[gaim-migrate @ 12961]
Joshua Honeycutt <coweater@users.sourceforge.net>
parents:
10604
diff
changeset
|
746 | q = strchr(p, ' '); |
| 9242 | 747 | if (q) { |
|
23438
21a1b7950f69
Plug a small and unlikely leak.
Daniel Atallah <datallah@pidgin.im>
parents:
23325
diff
changeset
|
748 | g_free(it); |
| 9242 | 749 | it = g_strndup(p, q - p); |
| 750 | } | |
| 751 | } | |
| 752 | } | |
| 753 | } | |
| 754 | ||
| 755 | g_string_free(s, TRUE); | |
| 756 | return it; | |
| 757 | } | |
| 758 | ||
|
14416
c95ffd983a39
[gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
759 | static void |
|
34227
6d016a081401
HTTP: migrate purple_util_fetch_url to new API for prpls
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33774
diff
changeset
|
760 | yahoo_got_photo(PurpleHttpConnection *http_conn, PurpleHttpResponse *response, |
|
6d016a081401
HTTP: migrate purple_util_fetch_url to new API for prpls
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33774
diff
changeset
|
761 | gpointer _info2_data); |
| 9242 | 762 | |
| 763 | #endif /* PHOTO_SUPPORT */ | |
| 764 | ||
|
34227
6d016a081401
HTTP: migrate purple_util_fetch_url to new API for prpls
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33774
diff
changeset
|
765 | static void |
|
6d016a081401
HTTP: migrate purple_util_fetch_url to new API for prpls
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33774
diff
changeset
|
766 | yahoo_got_info(PurpleHttpConnection *http_conn, PurpleHttpResponse *response, |
|
6d016a081401
HTTP: migrate purple_util_fetch_url to new API for prpls
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33774
diff
changeset
|
767 | gpointer _info_data) |
| 9162 | 768 | { |
|
34227
6d016a081401
HTTP: migrate purple_util_fetch_url to new API for prpls
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33774
diff
changeset
|
769 | YahooGetInfoData *info_data = _info_data; |
| 15884 | 770 | PurpleNotifyUserInfo *user_info; |
| 9242 | 771 | char *p; |
| 772 | #if PHOTO_SUPPORT | |
| 773 | YahooGetInfoStepTwoData *info2_data; | |
| 774 | char *photo_url_text = NULL; | |
| 775 | #else | |
| 9162 | 776 | gboolean found = FALSE; |
| 9242 | 777 | char *stripped; |
| 778 | int stripped_len; | |
| 779 | char *last_updated_utf8_string = NULL; | |
|
27335
06a805d4e690
Strip trailing whitespace and comment #endif marcos that close #ifdef macros
Mark Doliner <markdoliner@pidgin.im>
parents:
25119
diff
changeset
|
780 | #endif /* !PHOTO_SUPPORT */ |
| 9242 | 781 | const char *last_updated_string = NULL; |
| 9162 | 782 | char *url_buffer; |
| 783 | GString *s; | |
|
15205
f642029b2f97
[gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents:
14751
diff
changeset
|
784 | char *tmp; |
| 9242 | 785 | char *profile_url_text = NULL; |
| 9162 | 786 | int lang, strid; |
|
27959
f842ae57da4e
Move from "struct yahoo_data" to "YahooData" to be consistent with other structs
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
27555
diff
changeset
|
787 | YahooData *yd; |
| 9242 | 788 | const profile_strings_node_t *strings = NULL; |
| 9510 | 789 | const char *title; |
| 790 | profile_state_t profile_state = PROFILE_STATE_DEFAULT; | |
|
34227
6d016a081401
HTTP: migrate purple_util_fetch_url to new API for prpls
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33774
diff
changeset
|
791 | const gchar *url_text; |
| 9221 | 792 | |
| 15884 | 793 | purple_debug_info("yahoo", "In yahoo_got_info\n"); |
| 9162 | 794 | |
|
32280
704f84f692f6
Convert yahoo prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data()
Andrew Victor <andrew.victor@mxit.com>
parents:
32191
diff
changeset
|
795 | yd = purple_connection_get_protocol_data(info_data->gc); |
|
14416
c95ffd983a39
[gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
796 | |
| 15884 | 797 | user_info = purple_notify_user_info_new(); |
|
15205
f642029b2f97
[gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents:
14751
diff
changeset
|
798 | |
|
14416
c95ffd983a39
[gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
799 | title = yd->jp ? _("Yahoo! Japan Profile") : |
|
c95ffd983a39
[gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
800 | _("Yahoo! Profile"); |
| 9242 | 801 | |
| 802 | /* Get the tooltip info string */ | |
|
15205
f642029b2f97
[gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents:
14751
diff
changeset
|
803 | yahoo_extract_user_info_text(user_info, info_data); |
|
14416
c95ffd983a39
[gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
804 | |
| 9242 | 805 | /* We failed to grab the profile URL. This is not expected to actually |
| 806 | * happen except under unusual error conditions, as Yahoo is observed | |
| 807 | * to send back HTML, with a 200 status code. | |
| 808 | */ | |
|
34227
6d016a081401
HTTP: migrate purple_util_fetch_url to new API for prpls
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33774
diff
changeset
|
809 | if (!purple_http_response_is_successfull(response)) { |
|
32191
a4668d9dc8d1
Rename purple_notify_user_info_add_pair to
Mark Doliner <markdoliner@pidgin.im>
parents:
32162
diff
changeset
|
810 | purple_notify_user_info_add_pair_html(user_info, _("Error retrieving profile"), NULL); |
|
25089
b381e7e2a1cf
Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <markdoliner@pidgin.im>
parents:
24181
diff
changeset
|
811 | purple_notify_userinfo(info_data->gc, info_data->name, |
|
15205
f642029b2f97
[gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents:
14751
diff
changeset
|
812 | user_info, NULL, NULL); |
| 15884 | 813 | purple_notify_user_info_destroy(user_info); |
| 9242 | 814 | g_free(profile_url_text); |
| 9162 | 815 | g_free(info_data->name); |
| 816 | g_free(info_data); | |
| 817 | return; | |
| 818 | } | |
| 819 | ||
|
34227
6d016a081401
HTTP: migrate purple_util_fetch_url to new API for prpls
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33774
diff
changeset
|
820 | url_text = purple_http_response_get_data(response, NULL); |
|
6d016a081401
HTTP: migrate purple_util_fetch_url to new API for prpls
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33774
diff
changeset
|
821 | |
| 9242 | 822 | /* Construct the correct profile URL */ |
| 823 | s = g_string_sized_new(80); /* wild guess */ | |
| 824 | g_string_printf(s, "%s%s", (yd->jp? YAHOOJP_PROFILE_URL: YAHOO_PROFILE_URL), | |
| 825 | info_data->name); | |
| 826 | profile_url_text = g_string_free(s, FALSE); | |
| 827 | s = NULL; | |
| 828 | ||
| 829 | /* We don't yet support the multiple link level of the warning page for | |
| 9162 | 830 | * 'adult' profiles, not to mention the fact that yahoo wants you to be |
| 9242 | 831 | * logged in (on the website) to be able to view an 'adult' profile. For |
| 9162 | 832 | * now, just tell them that we can't help them, and provide a link to the |
| 833 | * profile if they want to do the web browser thing. | |
| 834 | */ | |
| 835 | p = strstr(url_text, "Adult Profiles Warning Message"); | |
| 9242 | 836 | if (!p) { |
| 837 | p = strstr(url_text, "Adult Content Warning"); /* TITLE element */ | |
| 838 | } | |
| 9162 | 839 | if (p) { |
|
15205
f642029b2f97
[gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents:
14751
diff
changeset
|
840 | tmp = g_strdup_printf("<b>%s</b><br><br>" |
|
f642029b2f97
[gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents:
14751
diff
changeset
|
841 | "%s<br><a href=\"%s\">%s</a>", |
|
f642029b2f97
[gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents:
14751
diff
changeset
|
842 | _("Sorry, profiles marked as containing adult content " |
|
f642029b2f97
[gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents:
14751
diff
changeset
|
843 | "are not supported at this time."), |
|
f642029b2f97
[gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents:
14751
diff
changeset
|
844 | _("If you wish to view this profile, " |
|
f642029b2f97
[gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents:
14751
diff
changeset
|
845 | "you will need to visit this link in your web browser:"), |
|
f642029b2f97
[gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents:
14751
diff
changeset
|
846 | profile_url_text, profile_url_text); |
|
32191
a4668d9dc8d1
Rename purple_notify_user_info_add_pair to
Mark Doliner <markdoliner@pidgin.im>
parents:
32162
diff
changeset
|
847 | purple_notify_user_info_add_pair_html(user_info, NULL, tmp); |
|
15205
f642029b2f97
[gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents:
14751
diff
changeset
|
848 | g_free(tmp); |
| 9162 | 849 | |
|
25089
b381e7e2a1cf
Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <markdoliner@pidgin.im>
parents:
24181
diff
changeset
|
850 | purple_notify_userinfo(info_data->gc, info_data->name, |
|
15205
f642029b2f97
[gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents:
14751
diff
changeset
|
851 | user_info, NULL, NULL); |
| 9162 | 852 | |
| 9242 | 853 | g_free(profile_url_text); |
| 15884 | 854 | purple_notify_user_info_destroy(user_info); |
| 9162 | 855 | g_free(info_data->name); |
| 856 | g_free(info_data); | |
| 857 | return; | |
| 858 | } | |
| 859 | ||
| 860 | /* Check whether the profile is written in a supported language */ | |
| 861 | for (lang = 0;; lang += 1) { | |
| 862 | last_updated_string = profile_langs[lang].last_updated_string; | |
|
13499
f6c508815869
[gaim-migrate @ 15874]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
863 | if (!last_updated_string) |
|
f6c508815869
[gaim-migrate @ 15874]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
864 | break; |
|
f6c508815869
[gaim-migrate @ 15874]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
865 | |
| 9162 | 866 | p = strstr(url_text, last_updated_string); |
|
13499
f6c508815869
[gaim-migrate @ 15874]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
867 | |
|
f6c508815869
[gaim-migrate @ 15874]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
868 | if (p) { |
|
f6c508815869
[gaim-migrate @ 15874]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
869 | if (profile_langs[lang].det && !strstr(url_text, profile_langs[lang].det)) |
|
f6c508815869
[gaim-migrate @ 15874]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
870 | p = NULL; |
|
f6c508815869
[gaim-migrate @ 15874]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
871 | else |
|
f6c508815869
[gaim-migrate @ 15874]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
872 | break; |
| 9162 | 873 | } |
| 874 | } | |
|
13499
f6c508815869
[gaim-migrate @ 15874]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
875 | |
| 9162 | 876 | if (p) { |
| 877 | for (strid = 0; profile_strings[strid].lang != XX; strid += 1) { | |
| 9221 | 878 | if (profile_strings[strid].lang == profile_langs[lang].lang) break; |
| 9162 | 879 | } |
| 9242 | 880 | strings = profile_strings + strid; |
| 15884 | 881 | purple_debug_info("yahoo", "detected profile lang = %s (%d)\n", profile_strings[strid].lang_string, lang); |
| 9162 | 882 | } |
| 883 | ||
| 9220 | 884 | /* Every user may choose his/her own profile language, and this language |
| 885 | * has nothing to do with the preferences of the user which looks at the | |
| 886 | * profile. We try to support all languages, but nothing is guaranteed. | |
| 9242 | 887 | * If we cannot determine the language, it means either (1) the profile |
| 888 | * is written in an unsupported language, (2) our language support is | |
|
11045
722a562fedeb
[gaim-migrate @ 12961]
Joshua Honeycutt <coweater@users.sourceforge.net>
parents:
10604
diff
changeset
|
889 | * out of date, or (3) the user is not found, or (4) Y! have changed their |
|
722a562fedeb
[gaim-migrate @ 12961]
Joshua Honeycutt <coweater@users.sourceforge.net>
parents:
10604
diff
changeset
|
890 | * webpage layout |
| 9162 | 891 | */ |
| 9242 | 892 | if (!p || strings->lang == XX) { |
| 893 | if (!strstr(url_text, "Yahoo! Member Directory - User not found") | |
| 894 | && !strstr(url_text, "was not found on this server.") | |
| 895 | && !strstr(url_text, "\xb8\xf8\xb3\xab\xa5\xd7\xa5\xed\xa5\xd5\xa5\xa3\xa1\xbc\xa5\xeb\xa4\xac\xb8\xab\xa4\xc4\xa4\xab\xa4\xea\xa4\xde\xa4\xbb\xa4\xf3")) { | |
| 9510 | 896 | profile_state = PROFILE_STATE_UNKNOWN_LANGUAGE; |
| 9162 | 897 | } else { |
| 9510 | 898 | profile_state = PROFILE_STATE_NOT_FOUND; |
| 9162 | 899 | } |
| 900 | } | |
| 901 | ||
| 9242 | 902 | #if PHOTO_SUPPORT |
| 903 | photo_url_text = yahoo_get_photo_url(url_text, info_data->name); | |
|
27335
06a805d4e690
Strip trailing whitespace and comment #endif marcos that close #ifdef macros
Mark Doliner <markdoliner@pidgin.im>
parents:
25119
diff
changeset
|
904 | #endif /* PHOTO_SUPPORT */ |
| 9242 | 905 | |
| 9162 | 906 | url_buffer = g_strdup(url_text); |
| 907 | ||
| 908 | /* | |
| 15884 | 909 | * purple_markup_strip_html() doesn't strip out character entities like |
| 9162 | 910 | * and · |
| 911 | */ | |
| 912 | yahoo_remove_nonbreaking_spaces(url_buffer); | |
| 913 | #if 1 | |
| 914 | while ((p = strstr(url_buffer, "·")) != NULL) { | |
| 915 | memmove(p, p + 6, strlen(p + 6)); | |
| 916 | url_buffer[strlen(url_buffer) - 6] = '\0'; | |
| 917 | } | |
| 918 | #endif | |
| 919 | ||
| 920 | /* nuke the nasty \r's */ | |
| 15884 | 921 | purple_str_strip_char(url_buffer, '\r'); |
| 9242 | 922 | |
| 923 | #if PHOTO_SUPPORT | |
| 924 | /* Marshall the existing state */ | |
| 925 | info2_data = g_malloc(sizeof(YahooGetInfoStepTwoData)); | |
| 926 | info2_data->info_data = info_data; | |
| 927 | info2_data->url_buffer = url_buffer; | |
| 928 | info2_data->photo_url_text = photo_url_text; | |
| 929 | info2_data->profile_url_text = profile_url_text; | |
| 930 | info2_data->strings = strings; | |
| 931 | info2_data->last_updated_string = last_updated_string; | |
| 9510 | 932 | info2_data->title = title; |
| 933 | info2_data->profile_state = profile_state; | |
|
15205
f642029b2f97
[gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents:
14751
diff
changeset
|
934 | info2_data->user_info = user_info; |
| 9242 | 935 | |
| 936 | /* Try to put the photo in there too, if there's one */ | |
| 937 | if (photo_url_text) { | |
|
34269
26b4c9a54166
HTTP: Use PurpleHttpConnectionSet instead of GSLists of PurpleHttpConnection structs
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34233
diff
changeset
|
938 | purple_http_connection_set_add(yd->http_reqs, purple_http_get( |
|
26b4c9a54166
HTTP: Use PurpleHttpConnectionSet instead of GSLists of PurpleHttpConnection structs
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34233
diff
changeset
|
939 | info_data->gc, yahoo_got_photo, info2_data, |
|
26b4c9a54166
HTTP: Use PurpleHttpConnectionSet instead of GSLists of PurpleHttpConnection structs
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34233
diff
changeset
|
940 | photo_url_text)); |
| 9242 | 941 | } else { |
| 942 | /* Emulate a callback */ | |
|
34227
6d016a081401
HTTP: migrate purple_util_fetch_url to new API for prpls
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33774
diff
changeset
|
943 | yahoo_got_photo(NULL, NULL, info2_data); |
| 9162 | 944 | } |
| 9242 | 945 | } |
| 946 | ||
|
14416
c95ffd983a39
[gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
947 | static void |
|
34227
6d016a081401
HTTP: migrate purple_util_fetch_url to new API for prpls
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33774
diff
changeset
|
948 | yahoo_got_photo(PurpleHttpConnection *http_conn, PurpleHttpResponse *response, |
|
6d016a081401
HTTP: migrate purple_util_fetch_url to new API for prpls
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33774
diff
changeset
|
949 | gpointer _info2_data) |
| 9242 | 950 | { |
|
34227
6d016a081401
HTTP: migrate purple_util_fetch_url to new API for prpls
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33774
diff
changeset
|
951 | YahooGetInfoStepTwoData *info2_data = _info2_data; |
|
27959
f842ae57da4e
Move from "struct yahoo_data" to "YahooData" to be consistent with other structs
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
27555
diff
changeset
|
952 | YahooData *yd; |
| 9242 | 953 | gboolean found = FALSE; |
| 954 | int id = -1; | |
| 955 | ||
| 956 | /* Temporary variables */ | |
| 957 | char *p = NULL; | |
| 958 | char *stripped; | |
| 959 | int stripped_len; | |
| 960 | char *last_updated_utf8_string = NULL; | |
|
15205
f642029b2f97
[gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents:
14751
diff
changeset
|
961 | char *tmp; |
| 9242 | 962 | |
| 963 | /* Unmarshall the saved state */ | |
| 964 | YahooGetInfoData *info_data = info2_data->info_data; | |
| 965 | char *url_buffer = info2_data->url_buffer; | |
| 15884 | 966 | PurpleNotifyUserInfo *user_info = info2_data->user_info; |
| 9242 | 967 | char *photo_url_text = info2_data->photo_url_text; |
| 968 | char *profile_url_text = info2_data->profile_url_text; | |
| 969 | const profile_strings_node_t *strings = info2_data->strings; | |
| 970 | const char *last_updated_string = info2_data->last_updated_string; | |
| 9510 | 971 | profile_state_t profile_state = info2_data->profile_state; |
| 9242 | 972 | |
| 973 | /* We continue here from yahoo_got_info, as if nothing has happened */ | |
| 974 | #endif /* PHOTO_SUPPORT */ | |
| 9162 | 975 | |
|
11045
722a562fedeb
[gaim-migrate @ 12961]
Joshua Honeycutt <coweater@users.sourceforge.net>
parents:
10604
diff
changeset
|
976 | /* Jun 29 05 Bleeter: Y! changed their profile pages. Terminators now seem to be */ |
|
722a562fedeb
[gaim-migrate @ 12961]
Joshua Honeycutt <coweater@users.sourceforge.net>
parents:
10604
diff
changeset
|
977 | /* </dd> and not \n. The prpl's need to be audited before it can be moved */ |
| 15884 | 978 | /* in to purple_markup_strip_html*/ |
|
11045
722a562fedeb
[gaim-migrate @ 12961]
Joshua Honeycutt <coweater@users.sourceforge.net>
parents:
10604
diff
changeset
|
979 | char *fudged_buffer; |
|
14416
c95ffd983a39
[gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
980 | |
|
32280
704f84f692f6
Convert yahoo prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data()
Andrew Victor <andrew.victor@mxit.com>
parents:
32191
diff
changeset
|
981 | yd = purple_connection_get_protocol_data(info_data->gc); |
|
14416
c95ffd983a39
[gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
982 | |
| 15884 | 983 | fudged_buffer = purple_strcasereplace(url_buffer, "</dd>", "</dd><br>"); |
| 9162 | 984 | /* nuke the html, it's easier than trying to parse the horrid stuff */ |
| 15884 | 985 | stripped = purple_markup_strip_html(fudged_buffer); |
| 9162 | 986 | stripped_len = strlen(stripped); |
| 987 | ||
| 15884 | 988 | purple_debug_misc("yahoo", "stripped = %p\n", stripped); |
| 989 | purple_debug_misc("yahoo", "url_buffer = %p\n", url_buffer); | |
| 9162 | 990 | |
| 991 | /* convert to utf8 */ | |
|
23081
237c6a00d64d
Presumably this is what was intended.
Daniel Atallah <datallah@pidgin.im>
parents:
22622
diff
changeset
|
992 | if (strings && strings->charset) { |
| 9510 | 993 | p = g_convert(stripped, -1, "utf-8", strings->charset, |
| 994 | NULL, NULL, NULL); | |
| 9162 | 995 | if (!p) { |
| 9510 | 996 | p = g_locale_to_utf8(stripped, -1, NULL, NULL, NULL); |
| 997 | if (!p) { | |
| 998 | p = g_convert(stripped, -1, "utf-8", "windows-1252", | |
| 999 | NULL, NULL, NULL); | |
| 1000 | } | |
| 1001 | } | |
| 1002 | if (p) { | |
| 1003 | g_free(stripped); | |
| 15884 | 1004 | stripped = purple_utf8_ncr_decode(p); |
| 9510 | 1005 | stripped_len = strlen(stripped); |
| 1006 | g_free(p); | |
| 9162 | 1007 | } |
| 1008 | } | |
| 9510 | 1009 | p = NULL; |
| 9162 | 1010 | |
| 1011 | /* "Last updated" should also be converted to utf8 and with killed */ | |
|
23081
237c6a00d64d
Presumably this is what was intended.
Daniel Atallah <datallah@pidgin.im>
parents:
22622
diff
changeset
|
1012 | if (strings && strings->charset) { |
| 9510 | 1013 | last_updated_utf8_string = g_convert(last_updated_string, -1, "utf-8", |
| 1014 | strings->charset, NULL, NULL, NULL); | |
| 1015 | yahoo_remove_nonbreaking_spaces(last_updated_utf8_string); | |
| 9162 | 1016 | |
| 15884 | 1017 | purple_debug_misc("yahoo", "after utf8 conversion: stripped = (%s)\n", stripped); |
| 9510 | 1018 | } |
| 9162 | 1019 | |
| 9510 | 1020 | if (profile_state == PROFILE_STATE_DEFAULT) { |
| 9242 | 1021 | #if 0 |
| 9162 | 1022 | /* extract their Yahoo! ID and put it in. Don't bother marking has_info as |
| 1023 | * true, since the Yahoo! ID will always be there */ | |
| 15884 | 1024 | if (!purple_markup_extract_info_field(stripped, stripped_len, user_info, |
|
15666
0496c3ffe602
Patch 1638469, which fixes 1467348: Yahoo Japan profiles are now retrieved properly
Evan Schoenberg <evands@pidgin.im>
parents:
15435
diff
changeset
|
1025 | strings->yahoo_id_string, (yd->jp ? 2 : 10), "\n", 0, |
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
12970
diff
changeset
|
1026 | NULL, _("Yahoo! ID"), 0, NULL, NULL)) |
| 9242 | 1027 | ; |
| 1028 | #endif | |
| 1029 | ||
| 1030 | #if PHOTO_SUPPORT | |
| 1031 | /* Try to put the photo in there too, if there's one and is readable */ | |
|
34227
6d016a081401
HTTP: migrate purple_util_fetch_url to new API for prpls
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33774
diff
changeset
|
1032 | if (purple_http_response_is_successfull(response)) { |
|
6d016a081401
HTTP: migrate purple_util_fetch_url to new API for prpls
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33774
diff
changeset
|
1033 | const gchar *data; |
|
6d016a081401
HTTP: migrate purple_util_fetch_url to new API for prpls
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33774
diff
changeset
|
1034 | size_t len; |
|
6d016a081401
HTTP: migrate purple_util_fetch_url to new API for prpls
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33774
diff
changeset
|
1035 | |
|
6d016a081401
HTTP: migrate purple_util_fetch_url to new API for prpls
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33774
diff
changeset
|
1036 | data = purple_http_response_get_data(response, &len); |
| 9242 | 1037 | |
|
34227
6d016a081401
HTTP: migrate purple_util_fetch_url to new API for prpls
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33774
diff
changeset
|
1038 | purple_debug_info("yahoo", "%s is %" G_GSIZE_FORMAT " bytes\n", |
|
6d016a081401
HTTP: migrate purple_util_fetch_url to new API for prpls
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33774
diff
changeset
|
1039 | photo_url_text, len); |
|
6d016a081401
HTTP: migrate purple_util_fetch_url to new API for prpls
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33774
diff
changeset
|
1040 | id = purple_imgstore_new_with_id(g_memdup(data, len), len, |
|
6d016a081401
HTTP: migrate purple_util_fetch_url to new API for prpls
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33774
diff
changeset
|
1041 | NULL); |
|
27335
06a805d4e690
Strip trailing whitespace and comment #endif marcos that close #ifdef macros
Mark Doliner <markdoliner@pidgin.im>
parents:
25119
diff
changeset
|
1042 | |
|
34227
6d016a081401
HTTP: migrate purple_util_fetch_url to new API for prpls
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33774
diff
changeset
|
1043 | tmp = g_strdup_printf("<img id=\"" PURPLE_STORED_IMAGE_PROTOCOL |
|
6d016a081401
HTTP: migrate purple_util_fetch_url to new API for prpls
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33774
diff
changeset
|
1044 | "%d\"><br>", id); |
|
6d016a081401
HTTP: migrate purple_util_fetch_url to new API for prpls
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33774
diff
changeset
|
1045 | purple_notify_user_info_add_pair_html(user_info, NULL, tmp); |
|
6d016a081401
HTTP: migrate purple_util_fetch_url to new API for prpls
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33774
diff
changeset
|
1046 | g_free(tmp); |
| 9220 | 1047 | } |
| 9242 | 1048 | #endif /* PHOTO_SUPPORT */ |
| 1049 | ||
| 9162 | 1050 | /* extract their Email address and put it in */ |
| 15884 | 1051 | found |= purple_markup_extract_info_field(stripped, stripped_len, user_info, |
|
15666
0496c3ffe602
Patch 1638469, which fixes 1467348: Yahoo Japan profiles are now retrieved properly
Evan Schoenberg <evands@pidgin.im>
parents:
15435
diff
changeset
|
1052 | strings->my_email_string, (yd->jp ? 4 : 1), " ", 0, |
|
23325
a374a26fe217
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@pidgin.im>
parents:
23156
diff
changeset
|
1053 | strings->private_string, _("Email"), 0, NULL, NULL); |
| 9162 | 1054 | |
| 1055 | /* extract the Nickname if it exists */ | |
| 15884 | 1056 | found |= purple_markup_extract_info_field(stripped, stripped_len, user_info, |
| 9242 | 1057 | "Nickname:", 1, "\n", '\n', |
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
12970
diff
changeset
|
1058 | NULL, _("Nickname"), 0, NULL, NULL); |
| 9162 | 1059 | |
| 1060 | /* extract their RealName and put it in */ | |
| 15884 | 1061 | found |= purple_markup_extract_info_field(stripped, stripped_len, user_info, |
|
15666
0496c3ffe602
Patch 1638469, which fixes 1467348: Yahoo Japan profiles are now retrieved properly
Evan Schoenberg <evands@pidgin.im>
parents:
15435
diff
changeset
|
1062 | strings->realname_string, (yd->jp ? 3 : 1), "\n", '\n', |
|
13546
0700f0c29e14
[gaim-migrate @ 15922]
Richard Laager <rlaager@pidgin.im>
parents:
13499
diff
changeset
|
1063 | NULL, _("Real Name"), 0, NULL, NULL); |
| 9162 | 1064 | |
| 1065 | /* extract their Location and put it in */ | |
| 15884 | 1066 | found |= purple_markup_extract_info_field(stripped, stripped_len, user_info, |
|
15666
0496c3ffe602
Patch 1638469, which fixes 1467348: Yahoo Japan profiles are now retrieved properly
Evan Schoenberg <evands@pidgin.im>
parents:
15435
diff
changeset
|
1067 | strings->location_string, (yd->jp ? 4 : 2), "\n", '\n', |
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
12970
diff
changeset
|
1068 | NULL, _("Location"), 0, NULL, NULL); |
| 9162 | 1069 | |
| 1070 | /* extract their Age and put it in */ | |
| 15884 | 1071 | found |= purple_markup_extract_info_field(stripped, stripped_len, user_info, |
|
15666
0496c3ffe602
Patch 1638469, which fixes 1467348: Yahoo Japan profiles are now retrieved properly
Evan Schoenberg <evands@pidgin.im>
parents:
15435
diff
changeset
|
1072 | strings->age_string, (yd->jp ? 2 : 3), "\n", '\n', |
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
12970
diff
changeset
|
1073 | NULL, _("Age"), 0, NULL, NULL); |
| 9162 | 1074 | |
| 1075 | /* extract their MaritalStatus and put it in */ | |
| 15884 | 1076 | found |= purple_markup_extract_info_field(stripped, stripped_len, user_info, |
|
15666
0496c3ffe602
Patch 1638469, which fixes 1467348: Yahoo Japan profiles are now retrieved properly
Evan Schoenberg <evands@pidgin.im>
parents:
15435
diff
changeset
|
1077 | strings->maritalstatus_string, (yd->jp ? 2 : 3), "\n", '\n', |
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
12970
diff
changeset
|
1078 | strings->no_answer_string, _("Marital Status"), 0, NULL, NULL); |
| 9162 | 1079 | |
| 1080 | /* extract their Gender and put it in */ | |
| 15884 | 1081 | found |= purple_markup_extract_info_field(stripped, stripped_len, user_info, |
|
15666
0496c3ffe602
Patch 1638469, which fixes 1467348: Yahoo Japan profiles are now retrieved properly
Evan Schoenberg <evands@pidgin.im>
parents:
15435
diff
changeset
|
1082 | strings->gender_string, (yd->jp ? 2 : 3), "\n", '\n', |
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
12970
diff
changeset
|
1083 | strings->no_answer_string, _("Gender"), 0, NULL, NULL); |
| 9162 | 1084 | |
| 1085 | /* extract their Occupation and put it in */ | |
| 15884 | 1086 | found |= purple_markup_extract_info_field(stripped, stripped_len, user_info, |
| 9242 | 1087 | strings->occupation_string, 2, "\n", '\n', |
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
12970
diff
changeset
|
1088 | NULL, _("Occupation"), 0, NULL, NULL); |
| 9162 | 1089 | |
| 9242 | 1090 | /* Hobbies, Latest News, and Favorite Quote are a bit different, since |
| 1091 | * the values can contain embedded newlines... but any or all of them | |
| 1092 | * can also not appear. The way we delimit them is to successively | |
| 1093 | * look for the next one that _could_ appear, and if all else fails, | |
| 1094 | * we end the section by looking for the 'Links' heading, which is the | |
| 1095 | * next thing to follow this bunch. (For Yahoo Japan, we check for | |
| 1096 | * the "Description" ("Self PR") heading instead of "Links".) | |
| 9162 | 1097 | */ |
| 1098 | ||
| 15884 | 1099 | if (!purple_markup_extract_info_field(stripped, stripped_len, user_info, |
|
15666
0496c3ffe602
Patch 1638469, which fixes 1467348: Yahoo Japan profiles are now retrieved properly
Evan Schoenberg <evands@pidgin.im>
parents:
15435
diff
changeset
|
1100 | strings->hobbies_string, (yd->jp ? 3 : 1), strings->latest_news_string, |
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
12970
diff
changeset
|
1101 | '\n', "\n", _("Hobbies"), 0, NULL, NULL)) |
| 9162 | 1102 | { |
| 15884 | 1103 | if (!purple_markup_extract_info_field(stripped, stripped_len, user_info, |
| 9242 | 1104 | strings->hobbies_string, 1, strings->favorite_quote_string, |
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
12970
diff
changeset
|
1105 | '\n', "\n", _("Hobbies"), 0, NULL, NULL)) |
| 9162 | 1106 | { |
| 15884 | 1107 | found |= purple_markup_extract_info_field(stripped, stripped_len, user_info, |
| 9242 | 1108 | strings->hobbies_string, 1, strings->links_string, |
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
12970
diff
changeset
|
1109 | '\n', "\n", _("Hobbies"), 0, NULL, NULL); |
| 9162 | 1110 | } |
| 1111 | else | |
| 1112 | found = TRUE; | |
| 1113 | } | |
| 1114 | else | |
| 1115 | found = TRUE; | |
| 1116 | ||
| 15884 | 1117 | if (!purple_markup_extract_info_field(stripped, stripped_len, user_info, |
| 9242 | 1118 | strings->latest_news_string, 1, strings->favorite_quote_string, |
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
12970
diff
changeset
|
1119 | '\n', "\n", _("Latest News"), 0, NULL, NULL)) |
| 9162 | 1120 | { |
| 15884 | 1121 | found |= purple_markup_extract_info_field(stripped, stripped_len, user_info, |
|
15666
0496c3ffe602
Patch 1638469, which fixes 1467348: Yahoo Japan profiles are now retrieved properly
Evan Schoenberg <evands@pidgin.im>
parents:
15435
diff
changeset
|
1122 | strings->latest_news_string, (yd->jp ? 2 : 1), strings->links_string, |
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
12970
diff
changeset
|
1123 | '\n', "\n", _("Latest News"), 0, NULL, NULL); |
| 9162 | 1124 | } |
| 1125 | else | |
| 1126 | found = TRUE; | |
| 1127 | ||
| 15884 | 1128 | found |= purple_markup_extract_info_field(stripped, stripped_len, user_info, |
| 9242 | 1129 | strings->favorite_quote_string, 1, strings->links_string, |
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
12970
diff
changeset
|
1130 | '\n', "\n", _("Favorite Quote"), 0, NULL, NULL); |
| 9162 | 1131 | |
| 1132 | /* Home Page will either be "No home page specified", | |
| 1133 | * or "Home Page: " and a link. | |
| 9242 | 1134 | * For Yahoo! Japan, if there is no home page specified, |
| 1135 | * neither "No home page specified" nor "Home Page:" is shown. | |
| 9162 | 1136 | */ |
| 9242 | 1137 | if (strings->home_page_string) { |
| 1138 | p = !strings->no_home_page_specified_string? NULL: | |
| 1139 | strstr(stripped, strings->no_home_page_specified_string); | |
| 9162 | 1140 | if(!p) |
| 1141 | { | |
| 15884 | 1142 | found |= purple_markup_extract_info_field(stripped, stripped_len, user_info, |
| 9242 | 1143 | strings->home_page_string, 1, "\n", 0, NULL, |
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
12970
diff
changeset
|
1144 | _("Home Page"), 1, NULL, NULL); |
| 9162 | 1145 | } |
| 1146 | } | |
| 1147 | ||
| 9242 | 1148 | /* Cool Link {1,2,3} is also different. If "No cool link specified" |
| 1149 | * exists, then we have none. If we have one however, we'll need to | |
| 1150 | * check and see if we have a second one. If we have a second one, | |
| 1151 | * we have to check to see if we have a third one. | |
| 9162 | 1152 | */ |
| 9242 | 1153 | p = !strings->no_cool_link_specified_string? NULL: |
| 1154 | strstr(stripped,strings->no_cool_link_specified_string); | |
| 9162 | 1155 | if (!p) |
| 1156 | { | |
| 15884 | 1157 | if (purple_markup_extract_info_field(stripped, stripped_len, user_info, |
| 9242 | 1158 | strings->cool_link_1_string, 1, "\n", 0, NULL, |
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
12970
diff
changeset
|
1159 | _("Cool Link 1"), 1, NULL, NULL)) |
| 9162 | 1160 | { |
| 1161 | found = TRUE; | |
| 15884 | 1162 | if (purple_markup_extract_info_field(stripped, stripped_len, user_info, |
| 9242 | 1163 | strings->cool_link_2_string, 1, "\n", 0, NULL, |
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
12970
diff
changeset
|
1164 | _("Cool Link 2"), 1, NULL, NULL)) |
| 9242 | 1165 | { |
| 15884 | 1166 | purple_markup_extract_info_field(stripped, stripped_len, user_info, |
| 9242 | 1167 | strings->cool_link_3_string, 1, "\n", 0, NULL, |
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
12970
diff
changeset
|
1168 | _("Cool Link 3"), 1, NULL, NULL); |
| 9242 | 1169 | } |
| 9162 | 1170 | } |
| 1171 | } | |
| 1172 | ||
|
14751
7be9261cb83b
[gaim-migrate @ 17441]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
14416
diff
changeset
|
1173 | if (last_updated_utf8_string != NULL) { |
|
7be9261cb83b
[gaim-migrate @ 17441]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
14416
diff
changeset
|
1174 | /* see if Member Since is there, and if so, extract it. */ |
| 15884 | 1175 | found |= purple_markup_extract_info_field(stripped, stripped_len, user_info, |
|
14751
7be9261cb83b
[gaim-migrate @ 17441]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
14416
diff
changeset
|
1176 | "Member Since:", 1, last_updated_utf8_string, |
|
7be9261cb83b
[gaim-migrate @ 17441]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
14416
diff
changeset
|
1177 | '\n', NULL, _("Member Since"), 0, NULL, yahoo_info_date_reformat); |
| 9162 | 1178 | |
|
14751
7be9261cb83b
[gaim-migrate @ 17441]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
14416
diff
changeset
|
1179 | /* extract the Last Updated date and put it in */ |
| 15884 | 1180 | found |= purple_markup_extract_info_field(stripped, stripped_len, user_info, |
|
15666
0496c3ffe602
Patch 1638469, which fixes 1467348: Yahoo Japan profiles are now retrieved properly
Evan Schoenberg <evands@pidgin.im>
parents:
15435
diff
changeset
|
1181 | last_updated_utf8_string, (yd->jp ? 2 : 1), (yd->jp ? "\n" : " "), (yd->jp ? 0 : '\n'), NULL, |
|
0496c3ffe602
Patch 1638469, which fixes 1467348: Yahoo Japan profiles are now retrieved properly
Evan Schoenberg <evands@pidgin.im>
parents:
15435
diff
changeset
|
1182 | _("Last Update"), 0, NULL, (yd->jp ? NULL : yahoo_info_date_reformat)); |
|
14751
7be9261cb83b
[gaim-migrate @ 17441]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
14416
diff
changeset
|
1183 | } |
| 9510 | 1184 | } /* if (profile_state == PROFILE_STATE_DEFAULT) */ |
| 1185 | ||
| 1186 | if(!found) | |
| 1187 | { | |
|
25089
b381e7e2a1cf
Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <markdoliner@pidgin.im>
parents:
24181
diff
changeset
|
1188 | const gchar *str; |
|
15205
f642029b2f97
[gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents:
14751
diff
changeset
|
1189 | |
|
25089
b381e7e2a1cf
Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <markdoliner@pidgin.im>
parents:
24181
diff
changeset
|
1190 | purple_notify_user_info_add_section_break(user_info); |
|
32191
a4668d9dc8d1
Rename purple_notify_user_info_add_pair to
Mark Doliner <markdoliner@pidgin.im>
parents:
32162
diff
changeset
|
1191 | purple_notify_user_info_add_pair_html(user_info, |
|
25089
b381e7e2a1cf
Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <markdoliner@pidgin.im>
parents:
24181
diff
changeset
|
1192 | _("Error retrieving profile"), NULL); |
| 9510 | 1193 | |
| 1194 | if (profile_state == PROFILE_STATE_UNKNOWN_LANGUAGE) { | |
|
25089
b381e7e2a1cf
Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <markdoliner@pidgin.im>
parents:
24181
diff
changeset
|
1195 | str = _("This profile is in a language " |
|
b381e7e2a1cf
Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <markdoliner@pidgin.im>
parents:
24181
diff
changeset
|
1196 | "or format that is not supported at this time."); |
| 9510 | 1197 | |
| 1198 | } else if (profile_state == PROFILE_STATE_NOT_FOUND) { | |
| 15884 | 1199 | PurpleBuddy *b = purple_find_buddy |
| 1200 | (purple_connection_get_account(info_data->gc), | |
| 9510 | 1201 | info_data->name); |
| 1202 | YahooFriend *f = NULL; | |
| 1203 | if (b) { | |
| 1204 | /* Someone on the buddy list can be "not on server list", | |
| 1205 | * in which case the user may or may not actually exist. | |
| 1206 | * Hence this extra step. | |
| 1207 | */ | |
|
24398
4865c2ee6ea8
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24181
diff
changeset
|
1208 | PurpleAccount *account = purple_buddy_get_account(b); |
|
4865c2ee6ea8
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24181
diff
changeset
|
1209 | f = yahoo_friend_find(purple_account_get_connection(account), |
|
4865c2ee6ea8
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24181
diff
changeset
|
1210 | purple_buddy_get_name(b)); |
| 9510 | 1211 | } |
|
25089
b381e7e2a1cf
Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <markdoliner@pidgin.im>
parents:
24181
diff
changeset
|
1212 | str = f ? _("Could not retrieve the user's profile. " |
| 9510 | 1213 | "This most likely is a temporary server-side problem. " |
|
25089
b381e7e2a1cf
Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <markdoliner@pidgin.im>
parents:
24181
diff
changeset
|
1214 | "Please try again later.") : |
| 9510 | 1215 | _("Could not retrieve the user's profile. " |
| 1216 | "This most likely means that the user does not exist; " | |
| 1217 | "however, Yahoo! sometimes does fail to find a user's " | |
| 1218 | "profile. If you know that the user exists, " | |
|
25089
b381e7e2a1cf
Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <markdoliner@pidgin.im>
parents:
24181
diff
changeset
|
1219 | "please try again later."); |
| 9510 | 1220 | } else { |
|
25089
b381e7e2a1cf
Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <markdoliner@pidgin.im>
parents:
24181
diff
changeset
|
1221 | str = _("The user's profile is empty."); |
| 9510 | 1222 | } |
|
25089
b381e7e2a1cf
Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <markdoliner@pidgin.im>
parents:
24181
diff
changeset
|
1223 | |
|
32162
cf848cd25330
Use purple_notify_user_info_add_pair_plaintext in some places where we
Mark Doliner <markdoliner@pidgin.im>
parents:
30537
diff
changeset
|
1224 | purple_notify_user_info_add_pair_plaintext(user_info, NULL, str); |
| 9510 | 1225 | } |
| 1226 | ||
| 9220 | 1227 | /* put a link to the actual profile URL */ |
|
25089
b381e7e2a1cf
Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <markdoliner@pidgin.im>
parents:
24181
diff
changeset
|
1228 | purple_notify_user_info_add_section_break(user_info); |
|
b381e7e2a1cf
Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <markdoliner@pidgin.im>
parents:
24181
diff
changeset
|
1229 | tmp = g_strdup_printf("<a href=\"%s\">%s</a>", |
|
b381e7e2a1cf
Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <markdoliner@pidgin.im>
parents:
24181
diff
changeset
|
1230 | profile_url_text, _("View web profile")); |
|
32191
a4668d9dc8d1
Rename purple_notify_user_info_add_pair to
Mark Doliner <markdoliner@pidgin.im>
parents:
32162
diff
changeset
|
1231 | purple_notify_user_info_add_pair_html(user_info, NULL, tmp); |
|
15205
f642029b2f97
[gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents:
14751
diff
changeset
|
1232 | g_free(tmp); |
| 9220 | 1233 | |
| 9162 | 1234 | g_free(stripped); |
| 1235 | ||
| 9510 | 1236 | /* show it to the user */ |
| 15884 | 1237 | purple_notify_userinfo(info_data->gc, info_data->name, |
|
15205
f642029b2f97
[gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents:
14751
diff
changeset
|
1238 | user_info, NULL, NULL); |
| 15884 | 1239 | purple_notify_user_info_destroy(user_info); |
| 9162 | 1240 | |
| 1241 | g_free(last_updated_utf8_string); | |
| 1242 | g_free(url_buffer); | |
|
11045
722a562fedeb
[gaim-migrate @ 12961]
Joshua Honeycutt <coweater@users.sourceforge.net>
parents:
10604
diff
changeset
|
1243 | g_free(fudged_buffer); |
| 9242 | 1244 | g_free(profile_url_text); |
| 9162 | 1245 | g_free(info_data->name); |
| 1246 | g_free(info_data); | |
| 9242 | 1247 | |
| 1248 | #if PHOTO_SUPPORT | |
| 1249 | g_free(photo_url_text); | |
| 1250 | g_free(info2_data); | |
| 1251 | if (id != -1) | |
|
16437
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
1252 | purple_imgstore_unref_by_id(id); |
|
27335
06a805d4e690
Strip trailing whitespace and comment #endif marcos that close #ifdef macros
Mark Doliner <markdoliner@pidgin.im>
parents:
25119
diff
changeset
|
1253 | #endif /* PHOTO_SUPPORT */ |
| 9162 | 1254 | } |
| 1255 | ||
| 15884 | 1256 | void yahoo_get_info(PurpleConnection *gc, const char *name) |
| 9162 | 1257 | { |
|
32280
704f84f692f6
Convert yahoo prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data()
Andrew Victor <andrew.victor@mxit.com>
parents:
32191
diff
changeset
|
1258 | YahooData *yd = purple_connection_get_protocol_data(gc); |
| 9162 | 1259 | YahooGetInfoData *data; |
| 1260 | ||
| 1261 | data = g_new0(YahooGetInfoData, 1); | |
| 1262 | data->gc = gc; | |
| 1263 | data->name = g_strdup(name); | |
| 1264 | ||
|
34269
26b4c9a54166
HTTP: Use PurpleHttpConnectionSet instead of GSLists of PurpleHttpConnection structs
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34233
diff
changeset
|
1265 | purple_http_connection_set_add(yd->http_reqs, purple_http_get_printf(gc, |
|
26b4c9a54166
HTTP: Use PurpleHttpConnectionSet instead of GSLists of PurpleHttpConnection structs
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34233
diff
changeset
|
1266 | yahoo_got_info, data, "%s%s", |
|
26b4c9a54166
HTTP: Use PurpleHttpConnectionSet instead of GSLists of PurpleHttpConnection structs
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34233
diff
changeset
|
1267 | (yd->jp ? YAHOOJP_PROFILE_URL : YAHOO_PROFILE_URL), name)); |
| 9162 | 1268 | } |