- if (priv->pw_invalid==PW_NOT_INVALID) {
- retval = modest_account_mgr_get_string (priv->modest_acc_mgr,
- key,
- MODEST_ACCOUNT_PASSWORD,
- TRUE,
- NULL);
- } else {
- retval = priv->get_pass_func(account, prompt, cancel);
- if (!*cancel) {
- priv->pw_invalid=PW_NOT_INVALID;
- modest_account_mgr_set_string(priv->modest_acc_mgr,
- key,
- MODEST_ACCOUNT_PASSWORD,
- retval, TRUE,
- NULL);
- }
- }
- return retval;
+ /* is it in the hash? if it's already there, it must be wrong... */
+ already_asked = g_hash_table_lookup (priv->password_hash, key) != NULL;
+
+ /* if the password is not already there, try ModestConf */
+/* if (!already_asked) */
+ pwd = modest_account_mgr_get_string (priv->account_mgr,
+ key, MODEST_ACCOUNT_PASSWORD,
+ TRUE, NULL);
+
+/* /\* if it was already asked, it must have been wrong, so ask again *\/ */
+/* if (!already_asked || !pwd || strlen(pwd) == 0) { */
+
+/* /\* we don't have it yet. we emit a signal to get the password somewhere *\/ */
+/* const gchar* name = tny_account_get_name (account); */
+/* *cancel = TRUE; */
+/* pwd = NULL; */
+/* g_signal_emit (G_OBJECT(self), signals[PASSWORD_REQUESTED_SIGNAL], 0, */
+/* name, &pwd, cancel); */
+/* if (!*cancel) /\* remember the password *\/ */
+/* modest_account_mgr_set_string (priv->account_mgr, */
+/* key, MODEST_ACCOUNT_PASSWORD, */
+/* pwd, TRUE, NULL); */
+/* } else */
+/* *cancel = FALSE; */
+
+/* g_hash_table_insert (priv->password_hash, key, pwd); */
+
+ return pwd;