[telepathy-gabble/telepathy-gabble-0.8] gabble_file_transfer_channel_provide_file: check that the channel is in the pending or accepted state

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Mon Sep 14 04:22:24 PDT 2009


This fix the second part of fd.o #23903.
---
 src/ft-channel.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/ft-channel.c b/src/ft-channel.c
index 650e108..4c5f407 100644
--- a/src/ft-channel.c
+++ b/src/ft-channel.c
@@ -1500,6 +1500,15 @@ gabble_file_transfer_channel_provide_file (
       return;
     }
 
+  if (self->priv->state != TP_FILE_TRANSFER_STATE_PENDING &&
+      self->priv->state != TP_FILE_TRANSFER_STATE_ACCEPTED)
+    {
+      g_set_error (&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
+        "State is not pending or accepted; cannot provide file");
+      dbus_g_method_return_error (context, error);
+      return;
+    }
+
   if (self->priv->socket_address != NULL)
     {
       g_set_error (&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
-- 
1.5.6.5




More information about the telepathy-commits mailing list