diff options
author | Sjoerd Simons <sjoerd.simons@collabora.co.uk> | 2011-03-14 20:14:13 +0800 |
---|---|---|
committer | Sjoerd Simons <sjoerd.simons@collabora.co.uk> | 2011-03-14 20:14:13 +0800 |
commit | b159d5e210b2ffd38d6c0d59f5758e58e7054969 (patch) | |
tree | 7706d1fa31ded8399fa7768762b2321dcd03703b | |
parent | 8e5dd810b778a722b0f7d0b8d233ff187547cbbf (diff) | |
download | gsoc2013-empathy-b159d5e210b2ffd38d6c0d59f5758e58e7054969.tar gsoc2013-empathy-b159d5e210b2ffd38d6c0d59f5758e58e7054969.tar.gz gsoc2013-empathy-b159d5e210b2ffd38d6c0d59f5758e58e7054969.tar.bz2 gsoc2013-empathy-b159d5e210b2ffd38d6c0d59f5758e58e7054969.tar.lz gsoc2013-empathy-b159d5e210b2ffd38d6c0d59f5758e58e7054969.tar.xz gsoc2013-empathy-b159d5e210b2ffd38d6c0d59f5758e58e7054969.tar.zst gsoc2013-empathy-b159d5e210b2ffd38d6c0d59f5758e58e7054969.zip |
Monitor the call state and close the channel when it ends
-rw-r--r-- | src/empathy-call-handler.c | 17 |
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); |