talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit b4ec5f3b2df7ff74a25369f05ce164c8ae94bfab
parent 1707a23f562534e9b9d2a092e28e451baf8acff2
Author: Colin Leroy <colin@colino.net>
Date:   Thu, 11 Feb 2016 11:28:07 +0100

GData: use new password API. Completely untested as I don't have the dependancies available to build!

Diffstat:
Msrc/plugins/gdata/cm_gdata_contacts.c | 8+++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/plugins/gdata/cm_gdata_contacts.c b/src/plugins/gdata/cm_gdata_contacts.c @@ -31,6 +31,7 @@ #include "addr_compl.h" #include "main.h" +#include "password.h" #include "prefs_common.h" #include "mainwindow.h" #include "common/log.h" @@ -553,8 +554,13 @@ static void query() /* Try to restore from saved refresh token.*/ if(cm_gdata_config.oauth2_refresh_token) { + gchar *token = password_decrypt(cm_gdata_config.oauth2_refresh_token, NULL); log_message(LOG_PROTOCOL, _("GData plugin: Trying to refresh authorization\n")); - gdata_oauth2_authorizer_set_refresh_token(authorizer, cm_gdata_config.oauth2_refresh_token); + gdata_oauth2_authorizer_set_refresh_token(authorizer, (token != NULL ? token : "")); + if (token != NULL) { + memset(token, 0, strlen(token)); + } + g_free(token); gdata_authorizer_refresh_authorization_async(GDATA_AUTHORIZER(authorizer), NULL, (GAsyncReadyCallback)cm_gdata_refresh_ready, NULL); } else