[Telepathy-commits] [telepathy-gabble/master] MediaChannel: return DBus error for incomplete stream requests when channel is dispose

Senko Rasic senko.rasic at collabora.co.uk
Fri Dec 5 03:28:56 PST 2008


---
 src/media-channel.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/media-channel.c b/src/media-channel.c
index 23210b4..8fb78fc 100644
--- a/src/media-channel.c
+++ b/src/media-channel.c
@@ -1479,6 +1479,15 @@ destroy_request (struct _delayed_request_streams_ctx *ctx,
     g_signal_handler_disconnect (priv->conn->presence_cache,
         ctx->caps_disco_id);
 
+  if (ctx->context != NULL)
+    {
+      GError *error = NULL;
+      g_set_error (&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
+          "cannot add streams: peer has insufficient caps");
+      dbus_g_method_return_error (ctx->context, error);
+      g_error_free (error);
+    }
+
   g_array_free (ctx->types, TRUE);
   g_slice_free (struct _delayed_request_streams_ctx, ctx);
   g_ptr_array_remove_fast (priv->delayed_request_streams, ctx);
@@ -1501,6 +1510,7 @@ repeat_request (struct _delayed_request_streams_ctx *ctx)
       ctx->contact_handle, ctx->types, ctx->context);
 
   ctx->timeout_id = 0;
+  ctx->context = NULL;
   destroy_request (ctx, NULL);
   return FALSE;
 }
-- 
1.5.6.5




More information about the Telepathy-commits mailing list