diff options
author | Travis Reitter <treitter@gmail.com> | 2010-07-13 01:08:05 +0800 |
---|---|---|
committer | Travis Reitter <treitter@gmail.com> | 2010-07-21 07:12:37 +0800 |
commit | 9d7bdfa085b50a7c96082ffeebd5489c7192f4e2 (patch) | |
tree | 54c5d9c3de79b28a1dbb5e87a28cbf4e447892e9 /libempathy-gtk | |
parent | 61814a215542bfe7353679affcc1d5dfaf1db094 (diff) | |
download | gsoc2013-empathy-9d7bdfa085b50a7c96082ffeebd5489c7192f4e2.tar gsoc2013-empathy-9d7bdfa085b50a7c96082ffeebd5489c7192f4e2.tar.gz gsoc2013-empathy-9d7bdfa085b50a7c96082ffeebd5489c7192f4e2.tar.bz2 gsoc2013-empathy-9d7bdfa085b50a7c96082ffeebd5489c7192f4e2.tar.lz gsoc2013-empathy-9d7bdfa085b50a7c96082ffeebd5489c7192f4e2.tar.xz gsoc2013-empathy-9d7bdfa085b50a7c96082ffeebd5489c7192f4e2.tar.zst gsoc2013-empathy-9d7bdfa085b50a7c96082ffeebd5489c7192f4e2.zip |
Calculate contact capabilities ourselves.
The libfolks Capabilities interface will be removed temporarily, so we can't
rely upon it for now.
Diffstat (limited to 'libempathy-gtk')
-rw-r--r-- | libempathy-gtk/empathy-individual-store.c | 45 |
1 files changed, 33 insertions, 12 deletions
diff --git a/libempathy-gtk/empathy-individual-store.c b/libempathy-gtk/empathy-individual-store.c index 8f969c0b1..84fcbe289 100644 --- a/libempathy-gtk/empathy-individual-store.c +++ b/libempathy-gtk/empathy-individual-store.c @@ -121,20 +121,32 @@ add_individual_to_store (GtkTreeStore *self, FolksIndividual *individual, EmpathyIndividualManagerFlags flags) { + EmpathyContact *contact; + + contact = empathy_contact_dup_from_folks_individual (individual); + gtk_tree_store_insert_with_values (self, iter, parent, 0, EMPATHY_INDIVIDUAL_STORE_COL_NAME, folks_individual_get_alias (individual), EMPATHY_INDIVIDUAL_STORE_COL_INDIVIDUAL, individual, EMPATHY_INDIVIDUAL_STORE_COL_IS_GROUP, FALSE, EMPATHY_INDIVIDUAL_STORE_COL_IS_SEPARATOR, FALSE, - EMPATHY_INDIVIDUAL_STORE_COL_CAN_AUDIO_CALL, - folks_individual_get_capabilities (individual) & - FOLKS_CAPABILITIES_FLAGS_AUDIO, - EMPATHY_INDIVIDUAL_STORE_COL_CAN_VIDEO_CALL, - folks_individual_get_capabilities (individual) & - FOLKS_CAPABILITIES_FLAGS_VIDEO, EMPATHY_INDIVIDUAL_STORE_COL_FLAGS, flags, -1); + + if (contact != NULL) + { + gtk_tree_store_set (GTK_TREE_STORE (self), iter, + EMPATHY_INDIVIDUAL_STORE_COL_CAN_AUDIO_CALL, + empathy_contact_get_capabilities (contact) & + EMPATHY_CAPABILITIES_AUDIO, + EMPATHY_INDIVIDUAL_STORE_COL_CAN_VIDEO_CALL, + empathy_contact_get_capabilities (contact) & + EMPATHY_CAPABILITIES_VIDEO, + -1); + } + + tp_clear_object (&contact); } static gboolean @@ -544,6 +556,7 @@ individual_store_contact_update (EmpathyIndividualStore *self, EmpathyIndividualStorePriv *priv; ShowActiveData *data; GtkTreeModel *model; + EmpathyContact *contact; GList *iters, *l; gboolean in_list; gboolean should_be_in_list; @@ -559,6 +572,7 @@ individual_store_contact_update (EmpathyIndividualStore *self, priv = GET_PRIV (self); model = GTK_TREE_MODEL (self); + contact = empathy_contact_dup_from_folks_individual (individual); iters = individual_store_find_contact (self, individual); if (!iters) @@ -684,17 +698,23 @@ individual_store_contact_update (EmpathyIndividualStore *self, folks_individual_get_presence_type (individual), EMPATHY_INDIVIDUAL_STORE_COL_STATUS, folks_individual_get_presence_message (individual), - EMPATHY_INDIVIDUAL_STORE_COL_CAN_AUDIO_CALL, - folks_individual_get_capabilities (individual) & - FOLKS_CAPABILITIES_FLAGS_AUDIO, - EMPATHY_INDIVIDUAL_STORE_COL_CAN_VIDEO_CALL, - folks_individual_get_capabilities (individual) & - FOLKS_CAPABILITIES_FLAGS_VIDEO, EMPATHY_INDIVIDUAL_STORE_COL_COMPACT, priv->is_compact, EMPATHY_INDIVIDUAL_STORE_COL_IS_GROUP, FALSE, EMPATHY_INDIVIDUAL_STORE_COL_IS_ONLINE, now_online, EMPATHY_INDIVIDUAL_STORE_COL_IS_SEPARATOR, FALSE, -1); + + if (contact != NULL) + { + gtk_tree_store_set (GTK_TREE_STORE (self), l->data, + EMPATHY_INDIVIDUAL_STORE_COL_CAN_AUDIO_CALL, + empathy_contact_get_capabilities (contact) & + EMPATHY_CAPABILITIES_AUDIO, + EMPATHY_INDIVIDUAL_STORE_COL_CAN_VIDEO_CALL, + empathy_contact_get_capabilities (contact) & + EMPATHY_CAPABILITIES_VIDEO, + -1); + } } if (priv->show_active && do_set_active) @@ -719,6 +739,7 @@ individual_store_contact_update (EmpathyIndividualStore *self, */ g_list_foreach (iters, (GFunc) gtk_tree_iter_free, NULL); g_list_free (iters); + tp_clear_object (&contact); } static void |