diff options
Diffstat (limited to 'libsylph')
| -rw-r--r-- | libsylph/imap.c | 23 | ||||
| -rw-r--r-- | libsylph/prefs_common.c | 6 | ||||
| -rw-r--r-- | libsylph/prefs_common.h | 3 |
3 files changed, 19 insertions, 13 deletions
diff --git a/libsylph/imap.c b/libsylph/imap.c index a61dc2b..0cd4409 100644 --- a/libsylph/imap.c +++ b/libsylph/imap.c | |||
| @@ -707,17 +707,17 @@ static gint imap_session_connect(IMAPSession *session) | |||
| 707 | log_message(_("creating IMAP4 connection to %s:%d ...\n"), | 707 | log_message(_("creating IMAP4 connection to %s:%d ...\n"), |
| 708 | SESSION(session)->server, SESSION(session)->port); | 708 | SESSION(session)->server, SESSION(session)->port); |
| 709 | 709 | ||
| 710 | if (account->master_password != NULL) { | 710 | if (prefs_common.use_master_password && account->master_password != NULL) { |
| 711 | if (decrypt_data(&pass, | 711 | if (decrypt_data(&pass, |
| 712 | account->passwd, | 712 | account->passwd, |
| 713 | account->master_password, | 713 | account->master_password, |
| 714 | strlen(account->passwd)) != RC_OK) { | 714 | strlen(account->passwd) + 1) != RC_OK) { |
| 715 | session_destroy(session); | 715 | session_destroy(session); |
| 716 | return -1; | 716 | return -1; |
| 717 | } | 717 | } |
| 718 | } else { | 718 | } else { |
| 719 | pass = account->passwd; | 719 | pass = account->passwd; |
| 720 | } | 720 | } |
| 721 | if (!pass) | 721 | if (!pass) |
| 722 | pass = account->tmp_pass; | 722 | pass = account->tmp_pass; |
| 723 | if (!pass) { | 723 | if (!pass) { |
| @@ -731,7 +731,6 @@ static gint imap_session_connect(IMAPSession *session) | |||
| 731 | account->tmp_pass = tmp_pass; | 731 | account->tmp_pass = tmp_pass; |
| 732 | pass = account->tmp_pass; | 732 | pass = account->tmp_pass; |
| 733 | } | 733 | } |
| 734 | |||
| 735 | if (account->use_socks && account->use_socks_for_recv && | 734 | if (account->use_socks && account->use_socks_for_recv && |
| 736 | account->proxy_host) { | 735 | account->proxy_host) { |
| 737 | socks_info = socks_info_new(account->socks_type, account->proxy_host, account->proxy_port, account->use_proxy_auth ? account->proxy_name : NULL, account->use_proxy_auth ? account->proxy_pass : NULL); | 736 | socks_info = socks_info_new(account->socks_type, account->proxy_host, account->proxy_port, account->use_proxy_auth ? account->proxy_name : NULL, account->use_proxy_auth ? account->proxy_pass : NULL); |
diff --git a/libsylph/prefs_common.c b/libsylph/prefs_common.c index 91814fd..68f72fa 100644 --- a/libsylph/prefs_common.c +++ b/libsylph/prefs_common.c | |||
| @@ -415,9 +415,13 @@ static PrefParam param[] = { | |||
| 415 | #ifdef G_OS_WIN32 | 415 | #ifdef G_OS_WIN32 |
| 416 | {"show_gpg_warning", "FALSE", &prefs_common.gpg_warning, P_BOOL}, | 416 | {"show_gpg_warning", "FALSE", &prefs_common.gpg_warning, P_BOOL}, |
| 417 | #else | 417 | #else |
| 418 | {"show_gpg_warning", "TRUE", &prefs_common.gpg_warning, P_BOOL}, | 418 | {"show_gpg_warning", "TRUE", &prefs_common.gpg_warning, P_BOOL}, |
| 419 | #endif | 419 | #endif |
| 420 | 420 | ||
| 421 | /* Master password */ | ||
| 422 | {"use_master_password", "FALSE", &prefs_common.use_master_password, | ||
| 423 | P_BOOL}, | ||
| 424 | |||
| 421 | /* Interface */ | 425 | /* Interface */ |
| 422 | {"separate_folder", "FALSE", &prefs_common.sep_folder, P_BOOL}, | 426 | {"separate_folder", "FALSE", &prefs_common.sep_folder, P_BOOL}, |
| 423 | {"separate_message", "FALSE", &prefs_common.sep_msg, P_BOOL}, | 427 | {"separate_message", "FALSE", &prefs_common.sep_msg, P_BOOL}, |
diff --git a/libsylph/prefs_common.h b/libsylph/prefs_common.h index 910f370..ef5bb9b 100644 --- a/libsylph/prefs_common.h +++ b/libsylph/prefs_common.h | |||
| @@ -249,6 +249,9 @@ struct _PrefsCommon | |||
| 249 | gboolean passphrase_grab; | 249 | gboolean passphrase_grab; |
| 250 | gboolean gpg_warning; | 250 | gboolean gpg_warning; |
| 251 | 251 | ||
| 252 | /* Master password */ | ||
| 253 | gboolean use_master_password; | ||
| 254 | |||
| 252 | /* Interface */ | 255 | /* Interface */ |
| 253 | gboolean sep_folder; | 256 | gboolean sep_folder; |
| 254 | gboolean sep_msg; | 257 | gboolean sep_msg; |
