mirror of
https://gitlab.gnome.org/GNOME/calls.git
synced 2025-01-07 12:25:31 +00:00
mm-origin: Delete remnant disconnected calls on startup
This commit is contained in:
parent
0d7e73ca63
commit
635b3f74b8
1 changed files with 23 additions and 10 deletions
|
@ -182,19 +182,13 @@ delete_call_cb (MMModemVoice *voice,
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
call_state_changed_cb (CallsMMOrigin *self,
|
delete_call (CallsMMOrigin *self,
|
||||||
CallsCallState state,
|
CallsMMCall *call)
|
||||||
CallsCall *call)
|
|
||||||
{
|
{
|
||||||
const gchar *path;
|
const gchar *path;
|
||||||
struct CallsMMOriginDeleteCallData *data;
|
struct CallsMMOriginDeleteCallData *data;
|
||||||
|
|
||||||
if (state != CALLS_CALL_STATE_DISCONNECTED)
|
path = calls_mm_call_get_object_path (call);
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
path = calls_mm_call_get_object_path (CALLS_MM_CALL (call));
|
|
||||||
|
|
||||||
data = g_new0 (struct CallsMMOriginDeleteCallData, 1);
|
data = g_new0 (struct CallsMMOriginDeleteCallData, 1);
|
||||||
data->self = self;
|
data->self = self;
|
||||||
|
@ -204,10 +198,23 @@ call_state_changed_cb (CallsMMOrigin *self,
|
||||||
(self->voice,
|
(self->voice,
|
||||||
path,
|
path,
|
||||||
NULL,
|
NULL,
|
||||||
(GAsyncReadyCallback) delete_call_cb,
|
(GAsyncReadyCallback)delete_call_cb,
|
||||||
data);
|
data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
call_state_changed_cb (CallsMMOrigin *self,
|
||||||
|
CallsCallState state,
|
||||||
|
CallsCall *call)
|
||||||
|
{
|
||||||
|
if (state != CALLS_CALL_STATE_DISCONNECTED)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
delete_call (self, CALLS_MM_CALL (call));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
add_call (CallsMMOrigin *self,
|
add_call (CallsMMOrigin *self,
|
||||||
|
@ -228,6 +235,12 @@ add_call (CallsMMOrigin *self,
|
||||||
g_signal_emit_by_name (CALLS_ORIGIN(self), "call-added",
|
g_signal_emit_by_name (CALLS_ORIGIN(self), "call-added",
|
||||||
CALLS_CALL(call));
|
CALLS_CALL(call));
|
||||||
|
|
||||||
|
if (mm_call_get_state (mm_call) == MM_CALL_STATE_TERMINATED)
|
||||||
|
{
|
||||||
|
// Delete any remnant disconnected call
|
||||||
|
delete_call (self, call);
|
||||||
|
}
|
||||||
|
|
||||||
g_debug ("Call `%s' added", path);
|
g_debug ("Call `%s' added", path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue