mirror of
https://gitlab.gnome.org/GNOME/calls.git
synced 2025-01-06 03:25:31 +00:00
manager: hang up secondary calls
This commit is contained in:
parent
24f53cd927
commit
94345e0916
1 changed files with 10 additions and 0 deletions
|
@ -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 ();
|
||||
|
|
Loading…
Reference in a new issue