changeset 11361:e4868370c433

[gaim-migrate @ 13585] cleaning out my tree committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Mon, 29 Aug 2005 04:53:17 +0000
parents cf15c1cdcfbd
children 6ef19bbfb7cb
files po/stats.pl src/protocols/jabber/buddy.c src/protocols/jabber/presence.c src/util.c
diffstat 4 files changed, 25 insertions(+), 39 deletions(-) [+]
line wrap: on
line diff
--- a/po/stats.pl	Sun Aug 28 22:46:01 2005 +0000
+++ b/po/stats.pl	Mon Aug 29 04:53:17 2005 +0000
@@ -48,12 +48,9 @@
 
 $total = $1;
 
-print "<html>\n";
-print "<head><title>$PACKAGE i18n statistics</title></head>\n";
-print "<body>\n";
-print "<table cellspacing='0' cellpadding='0' border='0' bgcolor='#888888' width='100%'><tr><td><table cellspacing='1' cellpadding='2' border='0' width='100%'>\n";
-
-print"<tr bgcolor='#e0e0e0'><th>language</th><th style='background: #339933;'>trans</th><th style='background: #339933;'>%</th><th style='background: #333399;'>fuzzy</th><th style='background: #333399;'>%</th><th style='background: #dd3333;'>untrans</th><th style='background: #dd3333;'>%</th><th>&nbsp;</th></tr>\n";
+print "<?xml version='1.0'?>\n";
+print "<?xml-stylesheet type='text/xsl' href='l10n.xsl'?>\n";
+print "<project version='1.0' xmlns:l10n='http://faceprint.com/code/l10n' name='$PACKAGE' pofile='$PACKAGE.pot' strings='$total'>\n";
 
 foreach $index (0 .. $#pos) {
 	$trans = $fuzz = $untrans = 0;
@@ -65,32 +62,11 @@
 	if(/(\d+) translated message/) { $trans = $1; }
 	if(/(\d+) fuzzy translation/) { $fuzz = $1; }
 	if(/(\d+) untranslated message/) { $untrans = $1; }
-	$transp = 100 * $trans / $total;
-	$fuzzp = 100 * $fuzz / $total;
-	$untransp = 100 * $untrans / $total;
-	if($index % 2) {
-		$color = " bgcolor='#e0e0e0'";
-	} else {
-		$color = " bgcolor='#d0e0ff'";
-	}
-	$name = "";
-	$name = $lang{$po};
-	$name = code2language($po) unless $name ne "";
-	$name = "???" unless $name ne "";
-	printf "<tr$color><td>%s(%s.po)</td><td>%d</td><td>%0.2f</td><td>%d</td><td>%0.2f</td><td>%d</td><td>%0.2f</td><td>",
-	$name, $po, $trans, $transp, $fuzz, $fuzzp, $untrans, $untransp;
-	printf "<img src='bar_g.gif' height='15' width='%0.0f' />", $transp*2
-	unless $transp*2 < 0.5;
-	printf "<img src='bar_b.gif' height='15' width='%0.0f' />", $fuzzp*2
-	unless $fuzzp*2 < 0.5;
-	printf "<img src='bar_r.gif' height='15' width='%0.0f' />", $untransp*2
-	unless $untransp*2 < 0.5;
-	print "</tr>\n";
 	unlink("$po.new");
+
+	print "<lang code='$po' translated='$trans' fuzzy='$fuzz' />\n";
 	print STDERR "done ($untrans untranslated strings).\n" if($ARGV[0] eq '-v');
 }
-print "</table></td></tr></table>\n";
-print "Latest $PACKAGE.pot generated $now: <a href='$PACKAGE.pot'>$PACKAGE.pot</a><br />\n";
-print "</body>\n";
-print "</html>\n";
 
+print "</project>\n";
+
--- a/src/protocols/jabber/buddy.c	Sun Aug 28 22:46:01 2005 +0000
+++ b/src/protocols/jabber/buddy.c	Mon Aug 29 04:53:17 2005 +0000
@@ -256,8 +256,8 @@
 	{N_("Region"),             NULL, TRUE, TRUE, "REGION",    "ADR", NULL},
 	{N_("Postal Code"),        NULL, TRUE, TRUE, "PCODE",     "ADR", NULL},
 	{N_("Country"),            NULL, TRUE, TRUE, "COUNTRY",   "ADR", NULL},
