[Commits] [SCM] claws branch, gtk3, updated. 3.99.0-106-g269272f84
paul at claws-mail.org
paul at claws-mail.org
Fri Jul 2 13:39:08 CEST 2021
The branch, gtk3 has been updated
via 269272f847ccc994adb47603e9def83ee89dcd4f (commit)
from 88f72a3216b336abe186daf5a0d8821e87eb996e (commit)
Summary of changes:
src/oauth2.c | 18 ++++++--------
src/prefs_account.c | 70 ++++++++++++++++++++++-------------------------------
src/prefs_account.h | 5 ++--
3 files changed, 39 insertions(+), 54 deletions(-)
- Log -----------------------------------------------------------------
commit 269272f847ccc994adb47603e9def83ee89dcd4f
Author: paul <paul at claws-mail.org>
Date: Fri Jul 2 12:39:04 2021 +0100
custom client IDs only for oauth2
diff --git a/src/oauth2.c b/src/oauth2.c
index 2ee5e3eda..c5452d31e 100644
--- a/src/oauth2.c
+++ b/src/oauth2.c
@@ -45,8 +45,8 @@
static gchar *OAUTH2info[4][17]={
{"accounts.google.com",
- "G/jjil7/XHfv4mw90hhhFy5hRci8NeOF3w7QtX8hb9yljE+mU0/MvGk3G4RoUWK13phSIZ7+JSSg4R2f1RV2NbaT5DODMMt5",
- "cABm8Lx5PgnrUOOwNJSamcG8Nlj8g8go",
+ "",
+ ".",
"urn:ietf:wg:oauth:2.0:oob",
"/o/oauth2/auth",
"/o/oauth2/token",
@@ -62,7 +62,7 @@ static gchar *OAUTH2info[4][17]={
"",
""},
{"login.microsoftonline.com",
- "Srm4tajDIHKiu25KIxOlaqei+AJ8q/DPT7PNOhskKrzIjlGT",
+ "",
"",
"https://login.microsoftonline.com/common/oauth2/nativeclient",
"/common/oauth2/v2.0/authorize",
@@ -79,7 +79,7 @@ static gchar *OAUTH2info[4][17]={
"fragment",
""},
{"login.microsoftonline.com",
- "Srm4tajDIHKiu25KIxOlaqei+AJ8q/DPT7PNOhskKrzIjlGT",
+ "",
"",
"https://login.microsoftonline.com/common/oauth2/nativeclient",
"/common/oauth2/v2.0/authorize",
@@ -96,8 +96,8 @@ static gchar *OAUTH2info[4][17]={
"fragment",
""},
{"api.login.yahoo.com",
- "TTzJciHB9+id6C5eZ1lhRQJVGy8GNYh+iXh8nhiD3cofx5zi4xHLN7Y/IWASKh4Oy7cghOQCs8Q1kmKB2xRWlKP8/fFNXSBFNYpni83PHGUUKgbTYJUz+3/nLLOJASYf",
- "T/PyRkrw/ByaZ8mkn6aISpsXhci/fieo+ibj1aRkkqhUKqPKeeH7Xg==",
+ "",
+ ".",
"oob",
"/oauth2/request_auth",
"/oauth2/get_token",
@@ -518,10 +518,8 @@ gint oauth2_check_passwds (PrefsAccount *ac_prefs)
oauth2_init (OAUTH2Data);
- if (ac_prefs->oauth2_use_custom_id) {
- OAUTH2Data->custom_client_id = ac_prefs->oauth2_cust_client_id;
- OAUTH2Data->custom_client_secret = ac_prefs->oauth2_cust_client_secret;
- }
+ OAUTH2Data->custom_client_id = ac_prefs->oauth2_client_id;
+ OAUTH2Data->custom_client_secret = ac_prefs->oauth2_client_secret;
if(passwd_store_has_password(PWS_ACCOUNT, uid, PWS_ACCOUNT_OAUTH2_EXPIRY)) {
expiry = atoi(passwd_store_get_account(ac_prefs->account_id, PWS_ACCOUNT_OAUTH2_EXPIRY));
diff --git a/src/prefs_account.c b/src/prefs_account.c
index 048bf3d66..4ed506009 100644
--- a/src/prefs_account.c
+++ b/src/prefs_account.c
@@ -214,9 +214,8 @@ typedef struct Oauth2Page
GtkWidget *oauth2_link_button;
GtkWidget *oauth2_link_copy_button;
gpointer *protocol_optmenu;
- GtkWidget *oauth2_customid_checkbtn;
- GtkWidget *oauth2_cust_client_id_entry;
- GtkWidget *oauth2_cust_client_secret_entry;
+ GtkWidget *oauth2_client_id_entry;
+ GtkWidget *oauth2_client_secret_entry;
} Oauth2Page;
@@ -664,15 +663,11 @@ static PrefParam oauth2_param[] = {
{"oauth2_authcode", NULL, &tmp_ac_prefs.oauth2_authcode, P_PASSWORD,
NULL, NULL, NULL},
- {"oauth2_use_custom_id", "FALSE", &tmp_ac_prefs.oauth2_use_custom_id, P_BOOL,
- &oauth2_page.oauth2_customid_checkbtn,
- prefs_set_data_from_toggle, prefs_set_toggle},
-
- {"oauth2_cust_client_id", NULL, &tmp_ac_prefs.oauth2_cust_client_id, P_STRING,
- &oauth2_page.oauth2_cust_client_id_entry, prefs_set_data_from_entry, prefs_set_entry},
+ {"oauth2_client_id", NULL, &tmp_ac_prefs.oauth2_client_id, P_STRING,
+ &oauth2_page.oauth2_client_id_entry, prefs_set_data_from_entry, prefs_set_entry},
- {"oauth2_cust_client_secret", NULL, &tmp_ac_prefs.oauth2_cust_client_secret, P_STRING,
- &oauth2_page.oauth2_cust_client_secret_entry, prefs_set_data_from_entry, prefs_set_entry},
+ {"oauth2_client_secret", NULL, &tmp_ac_prefs.oauth2_client_secret, P_STRING,
+ &oauth2_page.oauth2_client_secret_entry, prefs_set_data_from_entry, prefs_set_entry},
{NULL, NULL, NULL, P_OTHER, NULL, NULL, NULL}
};
@@ -2187,9 +2182,8 @@ static void oauth2_create_widget_func(PrefsPage * _page,
GtkWidget *oauth2_auth_optmenu;
GtkWidget *oauth2_link_button;
GtkWidget *oauth2_link_copy_button;
- GtkWidget *oauth2_customid_checkbtn;
- GtkWidget *oauth2_cust_client_id_entry;
- GtkWidget *oauth2_cust_client_secret_entry;
+ GtkWidget *oauth2_client_id_entry;
+ GtkWidget *oauth2_client_secret_entry;
GtkWidget *table1;
GtkListStore *menu;
GtkTreeIter iter;
@@ -2246,10 +2240,7 @@ static void oauth2_create_widget_func(PrefsPage * _page,
vbox3 = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
gtk_widget_show (vbox3);
gtk_box_pack_start (GTK_BOX (auth_vbox), vbox3, FALSE, FALSE, 0);
-
- PACK_CHECK_BUTTON (vbox3, oauth2_customid_checkbtn,
- _("Use custom client details"));
-
+
vbox2 = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
gtk_widget_show (vbox2);
gtk_box_pack_start (GTK_BOX (vbox3), vbox2, FALSE, FALSE, 0);
@@ -2266,30 +2257,28 @@ static void oauth2_create_widget_func(PrefsPage * _page,
gtk_label_set_xalign(GTK_LABEL (label), 1.0);
gtk_grid_attach(GTK_GRID(table1), label, 0, 0, 1, 1);
- oauth2_cust_client_id_entry = gtk_entry_new ();
- gtk_widget_show (oauth2_cust_client_id_entry);
- gtk_grid_attach(GTK_GRID(table1), oauth2_cust_client_id_entry, 1, 0, 1, 1);
- gtk_widget_set_hexpand(oauth2_cust_client_id_entry, TRUE);
- gtk_widget_set_halign(oauth2_cust_client_id_entry, GTK_ALIGN_FILL);
+ oauth2_client_id_entry = gtk_entry_new();
+ gtk_widget_show (oauth2_client_id_entry);
+ gtk_grid_attach(GTK_GRID(table1), oauth2_client_id_entry, 1, 0, 1, 1);
+ gtk_widget_set_hexpand(oauth2_client_id_entry, TRUE);
+ gtk_widget_set_halign(oauth2_client_id_entry, GTK_ALIGN_FILL);
label = gtk_label_new (_("Client secret"));
gtk_widget_show (label);
gtk_label_set_xalign(GTK_LABEL (label), 1.0);
gtk_grid_attach(GTK_GRID(table1), label, 0, 1, 1, 1);
- oauth2_cust_client_secret_entry = gtk_entry_new ();
- gtk_widget_show (oauth2_cust_client_secret_entry);
- gtk_grid_attach(GTK_GRID(table1), oauth2_cust_client_secret_entry, 1, 1, 1, 1);
- gtk_widget_set_hexpand(oauth2_cust_client_secret_entry, TRUE);
- gtk_widget_set_halign(oauth2_cust_client_secret_entry, GTK_ALIGN_FILL);
+ oauth2_client_secret_entry = gtk_entry_new ();
+ gtk_widget_show (oauth2_client_secret_entry);
+ gtk_grid_attach(GTK_GRID(table1), oauth2_client_secret_entry, 1, 1, 1, 1);
+ gtk_widget_set_hexpand(oauth2_client_secret_entry, TRUE);
+ gtk_widget_set_halign(oauth2_client_secret_entry, GTK_ALIGN_FILL);
hbox_spc = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
gtk_widget_show (hbox_spc);
gtk_box_pack_start (GTK_BOX (hbox), hbox_spc, FALSE, FALSE, 0);
//gtk_widget_set_size_request (hbox_spc, 12, -1);
- SET_TOGGLE_SENSITIVITY (oauth2_customid_checkbtn, vbox2);
-
hbox_spc = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
gtk_widget_show (hbox_spc);
gtk_box_pack_start (GTK_BOX (vbox2), hbox_spc, FALSE, FALSE, 0);
@@ -2356,9 +2345,8 @@ static void oauth2_create_widget_func(PrefsPage * _page,
page->oauth2_auth_optmenu = oauth2_auth_optmenu;
page->protocol_optmenu = (gpointer)protocol_optmenu;
page->oauth2_authorise_btn = oauth2_authorise_btn;
- page->oauth2_customid_checkbtn = oauth2_customid_checkbtn;
- page->oauth2_cust_client_id_entry = oauth2_cust_client_id_entry;
- page->oauth2_cust_client_secret_entry = oauth2_cust_client_secret_entry;
+ page->oauth2_client_id_entry = oauth2_client_id_entry;
+ page->oauth2_client_secret_entry = oauth2_client_secret_entry;
page->vbox = vbox1;
page->page.widget = vbox1;
page->oauth2_sensitive = vbox3;
@@ -5105,8 +5093,8 @@ static void prefs_account_oauth2_copy_url(GtkButton *button, gpointer data)
service = combobox_get_active_data(GTK_COMBO_BOX(optmenu));
- if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(oauth2_page.oauth2_customid_checkbtn)) == TRUE)
- custom_client_id = gtk_entry_get_text ((GtkEntry *)oauth2_page.oauth2_cust_client_id_entry);
+
+ custom_client_id = gtk_entry_get_text((GtkEntry *)oauth2_page.oauth2_client_id_entry);
oauth2_authorisation_url(service, &url, custom_client_id);
@@ -5138,13 +5126,13 @@ static void prefs_account_oauth2_obtain_tokens(GtkButton *button, gpointer data)
oauth2_init (OAUTH2Data);
- if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(oauth2_page.oauth2_customid_checkbtn)) == TRUE){
- OAUTH2Data->custom_client_secret =
- g_strdup(gtk_entry_get_text ((GtkEntry *)oauth2_page.oauth2_cust_client_secret_entry));
- OAUTH2Data->custom_client_id =
- g_strdup(gtk_entry_get_text ((GtkEntry *)oauth2_page.oauth2_cust_client_id_entry));
- }
+ OAUTH2Data->custom_client_secret =
+ g_strdup(gtk_entry_get_text((GtkEntry *)oauth2_page.oauth2_client_secret_entry));
+ OAUTH2Data->custom_client_id =
+ g_strdup(gtk_entry_get_text((GtkEntry *)oauth2_page.oauth2_client_id_entry));
+
+
service = combobox_get_active_data(GTK_COMBO_BOX(optmenu));
ret = oauth2_obtain_tokens (service, OAUTH2Data, trim_text);
diff --git a/src/prefs_account.h b/src/prefs_account.h
index 3d6266760..cad95a882 100644
--- a/src/prefs_account.h
+++ b/src/prefs_account.h
@@ -140,9 +140,8 @@ struct _PrefsAccount
gint oauth2_provider;
gint oauth2_date;
gchar *oauth2_authcode;
- gboolean oauth2_use_custom_id;
- gchar *oauth2_cust_client_id;
- gchar *oauth2_cust_client_secret;
+ gchar *oauth2_client_id;
+ gchar *oauth2_client_secret;
/* Compose */
SigType sig_type;
-----------------------------------------------------------------------
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list