]> git.0d.be Git - empathy.git/commitdiff
client-factory: ensure alias, presence, capabilities and avatar are prepared
authorDanielle Madeley <danielle.madeley@collabora.co.uk>
Tue, 17 Jan 2012 03:30:06 +0000 (14:30 +1100)
committerDanielle Madeley <danielle.madeley@collabora.co.uk>
Tue, 17 Jan 2012 09:09:52 +0000 (20:09 +1100)
Sometimes contacts are assumed to have these features prepared, but they
don't always. Ensure they are prepared by the factory.

libempathy/empathy-client-factory.c

index 035c5695625fb5404c8754c4a944d4e86824f811..294eaf5ff43cc41b7144c014e927c01dc1213fbd 100644 (file)
@@ -169,15 +169,21 @@ empathy_client_factory_dup_contact_features (TpSimpleClientFactory *factory,
         TpConnection *connection)
 {
   GArray *features;
-  TpContactFeature feature;
+  TpContactFeature extra_features[] = {
+      TP_CONTACT_FEATURE_ALIAS,
+      TP_CONTACT_FEATURE_PRESENCE,
+      TP_CONTACT_FEATURE_AVATAR_TOKEN,
+      TP_CONTACT_FEATURE_AVATAR_DATA,
+      TP_CONTACT_FEATURE_CAPABILITIES,
+      /* Needed by empathy_individual_add_menu_item_new to check if a contact
+       * is already in the contact list. This feature is pretty cheap to
+       * prepare as it doesn't prepare the full roster. */
+      TP_CONTACT_FEATURE_SUBSCRIPTION_STATES,
+  };
 
   features = chainup->dup_contact_features (factory, connection);
 
-  /* Needed by empathy_individual_add_menu_item_new to check if a contact is
-   * already in the contact list. This feature is pretty cheap to prepare as
-   * it doesn't prepare the full roster. */
-  feature = TP_CONTACT_FEATURE_SUBSCRIPTION_STATES;
-  g_array_append_val (features, feature);
+  g_array_append_vals (features, extra_features, G_N_ELEMENTS (extra_features));
 
   return features;
 }