From: Cosimo Cecchi Date: Sat, 23 May 2009 13:42:02 +0000 (+0200) Subject: Actually see if the connection is ready X-Git-Url: https://git.0d.be/?p=empathy.git;a=commitdiff_plain;h=b9c4083bc1c4924171bc0095d1489f6354534960 Actually see if the connection is ready Before appending an outstanding request for channel classes, verify thigns aren't actually ready. --- diff --git a/libempathy/empathy-dispatcher.c b/libempathy/empathy-dispatcher.c index 04e248d2..1dc44b30 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;