diff options
author | Xavier Claessens <xavier.claessens@collabora.co.uk> | 2012-05-11 14:08:03 +0200 |
---|---|---|
committer | Xavier Claessens <xavier.claessens@collabora.co.uk> | 2012-05-11 16:22:01 +0200 |
commit | 22a4438161874e36e27282bd3d24a909f4b16f70 (patch) | |
tree | 0b20a0685d4f83acf6f6caef44e7b9913a8657c7 /telepathy-glib/contact.c | |
parent | ae3ebc3bb9250d8cf7631bddba7328d154d54733 (diff) | |
download | telepathy-glib-22a4438161874e36e27282bd3d24a909f4b16f70.tar.gz |
TpContact does not always request avatar
If AVATAR_TOKEN was already prepared and we upgrade to have AVATAR_DATA,
the avatar won't be requested
Diffstat (limited to 'telepathy-glib/contact.c')
-rw-r--r-- | telepathy-glib/contact.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/telepathy-glib/contact.c b/telepathy-glib/contact.c index 6211cd25f..9166888a8 100644 --- a/telepathy-glib/contact.c +++ b/telepathy-glib/contact.c @@ -3560,16 +3560,21 @@ contacts_context_queue_features (ContactsContext *context) #endif } - if (!contacts_context_supports_iface (context, + if ((feature_flags & CONTACT_FEATURE_FLAG_AVATAR_TOKEN) != 0 && + !contacts_context_supports_iface (context, TP_IFACE_QUARK_CONNECTION_INTERFACE_AVATARS) && tp_proxy_has_interface_by_id (context->connection, TP_IFACE_QUARK_CONNECTION_INTERFACE_AVATARS)) { - if ((feature_flags & CONTACT_FEATURE_FLAG_AVATAR_TOKEN) != 0) - g_queue_push_tail (&context->todo, contacts_get_avatar_tokens); + g_queue_push_tail (&context->todo, contacts_get_avatar_tokens); + } - if ((feature_flags & CONTACT_FEATURE_FLAG_AVATAR_DATA) != 0) - g_queue_push_tail (&context->todo, contacts_get_avatar_data); + /* There is no contact attribute for avatar data, always use slow path */ + if ((feature_flags & CONTACT_FEATURE_FLAG_AVATAR_DATA) != 0 && + tp_proxy_has_interface_by_id (context->connection, + TP_IFACE_QUARK_CONNECTION_INTERFACE_AVATARS)) + { + g_queue_push_tail (&context->todo, contacts_get_avatar_data); } if ((feature_flags & CONTACT_FEATURE_FLAG_LOCATION) != 0 && @@ -3669,12 +3674,6 @@ tp_contact_set_attributes (TpContact *contact, } } - /* There is no attribute for avatar data. If we want it, let's just - * pretend it is ready. If avatar is in cache, that will be true as - * soon as the token is set from attributes */ - if (wanted & CONTACT_FEATURE_FLAG_AVATAR_DATA) - contact->priv->has_features |= CONTACT_FEATURE_FLAG_AVATAR_DATA; - if (wanted & CONTACT_FEATURE_FLAG_AVATAR_TOKEN) { s = tp_asv_get_string (asv, |