diff libpurple/protocols/msn/object.c @ 16390:4fc51a87ce42

Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
author Richard Laager <rlaager@wiktel.com>
date Wed, 25 Apr 2007 21:48:56 +0000
parents 7873f314fadf
children 44b4e8bd759b 7c0a2ef88018
line wrap: on
line diff
--- a/libpurple/protocols/msn/object.c	Wed Apr 25 01:19:24 2007 +0000
+++ b/libpurple/protocols/msn/object.c	Wed Apr 25 21:48:56 2007 +0000
@@ -111,11 +111,12 @@
 
 	g_free(obj->creator);
 	g_free(obj->location);
-	g_free(obj->real_location);
 	g_free(obj->friendly);
 	g_free(obj->sha1d);
 	g_free(obj->sha1c);
 
+	purple_imgstore_unref(obj->img);
+
 	if (obj->local)
 		local_objs = g_list_remove(local_objs, obj);
 
@@ -317,21 +318,19 @@
 }
 
 void
-msn_object_set_real_location(MsnObject *obj, const char *real_location)
+msn_object_set_image(MsnObject *obj, PurpleStoredImage *img)
 {
 	g_return_if_fail(obj != NULL);
+	g_return_if_fail(img != NULL);
 
 	/* obj->local = TRUE; */
 
-	if (obj->real_location != NULL)
-		g_free(obj->real_location);
-
-	obj->real_location =
-		(real_location == NULL ? NULL : g_strdup(real_location));
+	purple_imgstore_unref(obj->img);
+	obj->img = purple_imgstore_ref(img);
 }
 
-const char *
-msn_object_get_real_location(const MsnObject *obj)
+PurpleStoredImage *
+msn_object_get_image(const MsnObject *obj)
 {
 	MsnObject *local_obj;
 
@@ -340,7 +339,7 @@
 	local_obj = msn_object_find_local(msn_object_get_sha1(obj));
 
 	if (local_obj != NULL)
-		return local_obj->real_location;
+		return local_obj->img;
 
 	return NULL;
 }