changeset 27138:2967cea30d8b

merge of '796290d1402d75f50e27f51683443b86707c9c26' and '8740eeac007708126ac1672fb005bea399aa7f33'
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Mon, 22 Jun 2009 00:47:25 +0000
parents 01f1929d0936 (current diff) 54de7746e148 (diff)
children 4892e488916a
files COPYRIGHT ChangeLog libpurple/protocols/yahoo/yahoo.c
diffstat 5 files changed, 34 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/COPYRIGHT	Sun Jun 21 16:40:15 2009 +0000
+++ b/COPYRIGHT	Mon Jun 22 00:47:25 2009 +0000
@@ -332,6 +332,7 @@
 Luke Petre
 Diego Petten
 Nathan Peterson
+Dmitry Petroff
 Sebastián E. Peyrott
 Andrea Piccinelli
 Celso Pinto
--- a/ChangeLog	Sun Jun 21 16:40:15 2009 +0000
+++ b/ChangeLog	Mon Jun 22 00:47:25 2009 +0000
@@ -94,6 +94,8 @@
 	* Support saving animated custom smileys as animated images or animated
 	  custom smileys. (Andrea Piccinelli)
 	* Support for keyboard navigation on the status icon. (Li Yuan)
+	* IMG tags without 'id' attributes are turned into links to the image URL.
+	  (Dmitry Petroff)
 
 	Finch:
 	* The hardware cursor is updated correctly. This will be useful
--- a/libpurple/protocols/jabber/useravatar.c	Sun Jun 21 16:40:15 2009 +0000
+++ b/libpurple/protocols/jabber/useravatar.c	Mon Jun 22 00:47:25 2009 +0000
@@ -257,6 +257,8 @@
                                gsize len, const gchar *error_message)
 {
 	JabberBuddyAvatarUpdateURLInfo *info = user_data;
+	gpointer icon_data;
+
 	if(!url_text) {
 		purple_debug(PURPLE_DEBUG_ERROR, "jabber",
 		             "do_buddy_avatar_update_fromurl got error \"%s\"",
@@ -264,7 +266,8 @@
 		goto out;
 	}
 
-	purple_buddy_icons_set_for_user(purple_connection_get_account(info->js->gc), info->from, (void*)url_text, len, info->id);
+	icon_data = g_memdup(url_text, len);
+	purple_buddy_icons_set_for_user(purple_connection_get_account(info->js->gc), info->from, icon_data, len, info->id);
 
 out:
 	g_free(info->from);
--- a/libpurple/protocols/yahoo/yahoo.c	Sun Jun 21 16:40:15 2009 +0000
+++ b/libpurple/protocols/yahoo/yahoo.c	Mon Jun 22 00:47:25 2009 +0000
@@ -1656,11 +1656,16 @@
 	}
 	else if (len > 0 && ret_data && *ret_data) {
 		gchar **split_data = g_strsplit(ret_data, "\r\n", -1);
-		int totalelements = g_strv_length(split_data);
+		int totalelements = 0;
 		int response_no = -1;
 		char *crumb = NULL;
 		char *crypt = NULL;
 
+#if GLIB_CHECK_VERSION(2,6,0)
+		totalelements = g_strv_length(split_data);
+#else
+		while (split_data[++totalelements] != NULL);	
+#endif
 		if (totalelements >= 5) {
 			response_no = strtol(split_data[1], NULL, 10);
 			crumb = g_strdup(split_data[2] + strlen("crumb="));
@@ -1738,10 +1743,15 @@
 	}
 	else if (len > 0 && ret_data && *ret_data) {
 		gchar **split_data = g_strsplit(ret_data, "\r\n", -1);
-		int totalelements = g_strv_length(split_data);
+		int totalelements = 0;
 		int response_no = -1;
 		char *token = NULL;
 
+#if GLIB_CHECK_VERSION(2,6,0)
+		totalelements = g_strv_length(split_data);
+#else
+		while (split_data[++totalelements] != NULL);	
+#endif
 		if(totalelements >= 5) {
 			response_no = strtol(split_data[1], NULL, 10);
 			token = g_strdup(split_data[2] + strlen("ymsgr="));
--- a/pidgin/gtkimhtml.c	Sun Jun 21 16:40:15 2009 +0000
+++ b/pidgin/gtkimhtml.c	Mon Jun 22 00:47:25 2009 +0000
@@ -2996,10 +2996,21 @@
 							break;
 
 						id = gtk_imhtml_get_html_opt(tag, "ID=");
-						if (!id)
-							break;
-						gtk_imhtml_insert_image_at_iter(imhtml, atoi(id), iter);
-						g_free(id);
+						if (id) {
+							gtk_imhtml_insert_image_at_iter(imhtml, atoi(id), iter);
+							g_free(id);
+						} else {
+							char *src, *alt;
+							src = gtk_imhtml_get_html_opt(tag, "SRC=");
+							alt = gtk_imhtml_get_html_opt(tag, "ALT=");
+							if (src) {
+								gtk_imhtml_toggle_link(imhtml, src);
+								gtk_text_buffer_insert(imhtml->text_buffer, iter, alt ? alt : src, -1);
+								gtk_imhtml_toggle_link(imhtml, NULL);
+							}
+							g_free (src);
+							g_free (alt);
+						}
 						break;
 					}
 				case 47:	/* P (opt) */