talons

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

commit 4e67def9e4c58a5f46e0ba01fa38264a9b8693f8
parent 016e2b04824b444aa8941544179b8fd801e83d67
Author: Holger Berndt <hb@claws-mail.org>
Date:   Fri, 26 Jun 2015 00:08:33 +0200

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.

Diffstat:
Mconfigure.ac | 2+-
Msrc/plugins/gdata/cm_gdata_contacts.c | 12++++++++++--
2 files changed, 11 insertions(+), 3 deletions(-)

diff --git 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 @@ -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;