empathy r1209 - trunk/libempathy



Author: xclaesse
Date: Tue Jul  8 17:32:41 2008
New Revision: 1209
URL: http://svn.gnome.org/viewvc/empathy?rev=1209&view=rev

Log:
add empathy_avatar_save_to_file (Guillaume Desmottes)


Modified:
   trunk/libempathy/empathy-contact.c
   trunk/libempathy/empathy-contact.h

Modified: trunk/libempathy/empathy-contact.c
==============================================================================
--- trunk/libempathy/empathy-contact.c	(original)
+++ trunk/libempathy/empathy-contact.c	Tue Jul  8 17:32:41 2008
@@ -829,7 +829,7 @@
 	/* Save to cache if not yet in it */
 	filename = contact_get_avatar_filename (contact, token);
 	if (filename && !g_file_test (filename, G_FILE_TEST_EXISTS)) {
-		if (!g_file_set_contents (filename, data, len, &error)) {
+		if (!empathy_avatar_save_to_file (avatar, filename, &error)) {
 			DEBUG ("Failed to save avatar in cache: %s",
 				error ? error->message : "No error given");
 			g_clear_error (&error);
@@ -931,3 +931,10 @@
 	return avatar;
 }
 
+gboolean
+empathy_avatar_save_to_file (EmpathyAvatar *self,
+                             const gchar *filename,
+                             GError **error)
+{
+  return g_file_set_contents (filename, self->data, self->len, error);
+}

Modified: trunk/libempathy/empathy-contact.h
==============================================================================
--- trunk/libempathy/empathy-contact.h	(original)
+++ trunk/libempathy/empathy-contact.h	Tue Jul  8 17:32:41 2008
@@ -134,6 +134,9 @@
 EmpathyAvatar *     empathy_avatar_ref                 (EmpathyAvatar       *avatar);
 void                empathy_avatar_unref               (EmpathyAvatar       *avatar);
 
+gboolean empathy_avatar_save_to_file (EmpathyAvatar *self,
+    const gchar *filename, GError **error);
+
 G_END_DECLS
 
 #endif /* __EMPATHY_CONTACT_H__ */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]