[empathy: 119/148] Actually see if the connection is ready



commit b9c4083bc1c4924171bc0095d1489f6354534960
Author: Cosimo Cecchi <cosimo cecchi collabora co uk>
Date:   Sat May 23 15:42:02 2009 +0200

    Actually see if the connection is ready
    
    Before appending an outstanding request for channel classes, verify
    thigns aren't actually ready.
---
 libempathy/empathy-dispatcher.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/libempathy/empathy-dispatcher.c b/libempathy/empathy-dispatcher.c
index 04e248d..1dc44b3 100644
--- a/libempathy/empathy-dispatcher.c
+++ b/libempathy/empathy-dispatcher.c
@@ -1432,13 +1432,22 @@ find_channel_class_idle_cb (gpointer user_data)
   GStrv retval;
   GList *requests;
   FindChannelRequest *request = user_data;
+  ConnectionData *cd;
+  gboolean is_ready = TRUE;
   EmpathyDispatcherPriv *priv = GET_PRIV (request->dispatcher);
 
-  retval = empathy_dispatcher_find_channel_class (request->dispatcher,
-      request->connection, request->channel_type, request->handle_type);
+  cd = g_hash_table_lookup (priv->connections, request->connection);
+
+  if (cd == NULL)
+    is_ready = FALSE;
+  else if (cd->requestable_channels == NULL)
+    is_ready = FALSE;
 
-  if (retval)
+  if (is_ready)
     {
+      retval = empathy_dispatcher_find_channel_class (request->dispatcher,
+          request->connection, request->channel_type, request->handle_type);
+
       request->callback (retval, request->user_data);
       free_find_channel_request (request);
       return FALSE;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]