diff --git a/sflphone-gtk/src/actions.c b/sflphone-gtk/src/actions.c index bfc57bc72b9de3473a6b238771bddf7599286d22..5f1e7d12c39b7130d83cb886b6b46af6e9a807cd 100644 --- a/sflphone-gtk/src/actions.c +++ b/sflphone-gtk/src/actions.c @@ -377,7 +377,7 @@ sflphone_incoming_call (call_t * c) call_list_add ( current_calls, c ); call_list_add( history, c ); update_call_tree_add( current_calls , c ); - update_call_tree_add( history , c ); + //update_call_tree_add( history , c ); update_menus(); } @@ -649,7 +649,7 @@ sflphone_place_call ( call_t * c ) // Update history c->history_state = OUTGOING; call_list_add(history, c); - update_call_tree_add(history, c); + //update_call_tree_add(history, c); } } diff --git a/sflphone-gtk/src/calllist.c b/sflphone-gtk/src/calllist.c index 628fda7e316ae9782b4696154ac57d24b8b9fba2..874bca0f67c60023581ce336255e8d56aa983ae0 100644 --- a/sflphone-gtk/src/calllist.c +++ b/sflphone-gtk/src/calllist.c @@ -81,9 +81,20 @@ call_list_add (calltab_t* tab, call_t * c) { if( tab == history ) { + g_print("ADD THE FUCKING CALL call list size = %i - max calls = %i\n", call_list_get_size(tab) , dbus_get_max_calls()); + // First case: can still add calls to the list if( call_list_get_size(tab) < dbus_get_max_calls() ) { + g_print("ADD THE FUCKING CALL\n"); g_queue_push_tail (tab->callQueue, (gpointer *) c); + update_call_tree_add( history , c ); + } + // List full -> Remove the last call from history and preprend the new call to the list + else + { + update_call_tree_remove( history , (call_t*)g_queue_pop_head( tab -> callQueue ) ); + g_queue_push_tail (tab->callQueue, (gpointer *) c); + update_call_tree_add( history , c ); } } else diff --git a/sflphone-gtk/src/calltree.c b/sflphone-gtk/src/calltree.c index 2ef2a24b0a125f2c6e1b5d51914de27917764239..b60dd81f613de60a5f441ede596370653a3f39d3 100644 --- a/sflphone-gtk/src/calltree.c +++ b/sflphone-gtk/src/calltree.c @@ -619,7 +619,8 @@ update_call_tree (calltab_t* tab, call_t * c) void update_call_tree_add (calltab_t* tab, call_t * c) { - if( tab == history && ( call_list_get_size( tab ) >= dbus_get_max_calls() ) ) + g_print("ADD THE FUCKING CALL call list size = %i - max calls = %i\n", call_list_get_size(tab) , dbus_get_max_calls()); + if( tab == history && ( call_list_get_size( tab ) > dbus_get_max_calls() ) ) return; GdkPixbuf *pixbuf;