GData plugin: Make it possible to compile with libgdata 0.17.1
[claws.git] / src / plugins / gdata / cm_gdata_contacts.c
index 00289d31e1a1fd3a1a9c17e10029fc195cdd1304..b6f39ff3a4c35c0095a0a77849a23a6f7dbafa86 100644 (file)
@@ -480,6 +480,7 @@ 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;
@@ -502,6 +503,8 @@ static void cm_gdata_refresh_ready(GDataOAuth2Authorizer *auth, GAsyncResult *re
 
   query_after_auth();
 }
+#endif
+
 
 /* returns allocated string which must be freed */
 static guchar* decode(const gchar *in)
@@ -514,6 +517,7 @@ static guchar* decode(const gchar *in)
   return tmp;
 }
 
+
 static void query()
 {
   if(cm_gdata_contacts_query_running)
@@ -524,8 +528,6 @@ static void query()
 
   if(!authorizer)
   {
-    GError *error = NULL;
-
     gchar *c1 = decode(GDATA_C1);
     gchar *c2 = decode(GDATA_C2);
     gchar *c3 = decode(GDATA_C3);
@@ -546,6 +548,7 @@ static void query()
 
   if(!gdata_service_is_authorized(GDATA_SERVICE(service)))
   {
+#if GDATA_CHECK_VERSION(0,17,2)
     /* Try to restore from saved refresh token.*/
     if(cm_gdata_config.oauth2_refresh_token)
     {
@@ -557,6 +560,9 @@ static void query()
     {
       cm_gdata_interactive_auth();
     }
+#else
+    cm_gdata_interactive_auth();
+#endif
   }
   else
   {
@@ -620,8 +626,10 @@ void cm_gdata_contacts_done(void)
 
   if(authorizer)
   {
+#if GDATA_CHECK_VERSION(0,17,2)
     /* store refresh token */
     cm_gdata_config.oauth2_refresh_token = gdata_oauth2_authorizer_dup_refresh_token(authorizer);
+#endif
 
     g_object_unref(G_OBJECT(authorizer));
     authorizer = NULL;