aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2011-03-14 20:14:13 +0800
committerEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-06-09 17:20:07 +0800
commita1e3e5d9510ede8853fd74ff53ac3ecb7f1c141f (patch)
tree2cd90c0d57c3e75565763f036389e9c29f351df3
parent5716e75e552c3e6431e5fc37169a9fa293cc80e6 (diff)
downloadgsoc2013-empathy-a1e3e5d9510ede8853fd74ff53ac3ecb7f1c141f.tar
gsoc2013-empathy-a1e3e5d9510ede8853fd74ff53ac3ecb7f1c141f.tar.gz
gsoc2013-empathy-a1e3e5d9510ede8853fd74ff53ac3ecb7f1c141f.tar.bz2
gsoc2013-empathy-a1e3e5d9510ede8853fd74ff53ac3ecb7f1c141f.tar.lz
gsoc2013-empathy-a1e3e5d9510ede8853fd74ff53ac3ecb7f1c141f.tar.xz
gsoc2013-empathy-a1e3e5d9510ede8853fd74ff53ac3ecb7f1c141f.tar.zst
gsoc2013-empathy-a1e3e5d9510ede8853fd74ff53ac3ecb7f1c141f.zip
Monitor the call state and close the channel when it ends
-rw-r--r--src/empathy-call-handler.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/empathy-call-handler.c b/src/empathy-call-handler.c
index eeb13ba82..752405727 100644
--- a/src/empathy-call-handler.c
+++ b/src/empathy-call-handler.c
@@ -167,6 +167,18 @@ on_get_contacts_cb (TpConnection *connection,
}
static void
+on_call_state_changed_cb (TpyCallChannel *call,
+ TpyCallState state,
+ TpyCallFlags flags,
+ const GValueArray *call_state_reason,
+ GHashTable *call_state_details,
+ EmpathyCallHandler *handler)
+{
+ if (state == TPY_CALL_STATE_ENDED)
+ tp_channel_close_async (TP_CHANNEL (call), NULL, NULL);
+}
+
+static void
on_members_changed_cb (TpyCallChannel *call,
GHashTable *members,
EmpathyCallHandler *self)
@@ -233,7 +245,12 @@ empathy_call_handler_set_property (GObject *object,
priv->members = g_value_get_boxed (value);
break;
case PROP_CALL_CHANNEL:
+ g_return_if_fail (priv->call == NULL);
+
priv->call = g_value_dup_object (value);
+
+ tp_g_signal_connect_object (priv->call, "state-changed",
+ G_CALLBACK (on_call_state_changed_cb), object, 0);
break;
case PROP_INITIAL_AUDIO:
priv->initial_audio = g_value_get_boolean (value);