diff --git a/sflphone-client-gnome/src/contacts/calllist.c b/sflphone-client-gnome/src/contacts/calllist.c index 68791f363143fa41dbbf2f1fe1f88debb7125473..ad1858cf692e97b196b8736d6e128e06ca1c3b65 100644 --- a/sflphone-client-gnome/src/contacts/calllist.c +++ b/sflphone-client-gnome/src/contacts/calllist.c @@ -182,17 +182,32 @@ calllist_remove_from_history (callable_obj_t* c) { calllist_remove_call (history, c->_callID); calltree_remove_call (history, c, NULL); - DEBUG ("CallList: Size of history = %i" , calllist_get_size (history)); + DEBUG ("CallList: Size of history = %d" , calllist_get_size (history)); } void calllist_remove_call (calltab_t* tab, const gchar * callID) { - callable_obj_t * c = calllist_get_call (tab, callID); + QueueElement *element; + GList *c; + + DEBUG("CallList: Remove call %s from list", callID); - if (c) { - g_queue_remove (tab->callQueue, c); + c = g_queue_find_custom (tab->callQueue, callID, is_callID_callstruct); + + // c = calllist_get_call (tab, callID); + if(c == NULL) { + DEBUG("CallList: Could not remove call %s", callID); + return; } + + element = (QueueElement *)c->data; + if(element->type != HIST_CALL) { + ERROR("CallList: Error: Element %s is not a call", callID); + return; + } + + g_queue_remove (tab->callQueue, element); }