From c796df9260aa907a2daaf08a7d91f2213256f943 Mon Sep 17 00:00:00 2001 From: Evangelos Ribeiro Tzaras Date: Tue, 18 Jan 2022 02:56:30 +0100 Subject: [PATCH] dbus-manager: Use CuiCallStates instead of CallsCallStates CallsCallStates are considered internal call states and do not map 1:1 to CuiCallStates. --- src/calls-dbus-manager.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/calls-dbus-manager.c b/src/calls-dbus-manager.c index 0482f5e..439835e 100644 --- a/src/calls-dbus-manager.c +++ b/src/calls-dbus-manager.c @@ -13,6 +13,7 @@ #include "calls-call-dbus.h" #include "calls-dbus-manager.h" #include "calls-manager.h" +#include "calls-ui-call-data.h" /** * SECTION:calls-dbus-manager @@ -197,6 +198,20 @@ on_handle_call_silence (CallsDBusCallsCall *skeleton, } +static gboolean +from_call_to_cui_state (GBinding *binding, + const GValue *from_value, + GValue *to_value, + gpointer unused) +{ + CallsCallState call_state = (CallsCallState) g_value_get_uint (from_value); + CuiCallState cui_state = calls_call_state_to_cui_call_state (call_state); + g_value_set_uint (to_value, cui_state); + + return TRUE; +} + + static void call_added_cb (CallsDBusManager *self, CallsCall *call) { @@ -220,7 +235,8 @@ call_added_cb (CallsDBusManager *self, CallsCall *call) "object-signal::handle-send_dtmf", G_CALLBACK (on_handle_call_send_dtmf), call, "object_signal::handle-silence", G_CALLBACK (on_handle_call_silence), call, NULL); - g_object_bind_property (call, "state", iface, "state", G_BINDING_SYNC_CREATE); + g_object_bind_property_full (call, "state", iface, "state", G_BINDING_SYNC_CREATE, + from_call_to_cui_state, NULL, NULL, NULL); g_object_bind_property (call, "inbound", iface, "inbound", G_BINDING_SYNC_CREATE); g_object_bind_property (call, "id", iface, "id", G_BINDING_SYNC_CREATE); g_object_bind_property (call, "protocol", iface, "protocol", G_BINDING_SYNC_CREATE);