⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 yahoo_profile.c

📁 yahoo message protocol stack
💻 C
📖 第 1 页 / 共 3 页
字号:
		"Ultime notizie:",		"Citazione preferita",		"Link",		"Nessuna home page specificata",		"Inizio:",		"Nessun link specificato",		"Link Preferiti 1:",		"Link Preferiti 2:",		"Link Preferiti 3:",		NULL	},	{ JA, "ja", "EUC-JP",		"Yahoo! JAPAN ID:",		"非公開",		"無回答",		"メール:",		"名前:",		"住所:",		"年齢:",		"未婚/既婚:",		"性別:",		"職業:",		"趣味:",		"最近の出来事:",		NULL,#if 0		"おすすめサイト",#else		"自己PR", /* "Self description" comes before "Links" for yahoo.co.jp */#endif		NULL,		NULL,		NULL,		"おすすめサイト1:",		"おすすめサイト2:",		"おすすめサイト3:",		NULL	},	{ KO, "ko", "EUC-KR",		"야후! ID:",		"비공개",		"비공개",		"My Email",		"실명:",		"거주지:",		"나이:",		"결혼 여부:",		"성별:",		"직업:",		"취미:",		"자기 소개:",		"좋아하는 명언",		"링크",		"홈페이지를 지정하지 않았습니다.",		"홈페이지:",		"추천 사이트가 없습니다.",		"추천 사이트 1:",		"추천 사이트 2:",		"추천 사이트 3:",		NULL	},	{ NO, "no", "ISO-8859-1",		"Yahoo! ID:",		"Privat",		"Ikke noe svar",		"Min e-post",		"Virkelig navn:",		"Sted:",		"Alder:",		"Sivilstatus:",		"Kjønn:",		"Yrke:",		"Hobbyer:",		"Siste nytt:",		"Yndlingssitat",		"Lenker",		"Ingen hjemmeside angitt",		"Hjemmeside:",		"No cool link specified",		"Bra lenke 1:",		"Bra lenke 2:",		"Bra lenke 3:",		NULL	},	{ PT, "pt", "ISO-8859-1",		"ID Yahoo!:",		"Particular",		"Sem resposta",		"Meu e-mail",		"Nome verdadeiro:",		"Local:",		"Idade:",		"Estado civil:",		"Sexo:",		"Ocupação:",		"Hobbies:",		"Últimas notícias:",		"Frase favorita",		"Links",		"Nenhuma página pessoal especificada",		"Página pessoal:",		"Nenhum site legal especificado",		"Site legal 1:",		"Site legal 2:",		"Site legal 3:",		NULL	},	{ SV, "sv", "ISO-8859-1",		"Yahoo!-ID:",		"Privat",		"Inget svar",		"Min mail",		"Riktigt namn:",		"Plats:",		"Ålder:",		"Civilstånd:",		"Kön:",		"Yrke:",		"Hobby:",		"Senaste nytt:",		"Favoritcitat",		"Länkar",		"Ingen hemsida specificerad",		"Hemsida:",		"Ingen cool länk specificerad",		"Coola länkar 1:",		"Coola länkar 2:",		"Coola länkar 3:",		NULL	},	{ ZH_CN, "zh_CN", "GB2312",		"Yahoo! ID:",		"没有提供",		"没有回答",		"个人电邮地址",		"真实姓名:",		"所在地点:",		"年龄:",		"婚姻状况:",		"性别:",		"职业:",		"业余爱好:",		"个人近况:",		"喜欢的引言",		"链接",		"没有个人主页",		"个人主页:",		"没有推荐网站链接",		"推荐网站链接 1:",		"推荐网站链接 2:",		"推荐网站链接 3:",		NULL	},	{ ZH_HK, "zh_HK", "Big5",		"Yahoo! ID:",		"私人的",		"沒有回答",		"電子信箱",		"真實姓名:",		"地點:",		"年齡:",		"婚姻狀況:",		"性別:",		"職業:",		"嗜好:",		"最新消息:",		"最喜愛的股票叫價", /* [sic] Yahoo!'s translators don't check context */		"連結",		"沒有注明個人網頁", /* [sic] */		"個人網頁:",		"沒有注明 Cool 連結", /* [sic] */		"Cool 連結 1:", /* TODO */		"Cool 連結 2:", /* TODO */		"Cool 連結 3:", /* TODO */		NULL	},	{ ZH_TW, "zh_TW", "Big5",		"帳 號:",		"沒有提供",		"沒有回應",		"電子信箱",		"姓名:",		"地點:",		"年齡:",		"婚姻狀態:",		"性別:",		"職業:",		"興趣:",		"個人近況:",		"喜歡的名句",		"連結",		"沒有個人網頁",		"個人網頁:",		"沒有推薦網站連結",		"推薦網站連結 1:",		"推薦網站連結 2:",		"推薦網站連結 3:",		NULL	},	{ ZH_US, "zh_US", "Big5", /* ZH_US is like ZH_TW, but also a bit like ZH_HK */		"Yahoo! ID:",		"沒有提供",		"沒有回答",		"個人Email地址",		"真實姓名:",		"地點:",		"年齡:",		"婚姻狀態:",		"性別:",		"職業:",		"嗜好:",		"個人近況:",		"喜歡的名句",		"連結",		"沒有個人網頁",		"個人網頁:",		"沒有推薦網站連結",		"推薦網站連結 1:", /* TODO */		"推薦網站連結 2:", /* TODO */		"推薦網站連結 3:", /* TODO */		NULL	},	{ XX, NULL, NULL, NULL, NULL, NULL, NULL },};static char *yahoo_remove_nonbreaking_spaces(char *str){	char *p;	while ((p = strstr(str, "&nbsp;")) != NULL) {		*p = ' '; /* Turn &nbsp;'s into ordinary blanks */		p += 1;		memmove(p, p + 5, strlen(p + 5));		str[strlen(str) - 5] = '\0';	}	return str;}static char *yahoo_tooltip_info_text(YahooGetInfoData *info_data) {	GString *s = g_string_sized_new(80); /* wild guess */	GaimBuddy *b;	YahooFriend *f;	g_string_printf(s, "<span style=\"font-size: larger\"><b>%s</b></span><br>",			info_data->name);	b = gaim_find_buddy(gaim_connection_get_account(info_data->gc),			info_data->name);	if (b) {		char *statustext = yahoo_tooltip_text(b);		if(b->alias && b->alias[0]) {			char *aliastext = g_markup_escape_text(b->alias, -1);			g_string_append_printf(s, _("<b>Alias:</b> %s<br>"), aliastext);			g_free(aliastext);		}		if (b->idle > 0) {			char *idletime = gaim_str_seconds_to_string(time(NULL) - b->idle);			g_string_append_printf(s, _("<b>%s:</b> %s<br>"), _("Idle"),					idletime);			g_free(idletime);		}		if (statustext) {			g_string_append_printf(s, "%s<br>", statustext);			g_free(statustext);		}		if ((f = yahoo_friend_find(info_data->gc, b->name))) {			const char *ip;			if ((ip = yahoo_friend_get_ip(f)))				g_string_append_printf(s, _("<b>IP Address:</b> %s<br>"), ip);		}	}	return g_string_free(s, FALSE);}#if PHOTO_SUPPORTstatic char *yahoo_get_photo_url(const char *url_text, const char *name) {	GString *s = g_string_sized_new(strlen(name) + 8);	char *p;	char *it = NULL;	g_string_printf(s, " alt=\"%s\">", name);	p = strstr(url_text, s->str);	if (p) {		/* Search backwards for "http://". This is stupid, but it works. */		for (; !it && p > url_text; p -= 1) {			if (strncmp(p, "\"http://", 8) == 0) {				char *q;				p += 1; /* skip only the " */				q = strchr(p, '"');				if (q) {					it = g_strndup(p, q - p);				}			}		}	}	g_string_free(s, TRUE);	return it;}static void yahoo_got_photo(void *data, const char *url_text, size_t len);#endif /* PHOTO_SUPPORT */static void yahoo_got_info(void *data, const char *url_text, size_t len){	YahooGetInfoData *info_data = (YahooGetInfoData *)data;	char *p;	char buf[1024];#if PHOTO_SUPPORT	YahooGetInfoStepTwoData *info2_data;	char *photo_url_text = NULL;#else	gboolean found = FALSE;	char *stripped;	int stripped_len;	char *last_updated_utf8_string = NULL;#endif	const char *last_updated_string = NULL;	char *url_buffer;	GString *s;	char *tooltip_text = NULL;	char *profile_url_text = NULL;	int lang, strid;	struct yahoo_data *yd;	const profile_strings_node_t *strings = NULL;	const char *title;	profile_state_t profile_state = PROFILE_STATE_DEFAULT;	if (!GAIM_CONNECTION_IS_VALID(info_data->gc)) {		g_free(info_data->name);		g_free(info_data);		return;	}	gaim_debug_info("yahoo", "In yahoo_got_info\n");	yd = info_data->gc->proto_data;	title = (yd->jp? _("Yahoo! Japan Profile") :					 _("Yahoo! Profile"));	/* Get the tooltip info string */	tooltip_text = yahoo_tooltip_info_text(info_data);		/* We failed to grab the profile URL.  This is not expected to actually	 * happen except under unusual error conditions, as Yahoo is observed	 * to send back HTML, with a 200 status code.	 */	if (url_text == NULL || strcmp(url_text, "") == 0) {		g_snprintf(buf, 1024, "<html><body>%s<b>%s</b></body></html>",				tooltip_text, _("Error retrieving profile"));		gaim_notify_userinfo(info_data->gc, info_data->name, NULL, title,			NULL, buf, NULL, NULL);		g_free(profile_url_text);		g_free(tooltip_text);		g_free(info_data->name);		g_free(info_data);		return;	}	/* Construct the correct profile URL */	s = g_string_sized_new(80); /* wild guess */	g_string_printf(s, "%s%s", (yd->jp? YAHOOJP_PROFILE_URL: YAHOO_PROFILE_URL),		info_data->name);	profile_url_text = g_string_free(s, FALSE);	s = NULL;	/* We don't yet support the multiple link level of the warning page for	 * 'adult' profiles, not to mention the fact that yahoo wants you to be	 * logged in (on the website) to be able to view an 'adult' profile.  For	 * now, just tell them that we can't help them, and provide a link to the	 * profile if they want to do the web browser thing.	 */	p = strstr(url_text, "Adult Profiles Warning Message");	if (!p) {		p = strstr(url_text, "Adult Content Warning"); /* TITLE element */	}	if (p) {		g_snprintf(buf, 1024, "<html><body>%s<b>%s</b><br><br>\n"					"%s<br><a href=\"%s\">%s</a></body></html>",				tooltip_text,				_("Sorry, profiles marked as containing adult content "				  "are not supported at this time."),				_("If you wish to view this profile, "				  "you will need to visit this link in your web browser"),				profile_url_text, profile_url_text);		gaim_notify_userinfo(info_data->gc, info_data->name, NULL, title, 				NULL, buf, NULL, NULL);		g_free(profile_url_text);		g_free(tooltip_text);		g_free(info_data->name);		g_free(info_data);		return;	}	/* Check whether the profile is written in a supported language */	for (lang = 0;; lang += 1) {		last_updated_string = profile_langs[lang].last_updated_string;	if (!last_updated_string) break;		p = strstr(url_text, last_updated_string);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -