NULL);
TnyAccount *local_account = NULL;
-
+
/* The accounts have already been instantiated by
* modest_tny_account_store_get_accounts(), which is the
* TnyAccountStore::get_accounts_func() implementation,
static void
-set_online_callback (TnyCamelAccount *account, GError *err, gpointer user_data)
+set_online_callback (TnyCamelAccount *account, gboolean canceled, GError *err, gpointer user_data)
{
/* MODEST TODO: Show a real error message here, this is a significant error!
* Perhaps show the account's settings dialog again?! Reconnecting after
* changing the settings of an account failed in this situation. */
- if (err)
+ if (err && !canceled)
g_warning ("err: %s", err->message);
}
/* If the account was online, reconnect to apply the changes */
conn_status = tny_account_get_connection_status (tny_account);
if (conn_status != TNY_CONNECTION_STATUS_DISCONNECTED) {
+ TnyAccountStore *account_store = NULL;
/* The callback will have an error for you if the reconnect
* failed. Please handle it (this is TODO). */
+ account_store = TNY_ACCOUNT_STORE(g_object_get_data (G_OBJECT(tny_account),
+ "account_store"));
+
+ if (account_store) {
+ modest_tny_account_store_forget_already_asked (MODEST_TNY_ACCOUNT_STORE (account_store),
+ tny_account);
+ }
+
tny_camel_account_set_online (TNY_CAMEL_ACCOUNT(tny_account), TRUE,
set_online_callback, "online");
}