[evolution-data-server] [Google/ownCloud backend] Discover WebDAV sources only if URL is set



commit faa7bc473c65b9d6f579149c5011909b42593d93
Author: Milan Crha <mcrha redhat com>
Date:   Wed May 20 19:39:51 2015 +0200

    [Google/ownCloud backend] Discover WebDAV sources only if URL is set
    
    In case the GOA source extension doesn't have set the URL for the respective
    part, it doesn't make sense to discover sources in those empty URIs. That
    could even cause a crash in certain case.

 modules/google-backend/module-google-backend.c     |    2 +-
 modules/owncloud-backend/module-owncloud-backend.c |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/modules/google-backend/module-google-backend.c b/modules/google-backend/module-google-backend.c
index aca9688..c79ce63 100644
--- a/modules/google-backend/module-google-backend.c
+++ b/modules/google-backend/module-google-backend.c
@@ -357,7 +357,7 @@ google_backend_authenticate_sync (EBackend *backend,
 
        google_backend_calendar_update_auth_method (source);
 
-       if (e_source_collection_get_calendar_enabled (collection_extension) &&
+       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,
                credentials, out_certificate_pem, out_certificate_errors,
                &discovered_sources, NULL, cancellable, &local_error)) {
diff --git a/modules/owncloud-backend/module-owncloud-backend.c 
b/modules/owncloud-backend/module-owncloud-backend.c
index 68d7dfc..204188a 100644
--- a/modules/owncloud-backend/module-owncloud-backend.c
+++ b/modules/owncloud-backend/module-owncloud-backend.c
@@ -319,7 +319,7 @@ owncloud_backend_authenticate_sync (EBackend *backend,
        g_list_foreach (sources, owncloud_add_uid_to_hashtable, known_sources);
        g_list_free_full (sources, g_object_unref);
 
-       if (e_source_collection_get_calendar_enabled (collection_extension) &&
+       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,
                credentials, out_certificate_pem, out_certificate_errors,
                &discovered_sources, NULL, cancellable, &local_error)) {
@@ -348,6 +348,7 @@ owncloud_backend_authenticate_sync (EBackend *backend,
 
        /* Skip search in this URL, if the previous one returned also contacts - it's quite likely it did */
        if (!contacts_found && !local_error && e_source_collection_get_contacts_enabled 
(collection_extension) &&
+           e_source_goa_get_contacts_url (goa_extension) &&
            e_webdav_discover_sources_sync (source, e_source_goa_get_contacts_url (goa_extension), 
E_WEBDAV_DISCOVER_SUPPORTS_CONTACTS,
                credentials, out_certificate_pem, out_certificate_errors,
                &discovered_sources, NULL, cancellable, &local_error)) {


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