Make GData plugin use the password store.
[claws.git] / src / plugins / gdata / gdata_plugin.c
index c001f99d4147831cf2a5f86dcc7d8b5801c75235..99303a19c764ebf83cf5d20e3eeb3ac42ecfd1da 100644 (file)
@@ -37,6 +37,7 @@
 #include "main.h"
 #include "mainwindow.h"
 #include "addr_compl.h"
+#include "passwordstore.h"
 
 #include "cm_gdata_contacts.h"
 #include "cm_gdata_prefs.h"
@@ -121,6 +122,13 @@ gint plugin_init(gchar **error)
   prefs_read_config(cm_gdata_param, "GDataPlugin", rcpath, NULL);
   g_free(rcpath);
 
+       /* If the refresh token is still stored in config, save it to
+        * password store. */
+       if(cm_gdata_config.oauth2_refresh_token != NULL) {
+               passwd_store_set(PWS_PLUGIN, "GData", GDATA_TOKEN_PWD_STRING,
+                               cm_gdata_config.oauth2_refresh_token, FALSE);
+       }
+
   cm_gdata_prefs_init();
 
   debug_print("GData plugin loaded\n");
@@ -181,11 +189,6 @@ const gchar *plugin_version(void)
   return VERSION;
 }
 
-void plugin_master_passphrase_change (const gchar *oldp, const gchar *newp)
-{
-       cm_gdata_prefs_master_passphrase_change(oldp, newp);
-}
-
 struct PluginFeature *plugin_provides(void)
 {
   static struct PluginFeature features[] =