GObject *tp_factory)
{
EmpathyContact *contact;
- EmpathyAvatar *avatar;
contact = tp_contact_factory_find_by_handle (EMPATHY_TP_CONTACT_FACTORY (tp_factory),
handle);
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
}
/* 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;
}
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,
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);
}