[Telepathy-commits] [telepathy-glib/master] ExampleCallableMediaChannel: when there are no streams left, terminate the call

Simon McVittie simon.mcvittie at collabora.co.uk
Fri Mar 13 07:22:37 PDT 2009


---
 examples/cm/callable/media-channel.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/examples/cm/callable/media-channel.c b/examples/cm/callable/media-channel.c
index e8351d6..853b20d 100644
--- a/examples/cm/callable/media-channel.c
+++ b/examples/cm/callable/media-channel.c
@@ -778,6 +778,13 @@ stream_removed_cb (ExampleCallableMediaStream *stream,
       0, 0, NULL, NULL, self);
   g_hash_table_remove (self->priv->streams, GUINT_TO_POINTER (id));
   tp_svc_channel_type_streamed_media_emit_stream_removed (self, id);
+
+  if (g_hash_table_size (self->priv->streams) == 0)
+    {
+      /* no streams left, so the call terminates */
+      example_callable_media_channel_close (self, 0,
+          TP_CHANNEL_GROUP_CHANGE_REASON_NONE);
+    }
 }
 
 static void
-- 
1.5.6.5




More information about the telepathy-commits mailing list