9162
|
1 /*
|
|
2 * gaim
|
|
3 *
|
|
4 * Gaim is the legal property of its developers, whose names are too numerous
|
|
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
|
|
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
21 *
|
|
22 */
|
|
23
|
9242
|
24 #define PHOTO_SUPPORT 1
|
|
25
|
9162
|
26 #include "internal.h"
|
|
27 #include "debug.h"
|
|
28 #include "notify.h"
|
|
29 #include "util.h"
|
9242
|
30 #if PHOTO_SUPPORT
|
|
31 #include "imgstore.h"
|
|
32 #endif
|
9162
|
33
|
|
34 #include "yahoo.h"
|
|
35
|
|
36 typedef struct {
|
|
37 GaimConnection *gc;
|
|
38 char *name;
|
|
39 } YahooGetInfoData;
|
|
40
|
|
41
|
|
42 typedef enum profile_lang_id {
|
|
43 XX, DA, DE, EL,
|
|
44 EN, EN_GB,
|
|
45 ES_AR, ES_ES, ES_MX, ES_US,
|
|
46 FR_CA, FR_FR,
|
|
47 IT, JA, KO, NO, PT, SV,
|
|
48 ZH_CN, ZH_HK, ZH_TW, ZH_US
|
|
49 } profile_lang_id_t;
|
|
50
|
|
51 typedef struct profile_lang_node {
|
|
52 profile_lang_id_t lang;
|
|
53 char *last_updated_string;
|
|
54 char *det;
|
|
55 } profile_lang_node_t;
|
|
56
|
|
57 typedef struct profile_strings_node {
|
|
58 profile_lang_id_t lang;
|
|
59 char *lang_string; /* Only to make debugging output saner */
|
|
60 char *charset;
|
|
61 char *yahoo_id_string;
|
|
62 char *private_string;
|
|
63 char *no_answer_string;
|
|
64 char *my_email_string;
|
|
65 char *realname_string;
|
|
66 char *location_string;
|
|
67 char *age_string;
|
|
68 char *maritalstatus_string;
|
|
69 char *gender_string;
|
|
70 char *occupation_string;
|
|
71 char *hobbies_string;
|
|
72 char *latest_news_string;
|
|
73 char *favorite_quote_string;
|
|
74 char *links_string;
|
|
75 char *no_home_page_specified_string;
|
|
76 char *home_page_string;
|
|
77 char *no_cool_link_specified_string;
|
|
78 char *cool_link_1_string;
|
|
79 char *cool_link_2_string;
|
|
80 char *cool_link_3_string;
|
|
81 char *dummy;
|
|
82 } profile_strings_node_t;
|
|
83
|
9242
|
84
|
|
85 typedef struct {
|
|
86 YahooGetInfoData *info_data;
|
|
87 char *url_buffer;
|
|
88 GString *s;
|
|
89 char *photo_url_text;
|
|
90 char *profile_url_text;
|
|
91 char *tooltip_text;
|
|
92 const profile_strings_node_t *strings;
|
|
93 const char *last_updated_string;
|
|
94 } YahooGetInfoStepTwoData;
|
|
95
|
|
96
|
9162
|
97 /* Strings to determine the profile "language" (more accurately "locale").
|
|
98 * Strings in this list must be in the original charset in the profile.
|
|
99 * The "Last Updated" string is used, but sometimes is not sufficient to
|
|
100 * distinguish 2 locales with this (e.g., ES_ES from ES_US, or FR_CA from
|
|
101 * FR_FR, or EL from EN_GB), in which case a second string is added and
|
|
102 * such special cases must be placed before the more general case.
|
|
103 */
|
|
104 static const profile_lang_node_t profile_langs[] = {
|
|
105 { DA, "Opdateret sidste gang ", NULL },
|
|
106 { DE, "Letzter Update ", NULL },
|
|
107 { EL, "Last Updated:", "http://gr.profiles.yahoo.com" },
|
|
108 { EN_GB, "Last Updated ", "Favourite Quote" },
|
|
109 { EN, "Last Updated:", NULL },
|
|
110 { EN, "Last Updated ", NULL },
|
|
111 { ES_AR, "\332ltima actualizaci\363n ", NULL },
|
|
112 { ES_ES, "Actualizada el ", "http://es.profiles.yahoo.com" },
|
|
113 { ES_MX, "Actualizada el ", "http://mx.profiles.yahoo.com" },
|
|
114 { ES_US, "Actualizada el ", NULL },
|
|
115 { FR_CA, "Derni\xe8re mise \xe0 jour", "http://cf.profiles.yahoo.com" },
|
|
116 { FR_FR, "Derni\xe8re mise \xe0 jour", NULL },
|
|
117 { IT, "Ultimo aggiornamento ", NULL },
|
|
118 { JA, "\xba\xc7\xbd\xaa\xb9\xb9\xbf\xb7\xc6\xfc\xa1\xa7", NULL },
|
|
119 { KO, "\xb0\xbb\xbd\xc5\x20\xb3\xaf\xc2\xa5 ", NULL },
|
|
120 { NO, "Sist oppdatert ", NULL },
|
|
121 { PT, "\332ltima atualiza\347\343o ", NULL },
|
|
122 { SV, "Senast uppdaterad ", NULL },
|
|
123 { ZH_CN, "\xd7\xee\xba\xf3\xd0\xde\xb8\xc4\xc8\xd5\xc6\xda", NULL },
|
|
124 { ZH_HK, "\xb3\xcc\xaa\xf1\xa7\xf3\xb7\x73\xae\xc9\xb6\xa1", NULL },
|
|
125 { ZH_US, "\xb3\xcc\xab\xe1\xad\xd7\xa7\xef\xa4\xe9\xb4\xc1", "http://chinese.profiles.yahoo.com" },
|
|
126 { ZH_TW, "\xb3\xcc\xab\xe1\xad\xd7\xa7\xef\xa4\xe9\xb4\xc1", NULL },
|
|
127 { XX, NULL, NULL }
|
|
128 };
|
|
129
|
|
130 /* Strings in this list must be in UTF-8; 's should be specified as spaces. */
|
|
131 static const profile_strings_node_t profile_strings[] = {
|
|
132 { DA, "da", "ISO-8859-1",
|
|
133 "Yahoo! ID:",
|
|
134 "Privat",
|
|
135 "Intet svar",
|
|
136 "Min Email",
|
|
137 "Rigtige navn:",
|
|
138 "Opholdssted:",
|
|
139 "Alder:",
|
|
140 "Ægteskabelig status:",
|
|
141 "Køn:",
|
|
142 "Erhverv:",
|
|
143 "Hobbyer:",
|
|
144 "Sidste nyt:",
|
|
145 "Favoritcitat",
|
|
146 "Links",
|
|
147 "Ingen hjemmeside specificeret",
|
|
148 "Forside:",
|
|
149 "Intet cool link specificeret",
|
|
150 "Cool link 1:",
|
|
151 "Cool link 2:",
|
|
152 "Cool link 3:",
|
|
153 NULL
|
|
154 },
|
|
155 { DE, "de", "ISO-8859-1",
|
|
156 "Yahoo!-ID:",
|
|
157 "Privat",
|
|
158 "Keine Antwort",
|
|
159 "Meine E-Mail",
|
|
160 "Realer Name:",
|
|
161 "Ort:",
|
|
162 "Alter:",
|
|
163 "Familienstand:",
|
|
164 "Geschlecht:",
|
|
165 "Beruf:",
|
|
166 "Hobbys:",
|
|
167 "Neuste Nachrichten:",
|
|
168 "Mein Lieblingsspruch",
|
|
169 "Links",
|
|
170 "Keine Homepage angegeben",
|
|
171 "Homepage:",
|
|
172 "Keinen coolen Link angegeben",
|
|
173 "Cooler Link 1:",
|
|
174 "Cooler Link 2:",
|
|
175 "Cooler Link 3:",
|
|
176 NULL
|
|
177 },
|
|
178 { EL, "el", "ISO-8859-7", /* EL is identical to EN, except no_answer_string */
|
|
179 "Yahoo! ID:",
|
|
180 "Private",
|
|
181 "Καμία απάντηση",
|
|
182 "My Email",
|
|
183 "Real Name:",
|
|
184 "Location:",
|
|
185 "Age:",
|
|
186 "Marital Status:",
|
|
187 "Gender:",
|
|
188 "Occupation:",
|
|
189 "Hobbies:",
|
|
190 "Latest News",
|
|
191 "Favorite Quote",
|
|
192 "Links",
|
|
193 "No home page specified",
|
|
194 "Home Page:",
|
|
195 "No cool link specified",
|
|
196 "Cool Link 1:",
|
|
197 "Cool Link 2:",
|
|
198 "Cool Link 3:",
|
|
199 NULL
|
|
200 },
|
|
201 { EN, "en", "ISO-8859-1",
|
|
202 "Yahoo! ID:",
|
|
203 "Private",
|
|
204 "No Answer",
|
|
205 "My Email",
|
|
206 "Real Name:",
|
|
207 "Location:",
|
|
208 "Age:",
|
|
209 "Marital Status:",
|
|
210 "Gender:",
|
|
211 "Occupation:",
|
|
212 "Hobbies:",
|
|
213 "Latest News",
|
|
214 "Favorite Quote",
|
|
215 "Links",
|
|
216 "No home page specified",
|
|
217 "Home Page:",
|
|
218 "No cool link specified",
|
|
219 "Cool Link 1:",
|
|
220 "Cool Link 2:",
|
|
221 "Cool Link 3:",
|
|
222 NULL
|
|
223 },
|
|
224 { EN_GB, "en_GB", "ISO-8859-1", /* Same as EN except spelling of "Favourite" */
|
|
225 "Yahoo! ID:",
|
|
226 "Private",
|
|
227 "No Answer",
|
|
228 "My Email",
|
|
229 "Real Name:",
|
|
230 "Location:",
|
|
231 "Age:",
|
|
232 "Marital Status:",
|
|
233 "Gender:",
|
|
234 "Occupation:",
|
|
235 "Hobbies:",
|
|
236 "Latest News",
|
|
237 "Favourite Quote",
|
|
238 "Links",
|
|
239 "No home page specified",
|
|
240 "Home Page:",
|
|
241 "No cool link specified",
|
|
242 "Cool Link 1:",
|
|
243 "Cool Link 2:",
|
|
244 "Cool Link 3:",
|
|
245 NULL
|
|
246 },
|
|
247 { ES_AR, "es_AR", "ISO-8859-1",
|
|
248 "Usuario de Yahoo!:",
|
|
249 "Privado",
|
|
250 "No introdujiste una respuesta",
|
|
251 "Mi dirección de correo electrónico",
|
|
252 "Nombre real:",
|
|
253 "Ubicación:",
|
|
254 "Edad:",
|
|
255 "Estado civil:",
|
|
256 "Sexo:",
|
|
257 "Ocupación:",
|
|
258 "Pasatiempos:",
|
|
259 "Últimas noticias:",
|
|
260 "Tu cita favorita",
|
|
261 "Enlaces",
|
|
262 "Ninguna página de inicio especificada",
|
|
263 "Página de inicio:",
|
|
264 "Ningún enlace preferido",
|
|
265 "Enlace genial 1:",
|
|
266 "Enlace genial 2:",
|
|
267 "Enlace genial 3:",
|
|
268 NULL
|
|
269 },
|
|
270 { ES_ES, "es_ES", "ISO-8859-1",
|
|
271 "ID de Yahoo!:",
|
|
272 "Privado",
|
|
273 "Sin respuesta",
|
|
274 "Mi correo-e",
|
|
275 "Nombre verdadero:",
|
|
276 "Lugar:",
|
|
277 "Edad:",
|
|
278 "Estado civil:",
|
|
279 "Sexo:",
|
|
280 "Ocupación:",
|
|
281 "Aficiones:",
|
|
282 "Ultimas Noticias:",
|
|
283 "Tu cita Favorita",
|
|
284 "Enlace",
|
|
285 "Ninguna página personal especificada",
|
|
286 "Página de Inicio:",
|
|
287 "Ningún enlace preferido",
|
|
288 "Enlaces Preferidos 1:",
|
|
289 "Enlaces Preferidos 2:",
|
|
290 "Enlaces Preferidos 3:",
|
|
291 NULL
|
|
292 },
|
|
293 { ES_MX, "es_MX", "ISO-8859-1",
|
|
294 "ID de Yahoo!:",
|
|
295 "Privado",
|
|
296 "Sin responder",
|
|
297 "Mi Dirección de correo-e",
|
|
298 "Nombre real:",
|
|
299 "Ubicación:",
|
|
300 "Edad:",
|
|
301 "Estado civil:",
|
|
302 "Sexo:",
|
|
303 "Ocupación:",
|
|
304 "Pasatiempos:",
|
|
305 "Ultimas Noticias:",
|
|
306 "Su cita favorita",
|
|
307 "Enlaces",
|
|
308 "Ninguna Página predefinida",
|
|
309 "Página web:",
|
|
310 "Ningún Enlace preferido",
|
|
311 "Enlaces Preferidos 1:",
|
|
312 "Enlaces Preferidos 2:",
|
|
313 "Enlaces Preferidos 3:",
|
|
314 NULL
|
|
315 },
|
|
316 { ES_US, "es_US", "ISO-8859-1",
|
|
317 "ID de Yahoo!:",
|
|
318 "Privado",
|
|
319 "No introdujo una respuesta",
|
|
320 "Mi Dirección de correo-e",
|
|
321 "Nombre real:",
|
|
322 "Localidad:",
|
|
323 "Edad:",
|
|
324 "Estado civil:",
|
|
325 "Sexo:",
|
|
326 "Ocupación:",
|
|
327 "Pasatiempos:",
|
|
328 "Ultimas Noticias:",
|
|
329 "Su cita Favorita",
|
|
330 "Enlaces",
|
|
331 "Ninguna Página de inicio predefinida",
|
|
332 "Página de inicio:",
|
|
333 "Ningún Enlace preferido",
|
|
334 "Enlaces Preferidos 1:",
|
|
335 "Enlaces Preferidos 2:",
|
|
336 "Enlaces Preferidos 3:",
|
|
337 NULL
|
|
338 },
|
|
339 { FR_CA, "fr_CA", "ISO-8859-1",
|
|
340 "Compte Yahoo!:",
|
|
341 "Privé",
|
|
342 "Sans réponse",
|
|
343 "Mon courriel",
|
|
344 "Nom réel:",
|
|
345 "Lieu:",
|
|
346 "Âge:",
|
|
347 "État civil:",
|
|
348 "Sexe:",
|
|
349 "Profession:",
|
|
350 "Passe-temps:",
|
|
351 "Actualités:",
|
|
352 "Citation préférée",
|
|
353 "Liens",
|
|
354 "Pas de mention d'une page personnelle",
|
|
355 "Page personnelle:",
|
|
356 "Pas de mention d'un lien favori",
|
|
357 "Lien préféré 1:",
|
|
358 "Lien préféré 2:",
|
|
359 "Lien préféré 3:",
|
|
360 NULL
|
|
361 },
|
|
362 { FR_FR, "fr_FR", "ISO-8859-1",
|
|
363 "Compte Yahoo!:",
|
|
364 "Privé",
|
|
365 "Sans réponse",
|
|
366 "Mon E-mail",
|
|
367 "Nom réel:",
|
|
368 "Lieu:",
|
|
369 "Âge:",
|
|
370 "Situation de famille:",
|
|
371 "Sexe:",
|
|
372 "Profession:",
|
|
373 "Centres d'intérêts:",
|
|
374 "Actualités:",
|
|
375 "Citation préférée",
|
|
376 "Liens",
|
|
377 "Pas de mention d'une page perso",
|
|
378 "Page perso:",
|
|
379 "Pas de mention d'un lien favori",
|
|
380 "Lien préféré 1:",
|
|
381 "Lien préféré 2:",
|
|
382 "Lien préféré 3:",
|
|
383 NULL
|
|
384 },
|
|
385 { IT, "it", "ISO-8859-1",
|
|
386 "ID Yahoo!:",
|
|
387 "Non pubblica",
|
|
388 "Nessuna risposta",
|
|
389 "La mia e-mail",
|
|
390 "Nome vero:",
|
|
391 "Località:",
|
|
392 "Eta':",
|
|
393 "Stato civile:",
|
|
394 "Sesso:",
|
|
395 "Occupazione:",
|
|
396 "Hobby:",
|
|
397 "Ultime notizie:",
|
|
398 "Citazione preferita",
|
|
399 "Link",
|
|
400 "Nessuna home page specificata",
|
|
401 "Inizio:",
|
|
402 "Nessun link specificato",
|
|
403 "Link Preferiti 1:",
|
|
404 "Link Preferiti 2:",
|
|
405 "Link Preferiti 3:",
|
|
406 NULL
|
|
407 },
|
|
408 { JA, "ja", "EUC-JP",
|
|
409 "Yahoo! JAPAN ID:",
|
|
410 "非公開",
|
|
411 "無回答",
|
|
412 "メール:",
|
|
413 "名前:",
|
|
414 "住所:",
|
|
415 "年齢:",
|
|
416 "未婚/既婚:",
|
|
417 "性別:",
|
|
418 "職業:",
|
|
419 "趣味:",
|
|
420 "最近の出来事:",
|
|
421 NULL,
|
|
422 #if 0
|
|
423 "おすすめサイト",
|
|
424 #else
|
|
425 "自己PR", /* "Self description" comes before "Links" for yahoo.co.jp */
|
|
426 #endif
|
|
427 NULL,
|
|
428 NULL,
|
|
429 NULL,
|
|
430 "おすすめサイト1:",
|
|
431 "おすすめサイト2:",
|
|
432 "おすすめサイト3:",
|
|
433 NULL
|
|
434 },
|
|
435 { KO, "ko", "EUC-KR",
|
|
436 "야후! ID:",
|
|
437 "비공개",
|
|
438 "비공개",
|
|
439 "My Email",
|
|
440 "실명:",
|
|
441 "거주지:",
|
|
442 "나이:",
|
|
443 "결혼 여부:",
|
|
444 "성별:",
|
|
445 "직업:",
|
|
446 "취미:",
|
|
447 "자기 소개:",
|
|
448 "좋아하는 명언",
|
|
449 "링크",
|
|
450 "홈페이지를 지정하지 않았습니다.",
|
|
451 "홈페이지:",
|
|
452 "추천 사이트가 없습니다.",
|
|
453 "추천 사이트 1:",
|
|
454 "추천 사이트 2:",
|
|
455 "추천 사이트 3:",
|
|
456 NULL
|
|
457 },
|
|
458 { NO, "no", "ISO-8859-1",
|
|
459 "Yahoo! ID:",
|
|
460 "Privat",
|
|
461 "Ikke noe svar",
|
|
462 "Min e-post",
|
|
463 "Virkelig navn:",
|
|
464 "Sted:",
|
|
465 "Alder:",
|
|
466 "Sivilstatus:",
|
|
467 "Kjønn:",
|
|
468 "Yrke:",
|
|
469 "Hobbyer:",
|
|
470 "Siste nytt:",
|
|
471 "Yndlingssitat",
|
|
472 "Lenker",
|
|
473 "Ingen hjemmeside angitt",
|
|
474 "Hjemmeside:",
|
|
475 "No cool link specified",
|
|
476 "Bra lenke 1:",
|
|
477 "Bra lenke 2:",
|
|
478 "Bra lenke 3:",
|
|
479 NULL
|
|
480 },
|
|
481 { PT, "pt", "ISO-8859-1",
|
|
482 "ID Yahoo!:",
|
|
483 "Particular",
|
|
484 "Sem resposta",
|
|
485 "Meu e-mail",
|
|
486 "Nome verdadeiro:",
|
|
487 "Local:",
|
|
488 "Idade:",
|
|
489 "Estado civil:",
|
|
490 "Sexo:",
|
|
491 "Ocupação:",
|
|
492 "Hobbies:",
|
|
493 "Últimas notícias:",
|
|
494 "Frase favorita",
|
|
495 "Links",
|
|
496 "Nenhuma página pessoal especificada",
|
|
497 "Página pessoal:",
|
|
498 "Nenhum site legal especificado",
|
|
499 "Site legal 1:",
|
|
500 "Site legal 2:",
|
|
501 "Site legal 3:",
|
|
502 NULL
|
|
503 },
|
|
504 { SV, "sv", "ISO-8859-1",
|
|
505 "Yahoo!-ID:",
|
|
506 "Privat",
|
|
507 "Inget svar",
|
|
508 "Min mail",
|
|
509 "Riktigt namn:",
|
|
510 "Plats:",
|
|
511 "Ålder:",
|
|
512 "Civilstånd:",
|
|
513 "Kön:",
|
|
514 "Yrke:",
|
|
515 "Hobby:",
|
|
516 "Senaste nytt:",
|
|
517 "Favoritcitat",
|
|
518 "Länkar",
|
|
519 "Ingen hemsida specificerad",
|
|
520 "Hemsida:",
|
|
521 "Ingen cool länk specificerad",
|
|
522 "Coola länkar 1:",
|
|
523 "Coola länkar 2:",
|
|
524 "Coola länkar 3:",
|
|
525 NULL
|
|
526 },
|
|
527 { ZH_CN, "zh_CN", "GB2312",
|
|
528 "Yahoo! ID:",
|
|
529 "没有提供",
|
|
530 "没有回答",
|
|
531 "个人电邮地址",
|
|
532 "真实姓名:",
|
|
533 "所在地点:",
|
|
534 "年龄:",
|
|
535 "婚姻状况:",
|
|
536 "性别:",
|
|
537 "职业:",
|
|
538 "业余爱好:",
|
|
539 "个人近况:",
|
|
540 "喜欢的引言",
|
|
541 "链接",
|
|
542 "没有个人主页",
|
|
543 "个人主页:",
|
|
544 "没有推荐网站链接",
|
|
545 "推荐网站链接 1:",
|
|
546 "推荐网站链接 2:",
|
|
547 "推荐网站链接 3:",
|
|
548 NULL
|
|
549 },
|
|
550 { ZH_HK, "zh_HK", "Big5",
|
|
551 "Yahoo! ID:",
|
|
552 "私人的",
|
|
553 "沒有回答",
|
|
554 "電子信箱",
|
|
555 "真實姓名:",
|
|
556 "地點:",
|
|
557 "年齡:",
|
|
558 "婚姻狀況:",
|
|
559 "性別:",
|
|
560 "職業:",
|
|
561 "嗜好:",
|
|
562 "最新消息:",
|
|
563 "最喜愛的股票叫價", /* [sic] Yahoo!'s translators don't check context */
|
|
564 "連結",
|
|
565 "沒有注明個人網頁", /* [sic] */
|
|
566 "個人網頁:",
|
|
567 "沒有注明 Cool 連結", /* [sic] */
|
|
568 "Cool 連結 1:", /* TODO */
|
|
569 "Cool 連結 2:", /* TODO */
|
|
570 "Cool 連結 3:", /* TODO */
|
|
571 NULL
|
|
572 },
|
|
573 { ZH_TW, "zh_TW", "Big5",
|
|
574 "帳 號:",
|
|
575 "沒有提供",
|
|
576 "沒有回應",
|
|
577 "電子信箱",
|
|
578 "姓名:",
|
|
579 "地點:",
|
|
580 "年齡:",
|
|
581 "婚姻狀態:",
|
|
582 "性別:",
|
|
583 "職業:",
|
|
584 "興趣:",
|
|
585 "個人近況:",
|
|
586 "喜歡的名句",
|
|
587 "連結",
|
|
588 "沒有個人網頁",
|
|
589 "個人網頁:",
|
|
590 "沒有推薦網站連結",
|
|
591 "推薦網站連結 1:",
|
|
592 "推薦網站連結 2:",
|
|
593 "推薦網站連結 3:",
|
|
594 NULL
|
|
595 },
|
|
596 { ZH_US, "zh_US", "Big5", /* ZH_US is like ZH_TW, but also a bit like ZH_HK */
|
|
597 "Yahoo! ID:",
|
|
598 "沒有提供",
|
|
599 "沒有回答",
|
|
600 "個人Email地址",
|
|
601 "真實姓名:",
|
|
602 "地點:",
|
|
603 "年齡:",
|
|
604 "婚姻狀態:",
|
|
605 "性別:",
|
|
606 "職業:",
|
|
607 "嗜好:",
|
|
608 "個人近況:",
|
|
609 "喜歡的名句",
|
|
610 "連結",
|
|
611 "沒有個人網頁",
|
|
612 "個人網頁:",
|
|
613 "沒有推薦網站連結",
|
|
614 "推薦網站連結 1:", /* TODO */
|
|
615 "推薦網站連結 2:", /* TODO */
|
|
616 "推薦網站連結 3:", /* TODO */
|
|
617 NULL
|
|
618 },
|
|
619 { XX, NULL, NULL, NULL, NULL, NULL, NULL },
|
|
620 };
|
|
621
|
|
622 static char *yahoo_remove_nonbreaking_spaces(char *str)
|
|
623 {
|
|
624 char *p;
|
|
625 while ((p = strstr(str, " ")) != NULL) {
|
|
626 *p = ' '; /* Turn 's into ordinary blanks */
|
|
627 p += 1;
|
|
628 memmove(p, p + 5, strlen(p + 5));
|
|
629 str[strlen(str) - 5] = '\0';
|
|
630 }
|
|
631 return str;
|
|
632 }
|
|
633
|
9242
|
634 static char *yahoo_tooltip_info_text(YahooGetInfoData *info_data) {
|
|
635 GString *s = g_string_sized_new(80); /* wild guess */
|
|
636 GaimBuddy *b;
|
|
637
|
|
638 g_string_printf(s, _("<b>%s:</b> %s<br>"), _("Yahoo! ID"), info_data->name);
|
|
639 b = gaim_find_buddy(gaim_connection_get_account(info_data->gc),
|
|
640 info_data->name);
|
|
641
|
|
642 if (b) {
|
|
643 char *statustext = yahoo_tooltip_text(b);
|
|
644 if(b->alias && b->alias[0]) {
|
|
645 char *aliastext = g_markup_escape_text(b->alias, -1);
|
|
646 g_string_append_printf(s, _("<b>Alias:</b> %s<br>"), aliastext);
|
|
647 g_free(aliastext);
|
|
648 }
|
|
649 if (b->idle > 0) {
|
|
650 char *idletime = gaim_str_seconds_to_string(time(NULL) - b->idle);
|
|
651 g_string_append_printf(s, _("<b>%s:</b> %s<br>"), _("Idle"),
|
|
652 idletime);
|
|
653 g_free(idletime);
|
|
654 }
|
|
655 if (statustext) {
|
|
656 g_string_append_printf(s, "%s<br>", statustext);
|
|
657 g_free(statustext);
|
|
658 }
|
|
659 }
|
|
660
|
|
661 return g_string_free(s, FALSE);
|
|
662 }
|
|
663
|
|
664 #if PHOTO_SUPPORT
|
|
665
|
|
666 static char *yahoo_get_photo_url(const char *url_text, const char *name) {
|
|
667 GString *s = g_string_sized_new(strlen(name) + 8);
|
|
668 char *p;
|
|
669 char *it = NULL;
|
|
670
|
|
671 g_string_printf(s, " alt=\"%s\">", name);
|
|
672 p = strstr(url_text, s->str);
|
|
673
|
|
674 if (p) {
|
|
675 /* Search backwards for "http://". This is stupid, but it works. */
|
|
676 for (; !it && p > url_text; p -= 1) {
|
|
677 if (strncmp(p, "\"http://", 8) == 0) {
|
|
678 char *q;
|
|
679 p += 1; /* skip only the " */
|
|
680 q = strchr(p, '"');
|
|
681 if (q) {
|
|
682 it = g_strndup(p, q - p);
|
|
683 }
|
|
684 }
|
|
685 }
|
|
686 }
|
|
687
|
|
688 g_string_free(s, TRUE);
|
|
689 return it;
|
|
690 }
|
|
691
|
|
692 static void yahoo_got_photo(void *data, const char *url_text, size_t len);
|
|
693
|
|
694 #endif /* PHOTO_SUPPORT */
|
|
695
|
9162
|
696 static void yahoo_got_info(void *data, const char *url_text, size_t len)
|
|
697 {
|
|
698 YahooGetInfoData *info_data = (YahooGetInfoData *)data;
|
9242
|
699 char *p;
|
9162
|
700 char buf[1024];
|
9242
|
701 #if PHOTO_SUPPORT
|
|
702 YahooGetInfoStepTwoData *info2_data;
|
|
703 char *photo_url_text = NULL;
|
|
704 #else
|
9162
|
705 gboolean found = FALSE;
|
9242
|
706 char *stripped;
|
|
707 int stripped_len;
|
|
708 char *last_updated_utf8_string = NULL;
|
|
709 #endif
|
|
710 const char *last_updated_string = NULL;
|
9162
|
711 char *url_buffer;
|
|
712 GString *s;
|
9242
|
713 char *tooltip_text = NULL;
|
|
714 char *profile_url_text = NULL;
|
9162
|
715 int lang, strid;
|
9221
|
716 struct yahoo_data *yd;
|
9242
|
717 const profile_strings_node_t *strings = NULL;
|
9221
|
718
|
|
719 if (!GAIM_CONNECTION_IS_VALID(info_data->gc)) {
|
|
720 g_free(info_data->name);
|
|
721 g_free(info_data);
|
|
722 return;
|
|
723 }
|
9162
|
724
|
|
725 gaim_debug_info("yahoo", "In yahoo_got_info\n");
|
|
726
|
9221
|
727 yd = info_data->gc->proto_data;
|
9242
|
728
|
|
729 /* Get the tooltip info string */
|
|
730 tooltip_text = yahoo_tooltip_info_text(info_data);
|
9221
|
731
|
9242
|
732 /* We failed to grab the profile URL. This is not expected to actually
|
|
733 * happen except under unusual error conditions, as Yahoo is observed
|
|
734 * to send back HTML, with a 200 status code.
|
|
735 */
|
9162
|
736 if (url_text == NULL || strcmp(url_text, "") == 0) {
|
9242
|
737 g_snprintf(buf, 1024, "<html><body>%s<b>%s</b></body></html>",
|
|
738 tooltip_text, _("Error retrieving profile"));
|
|
739
|
9162
|
740 gaim_notify_formatted(info_data->gc, NULL, _("Buddy Information"), NULL,
|
9242
|
741 buf, NULL, NULL);
|
9162
|
742
|
9242
|
743 g_free(profile_url_text);
|
|
744 g_free(tooltip_text);
|
9162
|
745 g_free(info_data->name);
|
|
746 g_free(info_data);
|
|
747 return;
|
|
748 }
|
|
749
|
9242
|
750 /* Construct the correct profile URL */
|
|
751 s = g_string_sized_new(80); /* wild guess */
|
|
752 g_string_printf(s, "%s%s", (yd->jp? YAHOOJP_PROFILE_URL: YAHOO_PROFILE_URL),
|
|
753 info_data->name);
|
|
754 profile_url_text = g_string_free(s, FALSE);
|
|
755 s = NULL;
|
|
756
|
|
757 /* We don't yet support the multiple link level of the warning page for
|
9162
|
758 * 'adult' profiles, not to mention the fact that yahoo wants you to be
|
9242
|
759 * logged in (on the website) to be able to view an 'adult' profile. For
|
9162
|
760 * now, just tell them that we can't help them, and provide a link to the
|
|
761 * profile if they want to do the web browser thing.
|
|
762 */
|
|
763 p = strstr(url_text, "Adult Profiles Warning Message");
|
9242
|
764 if (!p) {
|
|
765 p = strstr(url_text, "Adult Content Warning"); /* TITLE element */
|
|
766 }
|
9162
|
767 if (p) {
|
9242
|
768 g_snprintf(buf, 1024, "<html><body>%s<b>%s</b><br><br>\n"
|
|
769 "%s<br><a href=\"%s\">%s</a></body></html>",
|
|
770 tooltip_text,
|
|
771 _("Sorry, profiles marked as containing adult content "
|
|
772 "are not supported at this time."),
|
|
773 _("If you wish to view this profile, "
|
|
774 "you will need to visit this link in your web browser"),
|
|
775 profile_url_text, profile_url_text);
|
9162
|
776
|
|
777 gaim_notify_formatted(info_data->gc, NULL, _("Buddy Information"), NULL,
|
|
778 buf, NULL, NULL);
|
|
779
|
9242
|
780 g_free(profile_url_text);
|
|
781 g_free(tooltip_text);
|
9162
|
782 g_free(info_data->name);
|
|
783 g_free(info_data);
|
|
784 return;
|
|
785 }
|
|
786
|
|
787 /* Check whether the profile is written in a supported language */
|
|
788 for (lang = 0;; lang += 1) {
|
|
789 last_updated_string = profile_langs[lang].last_updated_string;
|
|
790 if (!last_updated_string) break;
|
|
791 p = strstr(url_text, last_updated_string);
|
|
792 if (p && profile_langs[lang].det && !strstr(url_text, profile_langs[lang].det)) {
|
|
793 p = NULL;
|
|
794 }
|
|
795 if (p) break;
|
|
796 }
|
|
797 if (p) {
|
|
798 for (strid = 0; profile_strings[strid].lang != XX; strid += 1) {
|
9221
|
799 if (profile_strings[strid].lang == profile_langs[lang].lang) break;
|
9162
|
800 }
|
9242
|
801 strings = profile_strings + strid;
|
9162
|
802 gaim_debug_info("yahoo", "detected profile lang = %s (%d)\n", profile_strings[strid].lang_string, lang);
|
|
803 }
|
|
804
|
9220
|
805 /* Every user may choose his/her own profile language, and this language
|
|
806 * has nothing to do with the preferences of the user which looks at the
|
|
807 * profile. We try to support all languages, but nothing is guaranteed.
|
9242
|
808 * If we cannot determine the language, it means either (1) the profile
|
|
809 * is written in an unsupported language, (2) our language support is
|
|
810 * out of date, or (3) the user is not found.
|
9162
|
811 */
|
9242
|
812 if (!p || strings->lang == XX) {
|
|
813 if (!strstr(url_text, "Yahoo! Member Directory - User not found")
|
|
814 && !strstr(url_text, "was not found on this server.")
|
|
815 && !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")) {
|
|
816 g_snprintf(buf, 1024, "<html><body>%s<b>%s</b><br><br>\n"
|
|
817 "%s<br><a href=\"%s\">%s</a></body></html>",
|
|
818 tooltip_text,
|
|
819 _("Sorry, this profile seems to be in a language "
|
|
820 "that is not supported at this time."),
|
|
821 _("If you wish to view this profile, "
|
|
822 "you will need to visit this link in your web browser"),
|
|
823 profile_url_text, profile_url_text);
|
9162
|
824 } else {
|
9242
|
825 g_snprintf(buf, 1024, "<html><body>%s<b>%s</b></body></html>",
|
|
826 tooltip_text, _("Error retrieving profile"));
|
9162
|
827 }
|
|
828
|
|
829 gaim_notify_formatted(info_data->gc, NULL, _("Buddy Information"), NULL,
|
|
830 buf, NULL, NULL);
|
|
831
|
9242
|
832 g_free(profile_url_text);
|
|
833 g_free(tooltip_text);
|
9162
|
834 g_free(info_data->name);
|
|
835 g_free(info_data);
|
|
836 return;
|
|
837 }
|
|
838
|
9242
|
839 #if PHOTO_SUPPORT
|
|
840 photo_url_text = yahoo_get_photo_url(url_text, info_data->name);
|
|
841 #endif
|
|
842
|
9162
|
843 url_buffer = g_strdup(url_text);
|
|
844
|
|
845 /*
|
|
846 * gaim_markup_strip_html() doesn't strip out character entities like
|
|
847 * and ·
|
|
848 */
|
|
849 yahoo_remove_nonbreaking_spaces(url_buffer);
|
|
850 #if 1
|
|
851 while ((p = strstr(url_buffer, "·")) != NULL) {
|
|
852 memmove(p, p + 6, strlen(p + 6));
|
|
853 url_buffer[strlen(url_buffer) - 6] = '\0';
|
|
854 }
|
|
855 #endif
|
|
856
|
|
857 /* nuke the nasty \r's */
|
9242
|
858 gaim_str_strip_cr(url_buffer);
|
|
859
|
|
860 #if PHOTO_SUPPORT
|
|
861
|
|
862 /* Marshall the existing state */
|
|
863 info2_data = g_malloc(sizeof(YahooGetInfoStepTwoData));
|
|
864 info2_data->info_data = info_data;
|
|
865 info2_data->url_buffer = url_buffer;
|
|
866 info2_data->s = s;
|
|
867 info2_data->photo_url_text = photo_url_text;
|
|
868 info2_data->profile_url_text = profile_url_text;
|
|
869 info2_data->tooltip_text = tooltip_text;
|
|
870 info2_data->strings = strings;
|
|
871 info2_data->last_updated_string = last_updated_string;
|
|
872
|
|
873 /* Try to put the photo in there too, if there's one */
|
|
874 if (photo_url_text) {
|
|
875 /* User-uploaded photos use a different server that requires the Host
|
|
876 * header, but Yahoo Japan will use the "chunked" content encoding if
|
|
877 * we specify HTTP 1.1. So we have to specify 1.0 & fix gaim_url_fetch
|
|
878 */
|
|
879 gaim_url_fetch(photo_url_text, FALSE, NULL, FALSE, yahoo_got_photo,
|
|
880 info2_data);
|
|
881 } else {
|
|
882 /* Emulate a callback */
|
|
883 yahoo_got_photo(info2_data, NULL, 0);
|
9162
|
884 }
|
9242
|
885 }
|
|
886
|
|
887 static void yahoo_got_photo(void *data, const char *url_text, size_t len)
|
|
888 {
|
|
889 YahooGetInfoStepTwoData *info2_data = (YahooGetInfoStepTwoData *)data;
|
|
890 gboolean found = FALSE;
|
|
891 int id = -1;
|
|
892
|
|
893 /* Temporary variables */
|
|
894 char *p = NULL;
|
|
895 char *stripped;
|
|
896 int stripped_len;
|
|
897 char *last_updated_utf8_string = NULL;
|
|
898
|
|
899 /* Unmarshall the saved state */
|
|
900 YahooGetInfoData *info_data = info2_data->info_data;
|
|
901 char *url_buffer = info2_data->url_buffer;
|
|
902 GString *s = info2_data->s;
|
|
903 char *photo_url_text = info2_data->photo_url_text;
|
|
904 char *profile_url_text = info2_data->profile_url_text;
|
|
905 char *tooltip_text = info2_data->tooltip_text;
|
|
906 const profile_strings_node_t *strings = info2_data->strings;
|
|
907 const char *last_updated_string = info2_data->last_updated_string;
|
|
908
|
|
909 /* We continue here from yahoo_got_info, as if nothing has happened */
|
|
910 #endif /* PHOTO_SUPPORT */
|
9162
|
911
|
|
912 /* nuke the html, it's easier than trying to parse the horrid stuff */
|
|
913 stripped = gaim_markup_strip_html(url_buffer);
|
|
914 stripped_len = strlen(stripped);
|
|
915
|
|
916 gaim_debug_misc("yahoo", "stripped = %p\n", stripped);
|
|
917 gaim_debug_misc("yahoo", "url_buffer = %p\n", url_buffer);
|
|
918
|
|
919 /* convert to utf8 */
|
9242
|
920 p = g_convert(stripped, -1, "utf-8", strings->charset, NULL, NULL, NULL);
|
9162
|
921 if (!p) {
|
|
922 p = g_locale_to_utf8(stripped, -1, NULL, NULL, NULL);
|
|
923 if (!p) {
|
|
924 p = g_convert(stripped, -1, "utf-8", "windows-1252", NULL, NULL, NULL);
|
|
925 }
|
|
926 }
|
|
927 if (p) {
|
|
928 g_free(stripped);
|
|
929 stripped = gaim_utf8_ncr_decode(p);
|
|
930 stripped_len = strlen(stripped);
|
|
931 g_free(p);
|
|
932 p = stripped;
|
|
933 }
|
|
934 /* FIXME need error dialog here */
|
|
935
|
|
936 /* "Last updated" should also be converted to utf8 and with killed */
|
9242
|
937 last_updated_utf8_string = g_convert(last_updated_string, -1, "utf-8",
|
|
938 strings->charset, NULL, NULL, NULL);
|
9162
|
939 yahoo_remove_nonbreaking_spaces(last_updated_utf8_string);
|
|
940
|
|
941 gaim_debug_misc("yahoo", "after utf8 conversion: stripped = (%s)\n", stripped);
|
|
942
|
|
943 /* gonna re-use the memory we've already got for url_buffer */
|
|
944 /* no we're not */
|
|
945 s = g_string_sized_new(strlen(url_buffer));
|
|
946 g_string_append(s, "<html><body>\n");
|
|
947
|
9242
|
948 #if 0
|
9162
|
949 /* extract their Yahoo! ID and put it in. Don't bother marking has_info as
|
|
950 * true, since the Yahoo! ID will always be there */
|
9242
|
951 if (!gaim_markup_extract_info_field(stripped, stripped_len, s,
|
|
952 strings->yahoo_id_string, 2, "\n", 0,
|
9162
|
953 NULL, _("Yahoo! ID"), 0, NULL))
|
9242
|
954 ;
|
|
955 #endif
|
|
956
|
|
957 /* Put the Yahoo! ID, nickname, idle time, and status message in */
|
|
958 g_string_append(s, tooltip_text);
|
|
959
|
|
960 #if PHOTO_SUPPORT
|
9162
|
961
|
9242
|
962 /* Try to put the photo in there too, if there's one and is readable */
|
|
963 if (data && url_text && len != 0) {
|
|
964 if (strstr(url_text, "400 Bad Request")
|
|
965 || strstr(url_text, "403 Forbidden")
|
|
966 || strstr(url_text, "404 Not Found")) {
|
|
967
|
|
968 gaim_debug_info("yahoo", "Error getting %s: %s\n",
|
|
969 photo_url_text, url_text);
|
|
970 } else {
|
|
971 gaim_debug_info("yahoo", "%s is %d bytes\n", photo_url_text, len);
|
|
972 id = gaim_imgstore_add(url_text, len, NULL);
|
|
973 g_string_append_printf(s, "<img id=\"%d\"><br>", id);
|
9220
|
974 }
|
|
975 }
|
9162
|
976
|
9242
|
977 #endif /* PHOTO_SUPPORT */
|
|
978
|
9162
|
979 /* extract their Email address and put it in */
|
9242
|
980 found |= gaim_markup_extract_info_field(stripped, stripped_len, s,
|
|
981 strings->my_email_string, 5, "\n", 0,
|
|
982 strings->private_string, _("Email"), 0, NULL);
|
9162
|
983
|
|
984 /* extract the Nickname if it exists */
|
9242
|
985 found |= gaim_markup_extract_info_field(stripped, stripped_len, s,
|
|
986 "Nickname:", 1, "\n", '\n',
|
9162
|
987 NULL, _("Nickname"), 0, NULL);
|
|
988
|
|
989 /* extract their RealName and put it in */
|
9242
|
990 found |= gaim_markup_extract_info_field(stripped, stripped_len, s,
|
|
991 strings->realname_string, 1, "\n", '\n',
|
9162
|
992 NULL, _("Realname"), 0, NULL);
|
|
993
|
|
994 /* extract their Location and put it in */
|
9242
|
995 found |= gaim_markup_extract_info_field(stripped, stripped_len, s,
|
|
996 strings->location_string, 2, "\n", '\n',
|
9162
|
997 NULL, _("Location"), 0, NULL);
|
|
998
|
|
999 /* extract their Age and put it in */
|
9242
|
1000 found |= gaim_markup_extract_info_field(stripped, stripped_len, s,
|
|
1001 strings->age_string, 3, "\n", '\n',
|
9162
|
1002 NULL, _("Age"), 0, NULL);
|
|
1003
|
|
1004 /* extract their MaritalStatus and put it in */
|
9242
|
1005 found |= gaim_markup_extract_info_field(stripped, stripped_len, s,
|
|
1006 strings->maritalstatus_string, 3, "\n", '\n',
|
|
1007 strings->no_answer_string, _("Marital Status"), 0, NULL);
|
9162
|
1008
|
|
1009 /* extract their Gender and put it in */
|
9242
|
1010 found |= gaim_markup_extract_info_field(stripped, stripped_len, s,
|
|
1011 strings->gender_string, 3, "\n", '\n',
|
|
1012 strings->no_answer_string, _("Gender"), 0, NULL);
|
9162
|
1013
|
|
1014 /* extract their Occupation and put it in */
|
9242
|
1015 found |= gaim_markup_extract_info_field(stripped, stripped_len, s,
|
|
1016 strings->occupation_string, 2, "\n", '\n',
|
9162
|
1017 NULL, _("Occupation"), 0, NULL);
|
|
1018
|
9242
|
1019 /* Hobbies, Latest News, and Favorite Quote are a bit different, since
|
|
1020 * the values can contain embedded newlines... but any or all of them
|
|
1021 * can also not appear. The way we delimit them is to successively
|
|
1022 * look for the next one that _could_ appear, and if all else fails,
|
|
1023 * we end the section by looking for the 'Links' heading, which is the
|
|
1024 * next thing to follow this bunch. (For Yahoo Japan, we check for
|
|
1025 * the "Description" ("Self PR") heading instead of "Links".)
|
9162
|
1026 */
|
|
1027
|
9242
|
1028 if (!gaim_markup_extract_info_field(stripped, stripped_len, s,
|
|
1029 strings->hobbies_string, 1, strings->latest_news_string,
|
9162
|
1030 '\n', NULL, _("Hobbies"), 0, NULL))
|
|
1031 {
|
9242
|
1032 if (!gaim_markup_extract_info_field(stripped, stripped_len, s,
|
|
1033 strings->hobbies_string, 1, strings->favorite_quote_string,
|
9162
|
1034 '\n', NULL, _("Hobbies"), 0, NULL))
|
|
1035 {
|
9242
|
1036 found |= gaim_markup_extract_info_field(stripped, stripped_len, s,
|
|
1037 strings->hobbies_string, 1, strings->links_string,
|
9162
|
1038 '\n', NULL, _("Hobbies"), 0, NULL);
|
|
1039 }
|
|
1040 else
|
|
1041 found = TRUE;
|
|
1042 }
|
|
1043 else
|
|
1044 found = TRUE;
|
|
1045
|
9242
|
1046 if (!gaim_markup_extract_info_field(stripped, stripped_len, s,
|
|
1047 strings->latest_news_string, 1, strings->favorite_quote_string,
|
9162
|
1048 '\n', NULL, _("Latest News"), 0, NULL))
|
|
1049 {
|
9242
|
1050 found |= gaim_markup_extract_info_field(stripped, stripped_len, s,
|
|
1051 strings->latest_news_string, 1, strings->links_string,
|
9162
|
1052 '\n', NULL, _("Latest News"), 0, NULL);
|
|
1053 }
|
|
1054 else
|
|
1055 found = TRUE;
|
|
1056
|
9242
|
1057 found |= gaim_markup_extract_info_field(stripped, stripped_len, s,
|
|
1058 strings->favorite_quote_string, 1, strings->links_string,
|
9162
|
1059 '\n', NULL, _("Favorite Quote"), 0, NULL);
|
|
1060
|
|
1061 /* Home Page will either be "No home page specified",
|
|
1062 * or "Home Page: " and a link.
|
9242
|
1063 * For Yahoo! Japan, if there is no home page specified,
|
|
1064 * neither "No home page specified" nor "Home Page:" is shown.
|
9162
|
1065 */
|
9242
|
1066 if (strings->home_page_string) {
|
|
1067 p = !strings->no_home_page_specified_string? NULL:
|
|
1068 strstr(stripped, strings->no_home_page_specified_string);
|
9162
|
1069 if(!p)
|
|
1070 {
|
9242
|
1071 found |= gaim_markup_extract_info_field(stripped, stripped_len, s,
|
|
1072 strings->home_page_string, 1, "\n", 0, NULL,
|
9162
|
1073 _("Home Page"), 1, NULL);
|
|
1074 }
|
|
1075 }
|
|
1076
|
9242
|
1077 /* Cool Link {1,2,3} is also different. If "No cool link specified"
|
|
1078 * exists, then we have none. If we have one however, we'll need to
|
|
1079 * check and see if we have a second one. If we have a second one,
|
|
1080 * we have to check to see if we have a third one.
|
9162
|
1081 */
|
9242
|
1082 p = !strings->no_cool_link_specified_string? NULL:
|
|
1083 strstr(stripped,strings->no_cool_link_specified_string);
|
9162
|
1084 if (!p)
|
|
1085 {
|
9242
|
1086 if (gaim_markup_extract_info_field(stripped, stripped_len, s,
|
|
1087 strings->cool_link_1_string, 1, "\n", 0, NULL,
|
9162
|
1088 _("Cool Link 1"), 1, NULL))
|
|
1089 {
|
|
1090 found = TRUE;
|
9242
|
1091 if (gaim_markup_extract_info_field(stripped, stripped_len, s,
|
|
1092 strings->cool_link_2_string, 1, "\n", 0, NULL,
|
9162
|
1093 _("Cool Link 2"), 1, NULL))
|
9242
|
1094 {
|
|
1095 gaim_markup_extract_info_field(stripped, stripped_len, s,
|
|
1096 strings->cool_link_3_string, 1, "\n", 0, NULL,
|
9162
|
1097 _("Cool Link 3"), 1, NULL);
|
9242
|
1098 }
|
9162
|
1099 }
|
|
1100 }
|
|
1101
|
|
1102 /* see if Member Since is there, and if so, extract it. */
|
9242
|
1103 found |= gaim_markup_extract_info_field(stripped, stripped_len, s,
|
|
1104 "Member Since:", 1, last_updated_utf8_string,
|
9162
|
1105 '\n', NULL, _("Member Since"), 0, NULL);
|
|
1106
|
|
1107 /* extract the Last Updated date and put it in */
|
9242
|
1108 found |= gaim_markup_extract_info_field(stripped, stripped_len, s,
|
|
1109 last_updated_utf8_string, 0, "\n", '\n', NULL,
|
9162
|
1110 _("Last Updated"), 0, NULL);
|
|
1111
|
9220
|
1112 /* put a link to the actual profile URL */
|
|
1113 g_string_append_printf(s, _("<b>%s:</b> "), _("Profile URL"));
|
9242
|
1114 g_string_append_printf(s, "<br><a href=\"%s\">%s</a><br>",
|
|
1115 profile_url_text, profile_url_text);
|
9220
|
1116
|
9162
|
1117 /* finish off the html */
|
|
1118 g_string_append(s, "</body></html>\n");
|
|
1119 g_free(stripped);
|
|
1120
|
|
1121 if(found)
|
|
1122 {
|
|
1123 /* show it to the user */
|
|
1124 gaim_notify_formatted(info_data->gc, NULL, _("Buddy Information"), NULL,
|
|
1125 s->str, NULL, NULL);
|
|
1126 }
|
|
1127 else
|
|
1128 {
|
|
1129 char *primary;
|
|
1130 primary = g_strdup_printf(_("User information for %s unavailable"), info_data->name);
|
|
1131 gaim_notify_error(info_data->gc, NULL, primary,
|
|
1132 _("The user's profile is empty."));
|
|
1133 g_free(primary);
|
|
1134 }
|
|
1135
|
|
1136 g_free(last_updated_utf8_string);
|
|
1137 g_free(url_buffer);
|
|
1138 g_string_free(s, TRUE);
|
9242
|
1139 g_free(profile_url_text);
|
|
1140 g_free(tooltip_text);
|
9162
|
1141 g_free(info_data->name);
|
|
1142 g_free(info_data);
|
9242
|
1143
|
|
1144 #if PHOTO_SUPPORT
|
|
1145 g_free(photo_url_text);
|
|
1146 g_free(info2_data);
|
|
1147 if (id != -1)
|
|
1148 gaim_imgstore_unref(id);
|
|
1149 #endif
|
9162
|
1150 }
|
|
1151
|
|
1152 void yahoo_get_info(GaimConnection *gc, const char *name)
|
|
1153 {
|
9164
|
1154 struct yahoo_data *yd = gc->proto_data;
|
9162
|
1155 YahooGetInfoData *data;
|
|
1156 char *url;
|
|
1157
|
|
1158 data = g_new0(YahooGetInfoData, 1);
|
|
1159 data->gc = gc;
|
|
1160 data->name = g_strdup(name);
|
|
1161
|
9221
|
1162 url = g_strdup_printf("%s%s",
|
|
1163 (yd->jp? YAHOOJP_PROFILE_URL: YAHOO_PROFILE_URL), name);
|
9162
|
1164
|
|
1165 gaim_url_fetch(url, FALSE, NULL, FALSE, yahoo_got_info, data);
|
|
1166
|
|
1167 g_free(url);
|
|
1168 }
|