[evolution-data-server/gnome-3-16] Bug 750148 - GMail account with calendar/contacts broken the next start



commit 9abd6676246b47084b121afe2da7ffc192623a80
Author: Milan Crha <mcrha redhat com>
Date:   Fri Jun 12 10:09:51 2015 +0200

    Bug 750148 - GMail account with calendar/contacts broken the next start

 modules/google-backend/module-google-backend.c |   15 +++++++++++----
 modules/owncloud-backend/owncloud-utils.c      |    5 +++++
 2 files changed, 16 insertions(+), 4 deletions(-)
---
diff --git a/modules/google-backend/module-google-backend.c b/modules/google-backend/module-google-backend.c
index 012af14..1c8477c 100644
--- a/modules/google-backend/module-google-backend.c
+++ b/modules/google-backend/module-google-backend.c
@@ -327,13 +327,14 @@ google_backend_authenticate_sync (EBackend *backend,
 {
        ECollectionBackend *collection = E_COLLECTION_BACKEND (backend);
        ESourceCollection *collection_extension;
-       ESourceGoa *goa_extension;
+       ESourceGoa *goa_extension = NULL;
        ESource *source;
        ESourceAuthenticationResult result;
        GHashTable *known_sources;
        GList *sources;
        GSList *discovered_sources = NULL;
        ENamedParameters *credentials_copy = NULL;
+       const gchar *calendar_url;
        gboolean any_success = FALSE;
        GError *local_error = NULL;
 
@@ -341,7 +342,8 @@ google_backend_authenticate_sync (EBackend *backend,
 
        source = e_backend_get_source (backend);
        collection_extension = e_source_get_extension (source, E_SOURCE_EXTENSION_COLLECTION);
-       goa_extension = e_source_get_extension (source, E_SOURCE_EXTENSION_GOA);
+       if (e_source_has_extension (source, E_SOURCE_EXTENSION_GOA))
+               goa_extension = e_source_get_extension (source, E_SOURCE_EXTENSION_GOA);
 
        g_return_val_if_fail (e_source_collection_get_calendar_enabled (collection_extension) ||
                e_source_collection_get_contacts_enabled (collection_extension), 
E_SOURCE_AUTHENTICATION_ERROR);
@@ -361,8 +363,13 @@ google_backend_authenticate_sync (EBackend *backend,
 
        google_backend_calendar_update_auth_method (source);
 
-       if (e_source_collection_get_calendar_enabled (collection_extension) && e_source_goa_get_calendar_url 
(goa_extension) &&
-           e_webdav_discover_sources_sync (source, e_source_goa_get_calendar_url (goa_extension), 
E_WEBDAV_DISCOVER_SUPPORTS_NONE,
+       if (goa_extension)
+               calendar_url = e_source_goa_get_calendar_url (goa_extension);
+       else
+               calendar_url = "https://www.google.com/calendar/dav/";;
+
+       if (e_source_collection_get_calendar_enabled (collection_extension) && calendar_url &&
+           e_webdav_discover_sources_sync (source, calendar_url, E_WEBDAV_DISCOVER_SUPPORTS_NONE,
                credentials, out_certificate_pem, out_certificate_errors,
                &discovered_sources, NULL, cancellable, &local_error)) {
                EWebDAVDiscoverSupports source_types[] = {
diff --git a/modules/owncloud-backend/owncloud-utils.c b/modules/owncloud-backend/owncloud-utils.c
index 538bc8b..64538e8 100644
--- a/modules/owncloud-backend/owncloud-utils.c
+++ b/modules/owncloud-backend/owncloud-utils.c
@@ -516,6 +516,11 @@ owncloud_utils_search_server (ECollectionBackend *collection,
 
        source = e_backend_get_source (E_BACKEND (collection));
        collection_extension = e_source_get_extension (source, E_SOURCE_EXTENSION_COLLECTION);
+
+       /* Ignore the request for non-GOA ownCloud sources */
+       if (!e_source_has_extension (source, E_SOURCE_EXTENSION_GOA))
+               return FALSE;
+
        goa_extension = e_source_get_extension (source, E_SOURCE_EXTENSION_GOA);
 
        username = e_source_collection_dup_identity (collection_extension);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]