From 56249d650bbcbfe79ff144de3aa4852ffa718fc8 Mon Sep 17 00:00:00 2001 From: Alexandre Savard <alexandresavard@msavard.(none)> Date: Thu, 16 Jun 2011 17:10:58 -0400 Subject: [PATCH] #6183: Fix removing call from calllist --- sflphone-client-gnome/src/contacts/calllist.c | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/sflphone-client-gnome/src/contacts/calllist.c b/sflphone-client-gnome/src/contacts/calllist.c index 68791f3631..ad1858cf69 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); } -- GitLab