From: Sjur Brændeland <s...@sjur-laptop.(none)>

---
 src/voicecall.c |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/src/voicecall.c b/src/voicecall.c
index 49b9c79..4341d29 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -758,15 +758,21 @@ static void emit_multiparty_call_list_changed(struct 
ofono_voicecall *vc)
                                real_emit_multiparty_call_list_changed, vc);
 }
 
-static void voicecalls_release_queue(struct ofono_voicecall *vc, GSList *calls)
+static void voicecalls_release_queue(struct ofono_voicecall *vc, GSList *calls,
+                                       gboolean skip_waiting)
 {
        GSList *l;
+       struct ofono_call *call;
 
        g_slist_free(vc->release_list);
        vc->release_list = NULL;
 
-       for (l = calls; l; l = l->next)
-               vc->release_list = g_slist_prepend(vc->release_list, l->data);
+       for (l = calls; l; l = l->next) {
+               call = l->data;
+               if (!skip_waiting || call->status != CALL_STATUS_WAITING)
+                       vc->release_list =
+                               g_slist_prepend(vc->release_list,call);
+        }
 }
 
 static void voicecalls_release_next(struct ofono_voicecall *vc)
@@ -1161,7 +1167,7 @@ static DBusMessage *manager_hangup_all(DBusConnection 
*conn,
        if (vc->driver->hangup_all != NULL)
                vc->driver->hangup_all(vc, generic_callback, vc);
        else {
-               voicecalls_release_queue(vc, vc->call_list);
+               voicecalls_release_queue(vc, vc->call_list, TRUE);
                voicecalls_release_next(vc);
        }
        return NULL;
@@ -1400,7 +1406,7 @@ static DBusMessage *multiparty_hangup(DBusConnection 
*conn,
 
        /* Fall back to the old-fashioned way */
        vc->flags |= VOICECALLS_FLAG_MULTI_RELEASE;
-       voicecalls_release_queue(vc, vc->multiparty_list);
+       voicecalls_release_queue(vc, vc->multiparty_list,FALSE);
        voicecalls_release_next(vc);
 
 out:
-- 
1.6.3.3

_______________________________________________
ofono mailing list
[email protected]
http://lists.ofono.org/listinfo/ofono

Reply via email to