G_TYPE_BOOLEAN, /* Is active */
G_TYPE_BOOLEAN, /* Is online */
G_TYPE_BOOLEAN, /* Is separator */
- G_TYPE_BOOLEAN}; /* Can VoIP */
+ G_TYPE_BOOLEAN, /* Can make audio calls */
+ G_TYPE_BOOLEAN}; /* Can make video calls */
priv = GET_PRIV (store);
EMPATHY_CONTACT_LIST_STORE_COL_CONTACT, contact,
EMPATHY_CONTACT_LIST_STORE_COL_IS_GROUP, FALSE,
EMPATHY_CONTACT_LIST_STORE_COL_IS_SEPARATOR, FALSE,
- EMPATHY_CONTACT_LIST_STORE_COL_CAN_VOIP, empathy_contact_can_voip (contact),
+ EMPATHY_CONTACT_LIST_STORE_COL_CAN_AUDIO_CALL,
+ empathy_contact_get_capabilities (contact) &
+ EMPATHY_CAPABILITIES_AUDIO,
+ EMPATHY_CONTACT_LIST_STORE_COL_CAN_VIDEO_CALL,
+ empathy_contact_get_capabilities (contact) &
+ EMPATHY_CAPABILITIES_VIDEO,
-1);
}
EMPATHY_CONTACT_LIST_STORE_COL_CONTACT, contact,
EMPATHY_CONTACT_LIST_STORE_COL_IS_GROUP, FALSE,
EMPATHY_CONTACT_LIST_STORE_COL_IS_SEPARATOR, FALSE,
- EMPATHY_CONTACT_LIST_STORE_COL_CAN_VOIP, empathy_contact_can_voip (contact),
+ EMPATHY_CONTACT_LIST_STORE_COL_CAN_AUDIO_CALL,
+ empathy_contact_get_capabilities (contact) &
+ EMPATHY_CAPABILITIES_AUDIO,
+ EMPATHY_CONTACT_LIST_STORE_COL_CAN_VIDEO_CALL,
+ empathy_contact_get_capabilities (contact) &
+ EMPATHY_CAPABILITIES_VIDEO,
-1);
g_free (l->data);
}
EMPATHY_CONTACT_LIST_STORE_COL_IS_GROUP, FALSE,
EMPATHY_CONTACT_LIST_STORE_COL_IS_ONLINE, now_online,
EMPATHY_CONTACT_LIST_STORE_COL_IS_SEPARATOR, FALSE,
- EMPATHY_CONTACT_LIST_STORE_COL_CAN_VOIP, empathy_contact_can_voip (contact),
+ EMPATHY_CONTACT_LIST_STORE_COL_CAN_AUDIO_CALL,
+ empathy_contact_get_capabilities (contact) &
+ EMPATHY_CAPABILITIES_AUDIO,
+ EMPATHY_CONTACT_LIST_STORE_COL_CAN_VIDEO_CALL,
+ empathy_contact_get_capabilities (contact) &
+ EMPATHY_CAPABILITIES_VIDEO,
-1);
}
}
static void
-contact_list_view_voip_activated_cb (EmpathyCellRendererActivatable *cell,
- const gchar *path_string,
- EmpathyContactListView *view)
+contact_list_start_voip_call (EmpathyCellRendererActivatable *cell,
+ const gchar *path_string,
+ EmpathyContactListView *view,
+ gboolean with_video)
{
EmpathyContactListViewPriv *priv = GET_PRIV (view);
GtkTreeModel *model;
if (contact) {
EmpathyCallFactory *factory;
-
factory = empathy_call_factory_get ();
- empathy_call_factory_new_call (factory, contact);
-
+ empathy_call_factory_new_call_with_streams (factory, contact,
+ TRUE, with_video);
g_object_unref (contact);
}
}
+static void
+contact_list_view_video_call_activated_cb (
+ EmpathyCellRendererActivatable *cell,
+ const gchar *path_string,
+ EmpathyContactListView *view)
+{
+ contact_list_start_voip_call (cell, path_string, view, TRUE);
+}
+
+
+static void
+contact_list_view_audio_call_activated_cb (EmpathyCellRendererActivatable *cell,
+ const gchar *path_string,
+ EmpathyContactListView *view)
+{
+ contact_list_start_voip_call (cell, path_string, view, FALSE);
+}
+
static void
contact_list_view_cell_set_background (EmpathyContactListView *view,
GtkCellRenderer *cell,
}
static void
-contact_list_view_voip_cell_data_func (GtkTreeViewColumn *tree_column,
+contact_list_view_audio_call_cell_data_func (
+ GtkTreeViewColumn *tree_column,
GtkCellRenderer *cell,
GtkTreeModel *model,
GtkTreeIter *iter,
gtk_tree_model_get (model, iter,
EMPATHY_CONTACT_LIST_STORE_COL_IS_GROUP, &is_group,
EMPATHY_CONTACT_LIST_STORE_COL_IS_ACTIVE, &is_active,
- EMPATHY_CONTACT_LIST_STORE_COL_CAN_VOIP, &can_voip,
+ EMPATHY_CONTACT_LIST_STORE_COL_CAN_AUDIO_CALL, &can_voip,
-1);
g_object_set (cell,
contact_list_view_cell_set_background (view, cell, is_group, is_active);
}
+static void
+contact_list_view_video_call_cell_data_func (
+ GtkTreeViewColumn *tree_column,
+ GtkCellRenderer *cell,
+ GtkTreeModel *model,
+ GtkTreeIter *iter,
+ EmpathyContactListView *view)
+{
+ gboolean is_group;
+ gboolean is_active;
+ gboolean can_voip;
+
+ gtk_tree_model_get (model, iter,
+ EMPATHY_CONTACT_LIST_STORE_COL_IS_GROUP, &is_group,
+ EMPATHY_CONTACT_LIST_STORE_COL_IS_ACTIVE, &is_active,
+ EMPATHY_CONTACT_LIST_STORE_COL_CAN_VIDEO_CALL, &can_voip,
+ -1);
+
+ g_object_set (cell,
+ "visible", !is_group && can_voip,
+ "icon-name", EMPATHY_IMAGE_VIDEO_CALL,
+ NULL);
+
+ contact_list_view_cell_set_background (view, cell, is_group, is_active);
+}
+
+
static void
contact_list_view_avatar_cell_data_func (GtkTreeViewColumn *tree_column,
GtkCellRenderer *cell,
gtk_tree_view_column_add_attribute (col, cell,
"is_group", EMPATHY_CONTACT_LIST_STORE_COL_IS_GROUP);
- /* Voip Capability Icon */
+ /* Audio Call Icon */
+ cell = empathy_cell_renderer_activatable_new ();
+ gtk_tree_view_column_pack_start (col, cell, FALSE);
+ gtk_tree_view_column_set_cell_data_func (
+ col, cell,
+ (GtkTreeCellDataFunc) contact_list_view_audio_call_cell_data_func,
+ view, NULL);
+
+ g_object_set (cell,
+ "visible", FALSE,
+ NULL);
+
+ g_signal_connect (cell, "path-activated",
+ G_CALLBACK (contact_list_view_audio_call_activated_cb),
+ view);
+
+ /* Video Call Icon */
cell = empathy_cell_renderer_activatable_new ();
gtk_tree_view_column_pack_start (col, cell, FALSE);
gtk_tree_view_column_set_cell_data_func (
col, cell,
- (GtkTreeCellDataFunc) contact_list_view_voip_cell_data_func,
+ (GtkTreeCellDataFunc) contact_list_view_video_call_cell_data_func,
view, NULL);
g_object_set (cell,
NULL);
g_signal_connect (cell, "path-activated",
- G_CALLBACK (contact_list_view_voip_activated_cb),
+ G_CALLBACK (contact_list_view_video_call_activated_cb),
view);
/* Avatar */