{
gboolean stop_trying = FALSE;
g_return_val_if_fail (data && data->account, FALSE);
{
gboolean stop_trying = FALSE;
g_return_val_if_fail (data && data->account, FALSE);
if (data && data->account &&
/* We want to wait until TNY_CONNECTION_STATUS_INIT has changed to something else,
* after which the account is likely to be usable, or never likely to be usable soon: */
(tny_account_get_connection_status (data->account) != TNY_CONNECTION_STATUS_INIT) )
{
data->is_online = TRUE;
if (data && data->account &&
/* We want to wait until TNY_CONNECTION_STATUS_INIT has changed to something else,
* after which the account is likely to be usable, or never likely to be usable soon: */
(tny_account_get_connection_status (data->account) != TNY_CONNECTION_STATUS_INIT) )
{
data->is_online = TRUE;
if (stop_trying) {
/* Allow the function that requested this idle callback to continue: */
if (data->loop)
g_main_loop_quit (data->loop);
if (stop_trying) {
/* Allow the function that requested this idle callback to continue: */
if (data->loop)
g_main_loop_quit (data->loop);