From dd1dfc2d27d2480e0b2933117e57895ca2329f98 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Tue, 8 Jul 2008 17:32:41 +0000 Subject: add empathy_avatar_save_to_file (Guillaume Desmottes) svn path=/trunk/; revision=1209 --- libempathy/empathy-contact.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'libempathy/empathy-contact.c') diff --git a/libempathy/empathy-contact.c b/libempathy/empathy-contact.c index 46aee93ea..489e02c2e 100644 --- a/libempathy/empathy-contact.c +++ b/libempathy/empathy-contact.c @@ -829,7 +829,7 @@ empathy_contact_load_avatar_data (EmpathyContact *contact, /* 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 @@ empathy_avatar_ref (EmpathyAvatar *avatar) 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); +} -- cgit v1.2.3