diff options
author | Xavier Claessens <xclaesse@src.gnome.org> | 2008-05-28 01:34:44 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2008-05-28 01:34:44 +0800 |
commit | 891dd64e17fe816e6bab0b1e1d3ea35eb61a2e35 (patch) | |
tree | ff5389343502b4121a6eebb5496edb6d83d52245 /libempathy/empathy-tp-contact-factory.c | |
parent | 1403c791daa33f39c3dc86917c2f133ced2ae8f4 (diff) | |
download | gsoc2013-empathy-891dd64e17fe816e6bab0b1e1d3ea35eb61a2e35.tar gsoc2013-empathy-891dd64e17fe816e6bab0b1e1d3ea35eb61a2e35.tar.gz gsoc2013-empathy-891dd64e17fe816e6bab0b1e1d3ea35eb61a2e35.tar.bz2 gsoc2013-empathy-891dd64e17fe816e6bab0b1e1d3ea35eb61a2e35.tar.lz gsoc2013-empathy-891dd64e17fe816e6bab0b1e1d3ea35eb61a2e35.tar.xz gsoc2013-empathy-891dd64e17fe816e6bab0b1e1d3ea35eb61a2e35.tar.zst gsoc2013-empathy-891dd64e17fe816e6bab0b1e1d3ea35eb61a2e35.zip |
Move avatar cache to ~/.cache and don't mix avatar from different contacts, tokens are not garanteed to be different.
svn path=/trunk/; revision=1128
Diffstat (limited to 'libempathy/empathy-tp-contact-factory.c')
-rw-r--r-- | libempathy/empathy-tp-contact-factory.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/libempathy/empathy-tp-contact-factory.c b/libempathy/empathy-tp-contact-factory.c index 7cf0b53cc..fe68ed0a7 100644 --- a/libempathy/empathy-tp-contact-factory.c +++ b/libempathy/empathy-tp-contact-factory.c @@ -323,7 +323,6 @@ tp_contact_factory_avatar_retrieved_cb (TpConnection *connection, GObject *tp_factory) { EmpathyContact *contact; - EmpathyAvatar *avatar; contact = tp_contact_factory_find_by_handle (EMPATHY_TP_CONTACT_FACTORY (tp_factory), handle); @@ -335,13 +334,11 @@ tp_contact_factory_avatar_retrieved_cb (TpConnection *connection, empathy_contact_get_id (contact), handle); - avatar = empathy_avatar_new (avatar_data->data, - avatar_data->len, - mime_type, - token); - - empathy_contact_set_avatar (contact, avatar); - empathy_avatar_unref (avatar); + empathy_contact_load_avatar_data (contact, + avatar_data->data, + avatar_data->len, + mime_type, + token); } static void @@ -381,11 +378,8 @@ tp_contact_factory_avatar_maybe_update (EmpathyTpContactFactory *tp_factory, } /* The avatar changed, search the new one in the cache */ - avatar = empathy_avatar_new_from_cache (token); - if (avatar) { + if (empathy_contact_load_avatar_cache (contact, token)) { /* Got from cache, use it */ - empathy_contact_set_avatar (contact, avatar); - empathy_avatar_unref (avatar); return TRUE; } @@ -804,8 +798,6 @@ tp_contact_factory_got_self_handle_cb (TpConnection *proxy, handle_needed_contacts, tp_contact_factory_list_free, G_OBJECT (tp_factory)); - tp_contact_factory_request_everything ((EmpathyTpContactFactory*) tp_factory, - id_needed); tp_cli_connection_call_inspect_handles (priv->connection, -1, TP_HANDLE_TYPE_CONTACT, @@ -814,6 +806,9 @@ tp_contact_factory_got_self_handle_cb (TpConnection *proxy, id_needed_contacts, tp_contact_factory_list_free, G_OBJECT (tp_factory)); + tp_contact_factory_request_everything ((EmpathyTpContactFactory*) tp_factory, + id_needed); + g_array_free (handle_needed, TRUE); g_array_free (id_needed, TRUE); } |