diff --git a/sflphone-client-gnome/src/actions.c b/sflphone-client-gnome/src/actions.c index ff7ce9c15b498a9c6662f276eaa0ed3861395b55..4bf9f69371d7c06e11bec8a39958febcf6c6a94b 100644 --- a/sflphone-client-gnome/src/actions.c +++ b/sflphone-client-gnome/src/actions.c @@ -1127,7 +1127,22 @@ sflphone_join_participant (const gchar* sel_callID, const gchar* drag_callID) void sflphone_add_participant (const gchar* callID, const gchar* confID) { - DEBUG ("sflphone add participant %s to conference %s", callID, confID); + GtkTreeIter iter; + callable_obj_t *call; + + DEBUG (">SFLphone: Add participant %s to conference %s", callID, confID); + + call = calllist_get_call(current_calls, callID); + if(call == NULL) { + ERROR("SFLphone: Error: Could not find call"); + return; + } + + set_timestamp(&call->_time_added); + + iter = calltree_get_gtkiter_from_id(history, confID); + + calltree_add_call(history, call, &iter); dbus_add_participant (callID, confID); } diff --git a/sflphone-client-gnome/src/contacts/calltree.c b/sflphone-client-gnome/src/contacts/calltree.c index ab6af26db272aa2ec1c4d334d62b0a4e54337adb..8f58741464127fcb5942a81f2fb8c2ed0b7d44b1 100644 --- a/sflphone-client-gnome/src/contacts/calltree.c +++ b/sflphone-client-gnome/src/contacts/calltree.c @@ -1050,7 +1050,6 @@ void calltree_add_call (calltab_t* tab, callable_obj_t * c, GtkTreeIter *parent) WARN ("CallTree: This widget doesn't exist - This is a bug in the application."); } - //Resize it if (pixbuf) { if (gdk_pixbuf_get_width (pixbuf) > 32 || gdk_pixbuf_get_height (pixbuf) > 32) { @@ -1651,7 +1650,7 @@ static void drag_end_cb (GtkWidget * widget UNUSED, GdkDragContext * context UNU if (selected_call->_confID) { gtk_tree_path_up (spath); - gtk_tree_model_get_iter (GTK_TREE_MODEL (model), &parent_conference, spath); + gtk_tree_model_get_iter (GTK_TREE_MODEL (model), &parent_conference, spath); calltree_add_call (current_calls, selected_call, &parent_conference); } else { @@ -1718,7 +1717,7 @@ static void drag_end_cb (GtkWidget * widget UNUSED, GdkDragContext * context UNU selected_call->_historyConfID = NULL; } selected_call->_historyConfID = g_strdup(dragged_call_id); - sflphone_add_participant (selected_call_id, dragged_call_id); + sflphone_add_participant (selected_call_id, dragged_call_id); } else if (selected_type == A_CONFERENCE && dragged_type == A_CALL) { // dragged a conference on a single call @@ -1727,7 +1726,6 @@ static void drag_end_cb (GtkWidget * widget UNUSED, GdkDragContext * context UNU calltree_remove_conference (current_calls, conf, NULL); calltree_add_conference (current_calls, conf); - } else if (selected_type == A_CONFERENCE && dragged_type == A_CONFERENCE) { // dragged a conference on a conference @@ -1992,6 +1990,40 @@ static void menuitem_response( gchar *string ) // The create conference option will hide if tow call from the same conference are draged on each other gtk_widget_show(menu_items); - printf ("%s\n", string); + printf("%s\n", string); } +GtkTreeIter calltree_get_gtkiter_from_id(calltab_t *tab, gchar *id) +{ + GtkTreeIter iter; + GValue val; + GtkTreeModel *tree_model; + conference_obj_t *conf; + callable_obj_t *call; + + tree_model = GTK_TREE_MODEL(tab->store); + + gtk_tree_model_get_iter_first(tree_model, &iter); + + while(gtk_tree_model_iter_next(tree_model, &iter)) { + val.g_type = 0; + gtk_tree_model_get_value (tree_model, &iter, COLUMN_ACCOUNT_PTR, &val); + + if(gtk_tree_model_iter_has_child(tree_model, &iter)) { + conf = (conference_obj_t *) g_value_get_pointer (&val); + + if(g_strcmp0(conf->_confID, id) == 0) { + return iter; + } + } + else { + call = (callable_obj_t *) g_value_get_pointer(&val); + + if(g_strcmp0(call->_callID, id) == 0) { + return iter; + } + } + } + + return iter; +} diff --git a/sflphone-client-gnome/src/contacts/calltree.h b/sflphone-client-gnome/src/contacts/calltree.h index b13a43381e200be6587f2819232600cad549af19..641974da6fc3fdaebb4e7c88c80397960a97e285 100644 --- a/sflphone-client-gnome/src/contacts/calltree.h +++ b/sflphone-client-gnome/src/contacts/calltree.h @@ -122,4 +122,13 @@ row_activated (GtkTreeView *, GtkTreePath *, GtkTreeViewColumn *, void *); void calltree_update_clock(); +/** + * Get the iter to a row provided the callID/confID + * @param The calltab (current_calls, history, contacts) + * @param The callID/confID + * @return The + */ +GtkTreeIter +calltree_get_gtkiter_from_id(calltab_t *, gchar *); + #endif diff --git a/sflphone-client-gnome/src/dbus/dbus.c b/sflphone-client-gnome/src/dbus/dbus.c index a90d91c1069bc7d1882b5f09a29347e3a626a12a..61bd32634eb5cf2da2effd2a399258f751c47412 100644 --- a/sflphone-client-gnome/src/dbus/dbus.c +++ b/sflphone-client-gnome/src/dbus/dbus.c @@ -358,12 +358,14 @@ conference_created_cb (DBusGProxy *proxy UNUSED, const gchar* confID, void * foo call_id = (gchar*) (*part); call = calllist_get_call (current_calls, call_id); + // set when this call have been added to the conference + set_timestamp(&call->_time_added); + // if a text widget is already created, disable it, use conference widget instead if (call->_im_widget) { im_widget_update_state (IM_WIDGET (call->_im_widget), FALSE); } - // if one of these participant is currently recording, the whole conference will be recorded if(call->_state == CALL_STATE_RECORD) { new_conf->_state = CONFERENCE_STATE_ACTIVE_ATTACHED_RECORD;