GData plugin: Drop support for libgdata < 0.9
authorHolger Berndt <hb@claws-mail.org>
Sat, 30 May 2015 17:26:35 +0000 (19:26 +0200)
committerHolger Berndt <hb@claws-mail.org>
Sun, 14 Jun 2015 12:46:22 +0000 (14:46 +0200)
configure.ac
src/plugins/gdata/cm_gdata_contacts.c

index a14af50..811982f 100644 (file)
@@ -1114,21 +1114,9 @@ AC_CHECK_LIB([archive], [archive_read_new],
                       )
 
 dnl libgdata *******************************************************************
-dnl Plugin handles compatibility back to 0.6.4 so there are multiple checks.
-PKG_CHECK_MODULES(GDATA, libgdata >= 0.9.1, HAVE_GDATA=yes, HAVE_GDATA=no)
+PKG_CHECK_MODULES(GDATA, libgdata >= 0.17.1, HAVE_GDATA=yes, HAVE_GDATA=no)
 if test x"$HAVE_GDATA" = xyes; then
-       AC_DEFINE(HAVE_GDATA_VERSION_0_9_1, 1, [at least version 0.9.1 of libgdata is available])
-       AC_DEFINE(HAVE_GDATA_VERSION_0_9, 1, [at least version 0.9 of libgdata is available])
-else
-       PKG_CHECK_MODULES(GDATA, libgdata >= 0.9, HAVE_GDATA=yes, HAVE_GDATA=no)
-fi
-if test x"$HAVE_GDATA" = xyes; then
-       AC_DEFINE(HAVE_GDATA_VERSION_0_9, 1, [at least version 0.9 of libgdata is available])
-else
-       PKG_CHECK_MODULES(GDATA, libgdata >= 0.6.4, HAVE_GDATA=yes, HAVE_GDATA=no)
-fi
-if test x"$HAVE_GDATA" = xyes; then
-       AC_DEFINE(CM_GDATA_CLIENT_ID, ["Claws Mail GData plugin"], [client id])
+   AC_DEFINE(CM_GDATA_CLIENT_ID, ["Claws Mail GData plugin"], [client id])
 fi
 AC_SUBST(GDATA_CFLAGS)
 AC_SUBST(GDATA_LIBS)
index adc4400..8a57198 100644 (file)
@@ -235,15 +235,11 @@ static void query_after_auth(GDataContactsService *service)
   gdata_contacts_query_set_group(query, contacts_group_id);
   gdata_query_set_max_results(GDATA_QUERY(query), cm_gdata_config.max_num_results);
   gdata_contacts_service_query_contacts_async(service, GDATA_QUERY(query), NULL, NULL, NULL,
-#ifdef HAVE_GDATA_VERSION_0_9_1
-  NULL,
-#endif
-  (GAsyncReadyCallback)cm_gdata_query_contacts_ready, NULL);
+  NULL, (GAsyncReadyCallback)cm_gdata_query_contacts_ready, NULL);
 
   g_object_unref(query);
 }
 
-#ifdef HAVE_GDATA_VERSION_0_9_1
 static void cm_gdata_query_groups_ready(GDataContactsService *service, GAsyncResult *res, gpointer data)
 {
   GDataFeed *feed;
@@ -295,23 +291,17 @@ static void cm_gdata_query_groups_ready(GDataContactsService *service, GAsyncRes
 
   query_after_auth(service);
 }
-#endif
 
-#ifdef HAVE_GDATA_VERSION_0_9
 static void query_for_contacts_group_id(GDataClientLoginAuthorizer *authorizer)
 {
   GDataContactsService *service;
-#ifdef HAVE_GDATA_VERSION_0_9_1
 
   log_message(LOG_PROTOCOL, _("GData plugin: Starting async groups query\n"));
 
   service = gdata_contacts_service_new(GDATA_AUTHORIZER(authorizer));
   gdata_contacts_service_query_groups_async(service, NULL, NULL, NULL, NULL, NULL,
       (GAsyncReadyCallback)cm_gdata_query_groups_ready, NULL);
-#else
-  service = gdata_contacts_service_new(GDATA_AUTHORIZER(authorizer));
-  query_after_auth(service);
-#endif
+
   g_object_unref(service);
 }
 
@@ -340,32 +330,11 @@ static void cm_gdata_auth_ready(GDataClientLoginAuthorizer *authorizer, GAsyncRe
     g_object_unref(service);
   }
 }
-#else
-static void cm_gdata_auth_ready(GDataContactsService *service, GAsyncResult *res, gpointer data)
-{
-  GError *error = NULL;
-
-  if(!gdata_service_authenticate_finish(GDATA_SERVICE(service), res, &error))
-  {
-    log_error(LOG_PROTOCOL, _("GData plugin: Authentication error: %s\n"), error->message);
-    g_error_free(error);
-    cm_gdata_contacts_query_running = FALSE;
-    return;
-  }
-
-  log_message(LOG_PROTOCOL, _("GData plugin: Authenticated\n"));
 
-  query_after_auth(service);
-}
-#endif
 static void query()
 {
 
-#ifdef HAVE_GDATA_VERSION_0_9
   GDataClientLoginAuthorizer *authorizer;
-#else
-  GDataContactsService *service;
-#endif
 
   if(cm_gdata_contacts_query_running)
   {
@@ -375,24 +344,11 @@ static void query()
 
   log_message(LOG_PROTOCOL, _("GData plugin: Starting async authentication\n"));
 
-#ifdef HAVE_GDATA_VERSION_0_9
   authorizer = gdata_client_login_authorizer_new(CM_GDATA_CLIENT_ID, GDATA_TYPE_CONTACTS_SERVICE);
   gdata_client_login_authorizer_authenticate_async(authorizer, cm_gdata_config.username, cm_gdata_config.password, NULL, (GAsyncReadyCallback)cm_gdata_auth_ready, NULL);
   cm_gdata_contacts_query_running = TRUE;
-#else
-  service = gdata_contacts_service_new(CM_GDATA_CLIENT_ID);
-  cm_gdata_contacts_query_running = TRUE;
-  gdata_service_authenticate_async(GDATA_SERVICE(service), cm_gdata_config.username, cm_gdata_config.password, NULL,
-      (GAsyncReadyCallback)cm_gdata_auth_ready, NULL);
-#endif
-
 
-#ifdef HAVE_GDATA_VERSION_0_9
   g_object_unref(authorizer);
-#else
-  g_object_unref(service);
-#endif
-
 }