[Telepathy-commits] [telepathy-glib/master] ExampleCallableMediaChannel: make RequestStreams fail for wrong handles

Simon McVittie simon.mcvittie at collabora.co.uk
Thu Mar 12 10:31:09 PDT 2009


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

diff --git a/examples/cm/callable/media-channel.c b/examples/cm/callable/media-channel.c
index f3e9a32..7179c28 100644
--- a/examples/cm/callable/media-channel.c
+++ b/examples/cm/callable/media-channel.c
@@ -793,6 +793,14 @@ media_request_streams (TpSvcChannelTypeStreamedMedia *iface,
   if (!tp_handle_is_valid (contact_repo, contact_handle, &error))
     goto error;
 
+  if (contact_handle != self->priv->handle)
+    {
+      g_set_error (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
+          "This channel is for handle #%u, we can't make a stream to #%u",
+          self->priv->handle, contact_handle);
+      goto error;
+    }
+
   for (i = 0; i < media_types->len; i++)
     {
       guint media_type = g_array_index (media_types, guint, i);
-- 
1.5.6.5




More information about the telepathy-commits mailing list