[calls] sip: origin: Switch to state notify signal
- From: Evangelos Ribeiro Tzaras <devrtz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [calls] sip: origin: Switch to state notify signal
- Date: Thu, 20 Jan 2022 10:50:29 +0000 (UTC)
commit 7c5dcd37d710439eb0e0b05cc14c432ad7d0b894
Author: Evangelos Ribeiro Tzaras <devrtz fortysixandtwo eu>
Date: Fri Jan 14 06:16:43 2022 +0100
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 cd6bdd94..9d723aac 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]