manager: hang up secondary calls
This commit is contained in:

committed by
Guido Gunther

parent
24f53cd927
commit
94345e0916
@@ -40,6 +40,7 @@ struct _CallsManager
|
||||
gchar *provider_name;
|
||||
CallsOrigin *default_origin;
|
||||
CallsManagerState state;
|
||||
CallsCall *primary_call;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (CallsManager, calls_manager, G_TYPE_OBJECT);
|
||||
@@ -140,6 +141,11 @@ 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
|
||||
@@ -151,6 +157,9 @@ 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
|
||||
@@ -482,6 +491,7 @@ calls_manager_init (CallsManager *self)
|
||||
{
|
||||
self->state = CALLS_MANAGER_STATE_NO_PROVIDER;
|
||||
self->provider_name = NULL;
|
||||
self->primary_call = NULL;
|
||||
|
||||
// Load the contacts provider
|
||||
self->contacts_provider = calls_contacts_provider_new ();
|
||||
|
Reference in New Issue
Block a user