From: Holger Berndt Date: Thu, 25 Jun 2015 22:08:33 +0000 (+0200) Subject: GData plugin: Make it possible to compile with libgdata 0.17.1 X-Git-Tag: 3.12.0~68 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=4e67def9e4c58a5f46e0ba01fa38264a9b8693f8 GData plugin: Make it possible to compile with libgdata 0.17.1 This version of libgdata does not yet support cold start, but has the advantage that it's already released. For an acceptable user experience, it's still required to have a more recent libgdata version. --- diff --git a/configure.ac b/configure.ac index 716a75308..d8e326014 100644 --- a/configure.ac +++ b/configure.ac @@ -1114,7 +1114,7 @@ AC_CHECK_LIB([archive], [archive_read_new], ) dnl libgdata ******************************************************************* -PKG_CHECK_MODULES(GDATA, libgdata >= 0.17.2, HAVE_GDATA=yes, HAVE_GDATA=no) +PKG_CHECK_MODULES(GDATA, libgdata >= 0.17.1, HAVE_GDATA=yes, HAVE_GDATA=no) AC_SUBST(GDATA_CFLAGS) AC_SUBST(GDATA_LIBS) diff --git a/src/plugins/gdata/cm_gdata_contacts.c b/src/plugins/gdata/cm_gdata_contacts.c index 00289d31e..b6f39ff3a 100644 --- a/src/plugins/gdata/cm_gdata_contacts.c +++ b/src/plugins/gdata/cm_gdata_contacts.c @@ -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;