return pwd;
}
+void
+modest_tny_account_store_forget_already_asked (ModestTnyAccountStore *self, TnyAccount *account)
+{
+ g_return_if_fail (account);
+
+ ModestTnyAccountStorePrivate *priv;
+ gchar *pwd = NULL;
+ gpointer pwd_ptr = NULL;
+ gboolean already_asked = FALSE;
+
+ const gchar *server_account_name = tny_account_get_id (account);
+
+ priv = MODEST_TNY_ACCOUNT_STORE_GET_PRIVATE(self);
+
+ /* This hash map stores passwords, including passwords that are not stored in gconf. */
+ pwd_ptr = (gpointer)&pwd; /* pwd_ptr so the compiler does not complained about
+ * type-punned ptrs...*/
+ already_asked = priv->password_hash &&
+ g_hash_table_lookup_extended (priv->password_hash,
+ server_account_name,
+ NULL,
+ (gpointer*)&pwd_ptr);
+
+ if (already_asked) {
+ g_hash_table_remove (priv->password_hash, server_account_name);
+ g_free (pwd);
+ pwd = NULL;
+ }
+
+ return;
+}
+
/* tinymail calls this if the connection failed due to an incorrect password.
* And it seems to call this for any general connection failure. */
static void
**/
TnyAccount * modest_tny_account_store_get_local_folders_account (ModestTnyAccountStore *self);
+/** modest_tny_account_store_forget_already_asked:
+ * @self: a TnyAccountStore instance
+ * @account: the account to forget the already asked status for
+ *
+ * Forget the already asked status of an account
+ **/
+void modest_tny_account_store_forget_already_asked (ModestTnyAccountStore *self, TnyAccount *account);
+
+
G_END_DECLS
#endif /* __MODEST_TNY_ACCOUNT_STORE_H__ */
/* 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");
}