[Commits] [SCM] claws branch, master, updated. 4.2.0-39-g55619cef1
miras at claws-mail.org
miras at claws-mail.org
Tue Feb 6 22:58:14 UTC 2024
The branch, master has been updated
via 55619cef1418e3b8f1f88ac8923ae7c8e01e9335 (commit)
from 1608444ca48f8db3ec731805d330a5b13b05a6a3 (commit)
Summary of changes:
src/prefs_account.c | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
- Log -----------------------------------------------------------------
commit 55619cef1418e3b8f1f88ac8923ae7c8e01e9335
Author: Michael Rasmussen <mir at datanom.net>
Date: Tue Feb 6 23:58:03 2024 +0100
Fix bug #4765 oauth2: only store smtp auth if authorization method is OAUTH2 fix bug #4766 oauth2: preserve the expiry value of SMTP auth type is not OAUTH2 patches by Olaf Hering
Signed-off-by: Michael Rasmussen <mir at datanom.net>
diff --git a/src/prefs_account.c b/src/prefs_account.c
index 6f7664281..b9a14c2a8 100644
--- a/src/prefs_account.c
+++ b/src/prefs_account.c
@@ -3722,7 +3722,8 @@ static gint prefs_send_apply(void)
FALSE);
#ifdef USE_OAUTH2
/* Manual password change - reset expiry on OAUTH2 tokens*/
- passwd_store_set_account(tmp_ac_prefs.account_id, PWS_ACCOUNT_OAUTH2_EXPIRY, "0", FALSE);
+ if (tmp_ac_prefs.use_smtp_auth && tmp_ac_prefs.smtp_auth_type == SMTPAUTH_OAUTH2)
+ passwd_store_set_account(tmp_ac_prefs.account_id, PWS_ACCOUNT_OAUTH2_EXPIRY, "0", FALSE);
#endif
return 0;
@@ -5260,13 +5261,14 @@ static void prefs_account_oauth2_obtain_tokens(GtkButton *button, gpointer data)
if(OAUTH2Data->access_token != NULL){
passwd_store_set_account(tmp_ac_prefs.account_id,
PWS_ACCOUNT_RECV, OAUTH2Data->access_token, FALSE);
+ gtk_entry_set_text(GTK_ENTRY(basic_page.pass_entry), OAUTH2Data->access_token);
- passwd_store_set_account(tmp_ac_prefs.account_id,
- PWS_ACCOUNT_SEND, OAUTH2Data->access_token, FALSE);
+ if (tmp_ac_prefs.use_smtp_auth && tmp_ac_prefs.smtp_auth_type == SMTPAUTH_OAUTH2) {
+ passwd_store_set_account(tmp_ac_prefs.account_id,
+ PWS_ACCOUNT_SEND, OAUTH2Data->access_token, FALSE);
+ gtk_entry_set_text(GTK_ENTRY(send_page.smtp_pass_entry), OAUTH2Data->access_token);
+ }
log_message(LOG_PROTOCOL, "OAuth2 access token stored\n");
-
- gtk_entry_set_text(GTK_ENTRY(basic_page.pass_entry), OAUTH2Data->access_token);
- gtk_entry_set_text(GTK_ENTRY(send_page.smtp_pass_entry), OAUTH2Data->access_token);
}
if(OAUTH2Data->expiry_str != NULL){
@@ -6210,10 +6212,11 @@ static void prefs_account_oauth2_callback(GObject *source, GAsyncResult *res, gp
PWS_ACCOUNT_RECV,
oauth2_listener_data->OAUTH2Data->access_token,
FALSE);
- passwd_store_set_account(tmp_ac_prefs.account_id,
- PWS_ACCOUNT_SEND,
- oauth2_listener_data->OAUTH2Data->access_token,
- FALSE);
+ if (tmp_ac_prefs.use_smtp_auth && tmp_ac_prefs.smtp_auth_type == SMTPAUTH_OAUTH2)
+ passwd_store_set_account(tmp_ac_prefs.account_id,
+ PWS_ACCOUNT_SEND,
+ oauth2_listener_data->OAUTH2Data->access_token,
+ FALSE);
log_message(LOG_PROTOCOL, "OAuth2 access token stored\n");
}
-----------------------------------------------------------------------
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list