From ace512904be73e3e1865c22a9f837c0baa840a43 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Wed, 14 Nov 2001 18:36:14 +0000 Subject: Call e_passwords_remember_password() for account passwords if the user set 2001-11-13 Jeffrey Stedfast * mail-session.c (pass_got): Call e_passwords_remember_password() for account passwords if the user set the "remember password" checkbox. svn path=/trunk/; revision=14696 --- mail/mail-session.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'mail/mail-session.c') diff --git a/mail/mail-session.c b/mail/mail-session.c index b9449033eb..f8265a12ea 100644 --- a/mail/mail-session.c +++ b/mail/mail-session.c @@ -177,14 +177,14 @@ static void pass_got (char *string, void *data) { struct _pass_msg *m = data; - + if (string) { MailConfigService *service = NULL; const MailConfigAccount *mca; - gboolean remember; + gboolean cache, remember; m->result = g_strdup (string); - remember = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (m->check)); + remember = cache = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (m->check)); if (m->service_url) { mca = mail_config_get_account_by_source_url (m->service_url); if (mca) { @@ -196,17 +196,26 @@ pass_got (char *string, void *data) } if (service) { - mail_config_service_set_save_passwd (service, remember); + mail_config_service_set_save_passwd (service, cache); - /* set `remember' to TRUE because people don't want to have to + /* set `cache' to TRUE because people don't want to have to re-enter their passwords for this session even if they told us not to cache their passwords in the dialog...*sigh* */ - remember = TRUE; + cache = TRUE; } + } else { + /* we can't remember the password if it isn't for an account (pgp?) */ + remember = FALSE; } - if (remember) - e_passwords_add_password(m->key, m->result); + if (cache) { + /* cache the password for the session */ + e_passwords_add_password (m->key, m->result); + + /* should we remember it between sessions? */ + if (remember) + e_passwords_remember_password (m->key); + } } else { camel_exception_set(m->ex, CAMEL_EXCEPTION_USER_CANCEL, _("User canceled operation.")); } -- cgit