[calls] Let provider plugin decide whether to automatically hang up secondary calls



commit 94d730c3edb13a414116f6e1202ddbec1f4a6eca
Author: Evangelos Ribeiro Tzaras <devrtz fortysixandtwo eu>
Date:   Thu Oct 14 16:17:34 2021 +0200

    Let provider plugin decide whether to automatically hang up secondary calls
    
    Revert "manager: hang up secondary calls"
    
    This reverts commit 94345e09165bc944505c84bfa84dd57a70321b5b and moves that
    functionality to the ModemManager plugin.
    
    Fixes #290

 plugins/mm/calls-mm-origin.c |  6 ++++++
 src/calls-manager.c          | 10 ----------
 2 files changed, 6 insertions(+), 10 deletions(-)
---
diff --git a/plugins/mm/calls-mm-origin.c b/plugins/mm/calls-mm-origin.c
index 5e30bb80..26ed3798 100644
--- a/plugins/mm/calls-mm-origin.c
+++ b/plugins/mm/calls-mm-origin.c
@@ -465,6 +465,12 @@ add_call (CallsMMOrigin *self,
     }
 
   g_debug ("Call `%s' added", path);
+
+  /* FIXME: Hang up the call, since accepting a secondary call does not currently work.
+   * CallsMMCall[28822]: WARNING: Error accepting ModemManager call to `+4916XXXXXXXX': 
GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Failed: This call was not ringing, cannot accept
+   */
+  if (g_hash_table_size (self->calls) > 1)
+    calls_call_hang_up (CALLS_CALL (call));
 }
 
 
diff --git a/src/calls-manager.c b/src/calls-manager.c
index 24a53771..4b9f5dd7 100644
--- a/src/calls-manager.c
+++ b/src/calls-manager.c
@@ -58,7 +58,6 @@ struct _CallsManager
   CallsContactsProvider *contacts_provider;
 
   CallsManagerState state;
-  CallsCall *primary_call;
   CallsSettings *settings;
 };
 
@@ -200,11 +199,6 @@ add_call (CallsManager *self, CallsCall *call, CallsOrigin *origin)
   g_return_if_fail (CALLS_IS_CALL (call));
 
   g_signal_emit (self, signals[SIGNAL_CALL_ADD], 0, call, origin);
-
-  if (self->primary_call == NULL)
-    self->primary_call = call;
-  else
-    calls_call_hang_up (call);
 }
 
 static void
@@ -216,9 +210,6 @@ remove_call (CallsManager *self, CallsCall *call, gchar *reason, CallsOrigin *or
 
   /* We ignore the reason for now, because it doesn't give any usefull information */
   g_signal_emit (self, signals[SIGNAL_CALL_REMOVE], 0, call, origin);
-
-  if (self->primary_call == call)
-    self->primary_call = NULL;
 }
 
 static void
@@ -666,7 +657,6 @@ calls_manager_init (CallsManager *self)
   const gchar *dir;
 
   self->state = CALLS_MANAGER_STATE_NO_PROVIDER;
-  self->primary_call = NULL;
   self->providers = g_hash_table_new_full (g_str_hash,
                                            g_str_equal,
                                            g_free,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]