From 7c5dcd37d710439eb0e0b05cc14c432ad7d0b894 Mon Sep 17 00:00:00 2001 From: Evangelos Ribeiro Tzaras Date: Fri, 14 Jan 2022 06:16:43 +0100 Subject: [PATCH] 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. --- plugins/sip/calls-sip-origin.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/plugins/sip/calls-sip-origin.c b/plugins/sip/calls-sip-origin.c index cd6bdd9..9d723aa 100644 --- a/plugins/sip/calls-sip-origin.c +++ b/plugins/sip/calls-sip-origin.c @@ -211,18 +211,17 @@ remove_calls (CallsSipOrigin *self, static void -on_call_state_changed (CallsSipOrigin *self, - CallsCallState new_state, - CallsCallState old_state, - CallsCall *call) +on_call_state_changed (CallsSipCall *call, + GParamSpec *pspec, + CallsSipOrigin *self) { g_assert (CALLS_IS_SIP_ORIGIN (self)); 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; - 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); g_signal_emit_by_name (CALLS_ORIGIN (self), "call-added", call); - g_signal_connect_swapped (call, "state-changed", - G_CALLBACK (on_call_state_changed), - self); + g_signal_connect (call, "notify::state", + G_CALLBACK (on_call_state_changed), + self); if (!inbound) { calls_sip_call_setup_local_media_connection (sip_call, local_port, local_port + 1);