]> git.0d.be Git - empathy.git/commitdiff
Actually see if the connection is ready
authorCosimo Cecchi <cosimo.cecchi@collabora.co.uk>
Sat, 23 May 2009 13:42:02 +0000 (15:42 +0200)
committerCosimo Cecchi <cosimoc@gnome.org>
Mon, 1 Jun 2009 15:53:23 +0000 (17:53 +0200)
Before appending an outstanding request for channel classes, verify
thigns aren't actually ready.

libempathy/empathy-dispatcher.c

index 04e248d2d97e128feef7ec70b327563b2dbce1c8..1dc44b309151d91b1b043981b20dd4cb42fefe51 100644 (file)
@@ -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;