[Commits] [SCM] claws branch, gtk3, updated. 3.99.0-86-ge21b57971
wwp at claws-mail.org
wwp at claws-mail.org
Fri Apr 16 21:57:49 CEST 2021
The branch, gtk3 has been updated
via e21b5797113712a1f19c1969e9ea602fb9073dc8 (commit)
from b56c85f8f8952cec1b83d60e7990a43c7f32902f (commit)
Summary of changes:
src/oauth2.c | 50 +++++++++++++++++++++++++-------------------------
src/prefs_account.c | 10 +++++-----
src/prefs_account.h | 2 +-
src/prefs_migration.c | 2 +-
4 files changed, 32 insertions(+), 32 deletions(-)
- Log -----------------------------------------------------------------
commit e21b5797113712a1f19c1969e9ea602fb9073dc8
Author: wwp <subscript at free.fr>
Date: Fri Apr 16 21:57:43 2021 +0200
Replace OAUTH2 with OAuth2 in the UI when it's not protocol codes.
diff --git a/src/oauth2.c b/src/oauth2.c
index a70eb4538..2ee5e3eda 100644
--- a/src/oauth2.c
+++ b/src/oauth2.c
@@ -235,13 +235,13 @@ int oauth2_obtain_tokens (Oauth2Service provider, OAUTH2Data *OAUTH2Data, const
token = oauth2_get_token_from_response(provider, authcode);
debug_print("Auth token: %s\n", token);
if (token == NULL) {
- log_message(LOG_PROTOCOL, "OAUTH2 missing authentication code\n");
+ log_message(LOG_PROTOCOL, "OAuth2 missing authentication code\n");
return (1);
}
sock = sock_connect(OAUTH2info[i][OA2_BASE_URL], 443);
if (sock == NULL) {
- log_message(LOG_PROTOCOL, "OAUTH2 connecion error\n");
+ log_message(LOG_PROTOCOL, "OAuth2 connecion error\n");
g_free(token);
return (1);
}
@@ -250,7 +250,7 @@ int oauth2_obtain_tokens (Oauth2Service provider, OAUTH2Data *OAUTH2Data, const
sock_set_io_timeout(10);
sock->gnutls_priority = "NORMAL:!VERS-SSL3.0:!VERS-TLS1.0:!VERS-TLS1.1";
if (ssl_init_socket(sock) == FALSE) {
- log_message(LOG_PROTOCOL, "OAUTH2 SSL connecion error\n");
+ log_message(LOG_PROTOCOL, "OAuth2 SSL connecion error\n");
g_free(token);
return (1);
}
@@ -308,18 +308,18 @@ int oauth2_obtain_tokens (Oauth2Service provider, OAUTH2Data *OAUTH2Data, const
OAUTH2Data->expiry = expiry;
OAUTH2Data->expiry_str = g_strdup_printf ("%i", expiry);
ret = 0;
- log_message(LOG_PROTOCOL, "OAUTH2 access token obtained\n");
+ log_message(LOG_PROTOCOL, "OAuth2 access token obtained\n");
}else{
- log_message(LOG_PROTOCOL, "OAUTH2 access token not obtained\n");
- debug_print("OAUTH2 - request: %s\n Response: %s", request, response);
+ log_message(LOG_PROTOCOL, "OAuth2 access token not obtained\n");
+ debug_print("OAuth2 - request: %s\n Response: %s", request, response);
ret = 1;
}
if(oauth2_filter_refresh (response, refresh_token) == 0){
OAUTH2Data->refresh_token = refresh_token;
- log_message(LOG_PROTOCOL, "OAUTH2 refresh token obtained\n");
+ log_message(LOG_PROTOCOL, "OAuth2 refresh token obtained\n");
}else{
- log_message(LOG_PROTOCOL, "OAUTH2 refresh token not obtained\n");
+ log_message(LOG_PROTOCOL, "OAuth2 refresh token not obtained\n");
}
sock_close(sock, TRUE);
@@ -356,7 +356,7 @@ gint oauth2_use_refresh_token (Oauth2Service provider, OAUTH2Data *OAUTH2Data)
sock = sock_connect(OAUTH2info[i][OA2_BASE_URL], 443);
if (sock == NULL) {
- log_message(LOG_PROTOCOL, "OAUTH2 connecion error\n");
+ log_message(LOG_PROTOCOL, "OAuth2 connecion error\n");
return (1);
}
sock->ssl_cert_auto_accept = TRUE;
@@ -364,7 +364,7 @@ gint oauth2_use_refresh_token (Oauth2Service provider, OAUTH2Data *OAUTH2Data)
sock_set_io_timeout(10);
sock->gnutls_priority = "NORMAL:!VERS-SSL3.0:!VERS-TLS1.0:!VERS-TLS1.1";
if (ssl_init_socket(sock) == FALSE) {
- log_message(LOG_PROTOCOL, "OAUTH2 SSL connecion error\n");
+ log_message(LOG_PROTOCOL, "OAuth2 SSL connecion error\n");
return (1);
}
@@ -415,15 +415,15 @@ gint oauth2_use_refresh_token (Oauth2Service provider, OAUTH2Data *OAUTH2Data)
OAUTH2Data->expiry = expiry;
OAUTH2Data->expiry_str = g_strdup_printf ("%i", expiry);
ret = 0;
- log_message(LOG_PROTOCOL, "OAUTH2 access token obtained\n");
+ log_message(LOG_PROTOCOL, "OAuth2 access token obtained\n");
}else{
- log_message(LOG_PROTOCOL, "OAUTH2 access token not obtained\n");
- debug_print("OAUTH2 - request: %s\n Response: %s", request, response);
+ log_message(LOG_PROTOCOL, "OAuth2 access token not obtained\n");
+ debug_print("OAuth2 - request: %s\n Response: %s", request, response);
ret = 1;
}
- debug_print("OAUTH2 - access token: %s\n", access_token);
- debug_print("OAUTH2 - access token expiry: %i\n", expiry);
+ debug_print("OAuth2 - access token: %s\n", access_token);
+ debug_print("OAuth2 - access token expiry: %i\n", expiry);
sock_close(sock, TRUE);
g_free(body);
@@ -449,7 +449,7 @@ static gint oauth2_contact_server (SockInfo *sock, gchar *request, gchar *respon
startplus += 10;
if (sock_write (sock, request, len+1) < 0) {
- log_message(LOG_PROTOCOL, "OAUTH2 socket write error\n");
+ log_message(LOG_PROTOCOL, "OAuth2 socket write error\n");
return (1);
}
@@ -469,7 +469,7 @@ static gint oauth2_contact_server (SockInfo *sock, gchar *request, gchar *respon
} while ((toread > 0) && (time(NULL) < startplus));
if(time(NULL) >= startplus)
- log_message(LOG_PROTOCOL, "OAUTH2 socket timeout error \n");
+ log_message(LOG_PROTOCOL, "OAuth2 socket timeout error \n");
g_free(token);
@@ -527,17 +527,17 @@ gint oauth2_check_passwds (PrefsAccount *ac_prefs)
expiry = atoi(passwd_store_get_account(ac_prefs->account_id, PWS_ACCOUNT_OAUTH2_EXPIRY));
if (expiry > (g_get_real_time () / G_USEC_PER_SEC)){
g_free(OAUTH2Data);
- log_message(LOG_PROTOCOL, "OAUTH2 access token still fresh\n");
+ log_message(LOG_PROTOCOL, "OAuth2 access token still fresh\n");
return (0);
}
}
if(passwd_store_has_password(PWS_ACCOUNT, uid, PWS_ACCOUNT_OAUTH2_REFRESH)) {
- log_message(LOG_PROTOCOL, "OAUTH2 obtaining access token using refresh token\n");
+ log_message(LOG_PROTOCOL, "OAuth2 obtaining access token using refresh token\n");
OAUTH2Data->refresh_token = passwd_store_get_account(ac_prefs->account_id, PWS_ACCOUNT_OAUTH2_REFRESH);
ret = oauth2_use_refresh_token (ac_prefs->oauth2_provider, OAUTH2Data);
}else if (passwd_store_has_password(PWS_ACCOUNT, uid, PWS_ACCOUNT_OAUTH2_AUTH)) {
- log_message(LOG_PROTOCOL, "OAUTH2 trying for fresh access token with auth code\n");
+ log_message(LOG_PROTOCOL, "OAuth2 trying for fresh access token with auth code\n");
ret = oauth2_obtain_tokens (ac_prefs->oauth2_provider, OAUTH2Data,
passwd_store_get_account(ac_prefs->account_id, PWS_ACCOUNT_OAUTH2_AUTH));
}else{
@@ -545,13 +545,13 @@ gint oauth2_check_passwds (PrefsAccount *ac_prefs)
}
if (ret){
- log_message(LOG_PROTOCOL, "OAUTH2 access token not obtained\n");
+ log_message(LOG_PROTOCOL, "OAuth2 access token not obtained\n");
}else{
passwd_store_set_account(ac_prefs->account_id, PWS_ACCOUNT_RECV, OAUTH2Data->access_token, FALSE);
if (ac_prefs->use_smtp_auth && ac_prefs->smtp_auth_type == SMTPAUTH_OAUTH2)
passwd_store_set_account(ac_prefs->account_id, PWS_ACCOUNT_SEND, OAUTH2Data->access_token, FALSE);
passwd_store_set_account(ac_prefs->account_id, PWS_ACCOUNT_OAUTH2_EXPIRY, OAUTH2Data->expiry_str, FALSE);
- log_message(LOG_PROTOCOL, "OAUTH2 access token updated\n");
+ log_message(LOG_PROTOCOL, "OAuth2 access token updated\n");
}
g_free(OAUTH2Data);
@@ -582,9 +582,9 @@ void oauth2_encode(const gchar *in)
result = g_base64_encode(tmp, len);
tmp2 = oauth2_decode(result);
- log_message(LOG_PROTOCOL, "OAUTH2 original: %s\n", in);
- log_message(LOG_PROTOCOL, "OAUTH2 encoded: %s\n", result);
- log_message(LOG_PROTOCOL, "OAUTH2 decoded: %s\n\n", tmp2);
+ log_message(LOG_PROTOCOL, "OAuth2 original: %s\n", in);
+ log_message(LOG_PROTOCOL, "OAuth2 encoded: %s\n", result);
+ log_message(LOG_PROTOCOL, "OAuth2 decoded: %s\n\n", tmp2);
g_free(tmp);
g_free(tmp2);
diff --git a/src/prefs_account.c b/src/prefs_account.c
index 29fa68b09..57f654e31 100644
--- a/src/prefs_account.c
+++ b/src/prefs_account.c
@@ -1629,7 +1629,7 @@ static void receive_create_widget_func(PrefsPage * _page,
COMBOBOX_ADD (menu2, _("Select"), 0);
COMBOBOX_ADD (menu2, NULL, 0);
COMBOBOX_ADD (menu2, "APOP", POPAUTH_APOP);
- COMBOBOX_ADD (menu2, "OAUTH2", POPAUTH_OAUTH2);
+ COMBOBOX_ADD (menu2, "OAuth2", POPAUTH_OAUTH2);
SET_TOGGLE_SENSITIVITY (pop_auth_checkbtn, vbox5);
@@ -4099,7 +4099,7 @@ static void register_oauth2_page(void)
static gchar *path[3];
path[0] = _("Account");
- path[1] = _("OAUTH2");
+ path[1] = _("OAuth2");
path[2] = NULL;
oauth2_page.page.path = path;
@@ -5154,7 +5154,7 @@ static void prefs_account_oauth2_obtain_tokens(GtkButton *button, gpointer data)
PWS_ACCOUNT_OAUTH2_REFRESH,
OAUTH2Data->refresh_token,
FALSE);
- log_message(LOG_PROTOCOL, "OAUTH2 refresh token stored\n");
+ log_message(LOG_PROTOCOL, "OAuth2 refresh token stored\n");
}
if(OAUTH2Data->access_token != NULL){
@@ -5167,7 +5167,7 @@ static void prefs_account_oauth2_obtain_tokens(GtkButton *button, gpointer data)
PWS_ACCOUNT_SEND,
OAUTH2Data->access_token,
FALSE);
- log_message(LOG_PROTOCOL, "OAUTH2 access token stored\n");
+ 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);
@@ -5178,7 +5178,7 @@ static void prefs_account_oauth2_obtain_tokens(GtkButton *button, gpointer data)
PWS_ACCOUNT_OAUTH2_EXPIRY,
OAUTH2Data->expiry_str,
FALSE);
- log_message(LOG_PROTOCOL, "OAUTH2 access token expiry stored\n");
+ log_message(LOG_PROTOCOL, "OAuth2 access token expiry stored\n");
}
tmp_ac_prefs.oauth2_date = g_get_real_time () / G_USEC_PER_SEC;
diff --git a/src/prefs_account.h b/src/prefs_account.h
index 9995a764e..3d6266760 100644
--- a/src/prefs_account.h
+++ b/src/prefs_account.h
@@ -136,7 +136,7 @@ struct _PrefsAccount
GSList *customhdr_list;
- /* OAUTH2 */
+ /* OAuth2 */
gint oauth2_provider;
gint oauth2_date;
gchar *oauth2_authcode;
diff --git a/src/prefs_migration.c b/src/prefs_migration.c
index 1a2f84d48..b83560a29 100644
--- a/src/prefs_migration.c
+++ b/src/prefs_migration.c
@@ -144,7 +144,7 @@ static void _update_config_account(PrefsAccount *ac_prefs, gint version)
break;
case 3:
- /* With the introduction of OAUTH2 support, the APOP option
+ /* With the introduction of OAuth2 support, the APOP option
* (use_apop_auth) has been swallowed into a combobox and
* renamed */
if (ac_prefs->use_apop_auth == 1) {
-----------------------------------------------------------------------
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list