[Commits] [SCM] claws branch, gtk3, updated. 3.99.0-107-gd748311c0

paul at claws-mail.org paul at claws-mail.org
Sat Jul 3 10:13:50 CEST 2021


The branch, gtk3 has been updated
       via  d748311c09ebf123412c0d6955770adb2d38e45e (commit)
      from  269272f847ccc994adb47603e9def83ee89dcd4f (commit)

Summary of changes:
 po/POTFILES.in |  1 +
 src/oauth2.c   | 42 +++++++++++++++++++++---------------------
 2 files changed, 22 insertions(+), 21 deletions(-)


- Log -----------------------------------------------------------------
commit d748311c09ebf123412c0d6955770adb2d38e45e
Author: Paul <paul at claws-mail.org>
Date:   Sat Jul 3 09:04:43 2021 +0100

    enable translation of oauth2 strings

diff --git a/po/POTFILES.in b/po/POTFILES.in
index 78b71b291..decb74bfb 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -85,6 +85,7 @@ src/mh_gtk.c
 src/mimeview.c
 src/news.c
 src/news_gtk.c
+src/oauth2.c
 src/password.c
 src/password_gtk.c
 src/plugins/acpi_notifier/acpi_notifier.c
diff --git a/src/oauth2.c b/src/oauth2.c
index c5452d31e..8059b01ab 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 connection 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 connection 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");
+	  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 connection 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 connection error\n"));
                 return (1);
         }
 
@@ -415,9 +415,9 @@ 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");
+	  log_message(LOG_PROTOCOL, _("OAuth2 access token not obtained\n"));
 	  debug_print("OAuth2 - request: %s\n Response: %s", request, response);
 	  ret = 1;
 	}
@@ -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);
 	
@@ -525,17 +525,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{
@@ -543,13 +543,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);
@@ -580,9 +580,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);

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list