changeset 16324:ea82f4e6321e

merge of '2a2d4d6f656ef5ff272b086eb6eba1bee0c466de' and 'd6146877517deb248a8d68f13e7596b75ab0ca90'
author Mark Doliner <mark@kingant.net>
date Mon, 23 Apr 2007 07:54:21 +0000
parents bfa7bc0e7b21 (diff) cf62255b0a74 (current diff)
children ca75eccdca3d 08557e94840c
files
diffstat 2 files changed, 16 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/xdata.c	Mon Apr 23 07:44:12 2007 +0000
+++ b/libpurple/protocols/jabber/xdata.c	Mon Apr 23 07:54:21 2007 +0000
@@ -64,6 +64,8 @@
 				case JABBER_X_DATA_JID_SINGLE:
 					{
 					const char *value = purple_request_field_string_get_value(field);
+					if (value == NULL)
+						break;
 					fieldnode = xmlnode_new_child(result, "field");
 					xmlnode_set_attrib(fieldnode, "var", id);
 					valuenode = xmlnode_new_child(fieldnode, "value");
@@ -75,6 +77,8 @@
 					{
 					char **pieces, **p;
 					const char *value = purple_request_field_string_get_value(field);
+					if (value == NULL)
+						break;
 					fieldnode = xmlnode_new_child(result, "field");
 					xmlnode_set_attrib(fieldnode, "var", id);
 
--- a/libpurple/protocols/oscar/oscar.c	Mon Apr 23 07:44:12 2007 +0000
+++ b/libpurple/protocols/oscar/oscar.c	Mon Apr 23 07:54:21 2007 +0000
@@ -2898,29 +2898,22 @@
 		if (userinfo->status[0] != '\0')
 			tmp = oscar_encoding_to_utf8(userinfo->status_encoding,
 											 userinfo->status, userinfo->status_len);
+#ifdef _WIN32
+		if (userinfo->itmsurl[0] != '\0') {
+			gchar *itmsurl, *tmp2;
+			itmsurl = oscar_encoding_to_utf8(userinfo->itmsurl_encoding,
+					userinfo->itmsurl, userinfo->itmsurl_len);
+			tmp2 = g_strdup_printf("<a href=\"%s\">%s</a>",
+					itmsurl, tmp);
+			g_free(tmp);
+			tmp = tmp2;
+			g_free(itmsurl);
+		}
+#endif
 		oscar_user_info_add_pair(user_info, _("Available Message"), tmp);
 		g_free(tmp);
 	}
 
-#if 0
-	/*
-	 * TODO: This code is disabled because it's kind of stupid.  iTunes
-	 *       doesn't run in Linux.  It'd be cool if we surfaced this URL
-	 *       to Windows users, but it would be better to just linkify
-	 *       the available message, above.
-	 */
-
-	/* iTunes Music Store link */
-	if (userinfo->itmsurl != NULL)
-	{
-		if (userinfo->itmsurl[0] != '\0')
-			tmp = oscar_encoding_to_utf8(userinfo->itmsurl_encoding,
-											 userinfo->itmsurl, userinfo->itmsurl_len);
-		oscar_user_info_add_pair(user_info, _("iTunes Music Store Link"), tmp);
-		g_free(tmp);
-	}
-#endif
-
 	/* Away message */
 	if ((userinfo->flags & AIM_FLAG_AWAY) && (userinfo->away_len > 0) && (userinfo->away != NULL) && (userinfo->away_encoding != NULL)) {
 		tmp = oscar_encoding_extract(userinfo->away_encoding);