From 3e079da9b69b8f5c47c79bcbb269ac17cc094c6e Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Tue, 18 Sep 2001 20:14:38 +0000 Subject: Pass a 'cache-me' argument to mail_get_password. 2001-09-18 Jeffrey Stedfast * mail-session.c (get_password): Pass a 'cache-me' argument to mail_get_password. * mail-mt.c (pass_got): Make less confusing... (mail_get_password): Now takes an argument 'cache' that allows our caller to determine if the user wanted to cache his/her password or not. (pass_got): Set the cache option. svn path=/trunk/; revision=12950 --- mail/mail-session.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'mail/mail-session.c') diff --git a/mail/mail-session.c b/mail/mail-session.c index 25490b5984..d3e06419c2 100644 --- a/mail/mail-session.c +++ b/mail/mail-session.c @@ -152,16 +152,17 @@ get_password (CamelSession *session, const char *prompt, gboolean secret, CamelService *service, const char *item, CamelException *ex) { MailSession *mail_session = MAIL_SESSION (session); + gboolean cache = TRUE; char *key, *ans; - - if (!strcmp(item, "popb4smtp_uri")) { + + if (!strcmp (item, "popb4smtp_uri")) { char *url = camel_url_to_string(service->url, 0); const MailConfigAccount *account = mail_config_get_account_by_transport_url(url); - + g_free(url); if (account == NULL) return NULL; - + return g_strdup(account->source->url); } @@ -176,14 +177,16 @@ get_password (CamelSession *session, const char *prompt, gboolean secret, } if (!mail_session->interaction_enabled || - !(ans = mail_get_password (service, prompt, secret))) { + !(ans = mail_get_password (service, prompt, secret, &cache))) { g_free (key); camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL, _("User canceled operation.")); return NULL; } - g_hash_table_insert (mail_session->passwords, key, g_strdup (ans)); + if (cache) + g_hash_table_insert (mail_session->passwords, key, g_strdup (ans)); + return ans; } -- cgit