-	{N_("Telephone"),          NULL, TRUE, TRUE, "TEL",       NULL,  NULL},
-	{N_("Email"),              NULL, TRUE, TRUE, "EMAIL",     NULL,  "<A HREF=\"mailto:%s\">%s</A>"},
+	{N_("Telephone"),          NULL, TRUE, TRUE, "NUMBER",    "TEL",  NULL},
+	{N_("Email"),              NULL, TRUE, TRUE, "USERID",    "EMAIL",  "<A HREF=\"mailto:%s\">%s</A>"},
 	{N_("Organization Name"),  NULL, TRUE, TRUE, "ORGNAME",   "ORG", NULL},
 	{N_("Organization Unit"),  NULL, TRUE, TRUE, "ORGUNIT",   "ORG", NULL},
 	{N_("Title"),              NULL, TRUE, TRUE, "TITLE",     NULL,  NULL},
@@ -598,6 +598,9 @@
 	if(!from)
 		return;
 
+	if(!(jb = jabber_buddy_find(js, from, TRUE)))
+		return;
+
 	/* XXX: handle the error case */
 
 	resource_name = jabber_get_resource(from);
@@ -605,7 +608,7 @@
 
 	b = gaim_find_buddy(js->gc->account, bare_jid);
 
-	jb = jabber_buddy_find(js, from, TRUE);
+
 	info_text = g_string_new("");
 
 	g_string_append_printf(info_text, "<b>%s:</b> %s<br/>", _("Jabber ID"),
@@ -808,8 +811,10 @@
 					!strcmp(child->name, "LOGO")) {
 				char *bintext = NULL;
 				xmlnode *binval;
-				if((binval = xmlnode_get_child(child, "BINVAL")) &&
-						(bintext = xmlnode_get_data(binval))) {
+
+				if( ((binval = xmlnode_get_child(child, "BINVAL")) &&
+						(bintext = xmlnode_get_data(binval))) ||
+						(bintext = xmlnode_get_data(child))) {
 					gsize size;
 					guchar *data;
 					int i;
@@ -817,7 +822,7 @@
 					char *p, hash[41];
 					gboolean photo = (strcmp(child->name, "PHOTO") == 0);
 
-					data = gaim_base64_decode(text, &size);
+					data = gaim_base64_decode(bintext, &size);
 
 					imgids = g_slist_prepend(imgids, GINT_TO_POINTER(gaim_imgstore_add(data, size, "logo.png")));
 					g_string_append_printf(info_text,
--- a/src/protocols/jabber/presence.c	Sun Aug 28 22:46:01 2005 +0000
+++ b/src/protocols/jabber/presence.c	Mon Aug 29 04:53:17 2005 +0000
@@ -221,8 +221,9 @@
 	if((vcard = xmlnode_get_child(packet, "vCard")) ||
 			(vcard = xmlnode_get_child_with_namespace(packet, "query", "vcard-temp"))) {
 		if((photo = xmlnode_get_child(vcard, "PHOTO")) &&
-				(binval = xmlnode_get_child(photo, "BINVAL")) &&
-				(text = xmlnode_get_data(binval))) {
+				(( (binval = xmlnode_get_child(photo, "BINVAL")) &&
+				(text = xmlnode_get_data(binval))) ||
+				(text = xmlnode_get_data(photo)))) {
 			data = gaim_base64_decode(text, &size);
 
 			gaim_buddy_icons_set_for_user(js->gc->account, from, data, size);
--- a/src/util.c	Sun Aug 28 22:46:01 2005 +0000
+++ b/src/util.c	Mon Aug 29 04:53:17 2005 +0000
@@ -1895,6 +1895,9 @@
 
 int gaim_build_dir (const char *path, int mode)
 {
+#if GLIB_CHECK_VERSION(2,8,0)
+	return g_mkdir_with_parents(path, mode);
+#else
 	char *dir, **components, delim[] = { G_DIR_SEPARATOR, '\0' };
 	int cur, len;
 
@@ -1941,6 +1944,7 @@
 	g_strfreev(components);
 	g_free(dir);
 	return 0;
+#endif
 }
 
 /*