GData plugin: Require libgdata at least 0.17.2
authorHolger Berndt <hb@claws-mail.org>
Tue, 3 Jan 2017 10:20:11 +0000 (11:20 +0100)
committerHolger Berndt <hb@claws-mail.org>
Tue, 3 Jan 2017 10:20:11 +0000 (11:20 +0100)
Version 0.17.2 is required for auth token save/restore accross restarts.
Without this functionality, the plugin has such bad usability, it's not
worth maintaining. This also fixes the previous compile-error when only
0.17.1 was present.

configure.ac
src/plugins/gdata/cm_gdata_contacts.c

index 9e031c81f63e2071f59b0b3c6b04f86ce48819b3..0042734bafa6775e433399a889a44afaa9e00e51 100644 (file)
@@ -1149,7 +1149,7 @@ AC_CHECK_LIB([archive], [archive_read_new],
                       )
 
 dnl libgdata *******************************************************************
                       )
 
 dnl libgdata *******************************************************************
-PKG_CHECK_MODULES(GDATA, libgdata >= 0.17.1, HAVE_GDATA=yes, HAVE_GDATA=no)
+PKG_CHECK_MODULES(GDATA, libgdata >= 0.17.2, HAVE_GDATA=yes, HAVE_GDATA=no)
 AC_SUBST(GDATA_CFLAGS)
 AC_SUBST(GDATA_LIBS)
 
 AC_SUBST(GDATA_CFLAGS)
 AC_SUBST(GDATA_LIBS)
 
index 5f527c76dce0e27a644d70998b7330bee1b8de57..342b27787957990db0e03f9704424ec85abd0549 100644 (file)
@@ -485,7 +485,6 @@ static void cm_gdata_interactive_auth()
 }
 
 
 }
 
 
-#if GDATA_CHECK_VERSION(0,17,2)
 static void cm_gdata_refresh_ready(GDataOAuth2Authorizer *auth, GAsyncResult *res, gpointer data)
 {
   GError *error = NULL;
 static void cm_gdata_refresh_ready(GDataOAuth2Authorizer *auth, GAsyncResult *res, gpointer data)
 {
   GError *error = NULL;
@@ -510,7 +509,6 @@ static void cm_gdata_refresh_ready(GDataOAuth2Authorizer *auth, GAsyncResult *re
 
   query_after_auth();
 }
 
   query_after_auth();
 }
-#endif
 
 
 /* returns allocated string which must be freed */
 
 
 /* returns allocated string which must be freed */
@@ -570,7 +568,6 @@ static void query()
   }
   else if(!gdata_service_is_authorized(GDATA_SERVICE(service)))
   {
   }
   else if(!gdata_service_is_authorized(GDATA_SERVICE(service)))
   {
-#if GDATA_CHECK_VERSION(0,17,2)
     /* Try to restore from saved refresh token.*/
     if((token = passwd_store_get(PWS_PLUGIN, "GData", GDATA_TOKEN_PWD_STRING)) != NULL)
     {
     /* Try to restore from saved refresh token.*/
     if((token = passwd_store_get(PWS_PLUGIN, "GData", GDATA_TOKEN_PWD_STRING)) != NULL)
     {
@@ -584,9 +581,6 @@ static void query()
     {
       cm_gdata_interactive_auth();
     }
     {
       cm_gdata_interactive_auth();
     }
-#else
-    cm_gdata_interactive_auth();
-#endif
   }
   else
   {
   }
   else
   {
@@ -652,7 +646,6 @@ void cm_gdata_contacts_done(void)
 
   if(authorizer)
   {
 
   if(authorizer)
   {
-#if GDATA_CHECK_VERSION(0,17,2)
     /* store refresh token */
     pass = gdata_oauth2_authorizer_dup_refresh_token(authorizer);
     passwd_store_set(PWS_PLUGIN, "GData", GDATA_TOKEN_PWD_STRING, pass, FALSE);
     /* store refresh token */
     pass = gdata_oauth2_authorizer_dup_refresh_token(authorizer);
     passwd_store_set(PWS_PLUGIN, "GData", GDATA_TOKEN_PWD_STRING, pass, FALSE);
@@ -661,7 +654,6 @@ void cm_gdata_contacts_done(void)
       g_free(pass);
     }
     passwd_store_write_config();
       g_free(pass);
     }
     passwd_store_write_config();
-#endif
 
     g_object_unref(G_OBJECT(authorizer));
     authorizer = NULL;
 
     g_object_unref(G_OBJECT(authorizer));
     authorizer = NULL;