diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-09-19 04:14:38 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-09-19 04:14:38 +0800 |
commit | 3e079da9b69b8f5c47c79bcbb269ac17cc094c6e (patch) | |
tree | 6971eef81db9bedf66efa452c56bbb648fb23efd /mail/mail-session.c | |
parent | 704f596da37cd037d8faeba35586ef281353b217 (diff) | |
download | gsoc2013-evolution-3e079da9b69b8f5c47c79bcbb269ac17cc094c6e.tar.gz gsoc2013-evolution-3e079da9b69b8f5c47c79bcbb269ac17cc094c6e.tar.zst gsoc2013-evolution-3e079da9b69b8f5c47c79bcbb269ac17cc094c6e.zip |
Pass a 'cache-me' argument to mail_get_password.
2001-09-18 Jeffrey Stedfast <fejj@ximian.com>
* 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
Diffstat (limited to 'mail/mail-session.c')
-rw-r--r-- | mail/mail-session.c | 15 |
1 files changed, 9 insertions, 6 deletions
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; } |