changeset 28806:fc30836fb714

merge of '8549b9a30115559965e9bf93bb15a45b04c1d149' and 'd1026e37e4b82add833d2a302a41c8f84e4e2bbb'
author Mark Doliner <mark@kingant.net>
date Wed, 16 Dec 2009 02:43:20 +0000
parents 57ee55097ec8 (current diff) 57612c4d495b (diff)
children afebd4e2fc1a
files
diffstat 2 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/myspace/user.c	Tue Dec 15 16:06:54 2009 +0000
+++ b/libpurple/protocols/myspace/user.c	Wed Dec 16 02:43:20 2009 +0000
@@ -70,6 +70,8 @@
 	if (!user)
 		return;
 
+	purple_util_fetch_url_cancel(user->url_data);
+
 	g_free(user->client_info);
 	g_free(user->gender);
 	g_free(user->location);
@@ -212,6 +214,8 @@
 	const char *name = purple_buddy_get_name(user->buddy);
 	PurpleAccount *account;
 
+	user->url_data = NULL;
+
 	purple_debug_info("msim_downloaded_buddy_icon",
 			"Downloaded %" G_GSIZE_FORMAT " bytes\n", len);
 
@@ -375,7 +379,7 @@
 
 		/* Only download if URL changed */
 		if (!previous_url || !g_str_equal(previous_url, user->image_url)) {
-			purple_util_fetch_url(user->image_url, TRUE, NULL, TRUE, msim_downloaded_buddy_icon, (gpointer)user);
+			user->url_data = purple_util_fetch_url(user->image_url, TRUE, NULL, TRUE, msim_downloaded_buddy_icon, (gpointer)user);
 		}
 	} else if (g_str_equal(key_str, "LastImageUpdated")) {
 		/* TODO: use somewhere */
--- a/libpurple/protocols/myspace/user.h	Tue Dec 15 16:06:54 2009 +0000
+++ b/libpurple/protocols/myspace/user.h	Wed Dec 16 02:43:20 2009 +0000
@@ -40,6 +40,7 @@
 	gchar *image_url;
 	guint last_image_updated;
 	gboolean temporary_user;
+	PurpleUtilFetchUrlData *url_data;
 } MsimUser;
 
 /* Callback function pointer type for when a user's information is received,