[Commits] [SCM] claws branch, master, updated. 4.1.0-37-gd65f9fb28
mones at claws-mail.org
mones at claws-mail.org
Wed Jun 8 23:14:11 UTC 2022
The branch, master has been updated
via d65f9fb28f367f0274524fb59b10f72f9e9eb401 (commit)
from 6ff340cb7ec7cfb1dd2761b8d72acb3b39e479e5 (commit)
Summary of changes:
src/prefs_account.c | 24 +++++++++++++++++-------
1 file changed, 17 insertions(+), 7 deletions(-)
- Log -----------------------------------------------------------------
commit d65f9fb28f367f0274524fb59b10f72f9e9eb401
Author: Ricardo Mones <ricardo at mones.org>
Date: Thu Jun 9 01:13:07 2022 +0200
Make OAuth2 displayed results translatable…
…and remove artificial limits to accommodate translations.
diff --git a/src/prefs_account.c b/src/prefs_account.c
index 33e4b0d2d..66ed597d8 100644
--- a/src/prefs_account.c
+++ b/src/prefs_account.c
@@ -6003,8 +6003,10 @@ static void prefs_account_oauth2_listener(GTask *task, gpointer source, gpointer
int client_sock, c;
struct sockaddr_in server , client;
char client_message[2000];
- char reply[600];
- char reply_message[400];
+ char *reply;
+ char *reply_message;
+ char *title;
+ char *body;
fd_set rfds;
gint ret = 1;
struct timeval timeout;
@@ -6072,15 +6074,23 @@ static void prefs_account_oauth2_listener(GTask *task, gpointer source, gpointer
if(!ret){
oauth2_listener_data->success = TRUE;
- sprintf(reply_message, "<html><body><h1>Authorisation complete</h1><p>Your oauth2 authorisation code has been received by Claws Mail</p></body></html>");
+ title = _("Authorisation complete");
+ body = _("Your OAuth2 authorisation code has been received by Claws Mail");
}else{
//Something went wrong
- log_message(LOG_PROTOCOL, "oauth2 authorisation code not received\n");
- sprintf(reply_message, "<html><body><h1>Authorisation NOT completed</h1><p>Your authorisation code was not received by Claws Mail</p></body></html>");
+ title = _("Authorisation NOT completed");
+ body = _("Your OAuth2 authorisation code was not received by Claws Mail");
+ log_message(LOG_PROTOCOL, "OAuth2 authorisation code not received\n");
}
-
- sprintf(reply, "HTTP/1.0 200 OK\r\nContent-Type: text/html\r\nContent-Length: %lu\r\n\r\n%s", strlen(reply_message), reply_message);
+ reply_message = g_strconcat("<html><head><title>", title,
+ "</title><meta charset=\"utf-8\"></head><body><h1>", title,
+ "</h1><p>", body, "</p></body></html>", NULL);
+ reply = g_strdup_printf(
+ "HTTP/1.0 200 OK\r\nContent-Type: text/html\r\nContent-Length: %lu\r\n\r\n%s",
+ strlen(reply_message), reply_message);
+ g_free(reply_message);
write(client_sock, reply, strlen(reply));
+ g_free(reply);
close(client_sock);
}
}while(ret && !oauth2_listener_cancel);
-----------------------------------------------------------------------
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list