mirror of
https://gitlab.gnome.org/GNOME/calls.git
synced 2025-01-07 20:35:31 +00:00
sip: origin: Switch to state notify signal
We don't need the old state here, so let's use the "notify::state" signal instead of the "state-changed" signal.
This commit is contained in:
parent
470475e531
commit
7c5dcd37d7
1 changed files with 8 additions and 9 deletions
|
@ -211,18 +211,17 @@ remove_calls (CallsSipOrigin *self,
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
on_call_state_changed (CallsSipOrigin *self,
|
on_call_state_changed (CallsSipCall *call,
|
||||||
CallsCallState new_state,
|
GParamSpec *pspec,
|
||||||
CallsCallState old_state,
|
CallsSipOrigin *self)
|
||||||
CallsCall *call)
|
|
||||||
{
|
{
|
||||||
g_assert (CALLS_IS_SIP_ORIGIN (self));
|
g_assert (CALLS_IS_SIP_ORIGIN (self));
|
||||||
g_assert (CALLS_IS_CALL (call));
|
g_assert (CALLS_IS_CALL (call));
|
||||||
|
|
||||||
if (new_state != CALLS_CALL_STATE_DISCONNECTED)
|
if (calls_call_get_state (CALLS_CALL (call)) != CALLS_CALL_STATE_DISCONNECTED)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
remove_call (self, call, "Disconnected");
|
remove_call (self, CALLS_CALL (call), "Disconnected");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -263,9 +262,9 @@ add_call (CallsSipOrigin *self,
|
||||||
call = CALLS_CALL (sip_call);
|
call = CALLS_CALL (sip_call);
|
||||||
|
|
||||||
g_signal_emit_by_name (CALLS_ORIGIN (self), "call-added", call);
|
g_signal_emit_by_name (CALLS_ORIGIN (self), "call-added", call);
|
||||||
g_signal_connect_swapped (call, "state-changed",
|
g_signal_connect (call, "notify::state",
|
||||||
G_CALLBACK (on_call_state_changed),
|
G_CALLBACK (on_call_state_changed),
|
||||||
self);
|
self);
|
||||||
|
|
||||||
if (!inbound) {
|
if (!inbound) {
|
||||||
calls_sip_call_setup_local_media_connection (sip_call, local_port, local_port + 1);
|
calls_sip_call_setup_local_media_connection (sip_call, local_port, local_port + 1);
|
||||||
|
|
Loading…
Reference in a new issue