[evolution-data-server/gnome-40] EWebDAVCollectionBackend: Preset also auth method on the new child



commit ba091ecf5be83040e37bc29118f203566e8a58da
Author: Milan Crha <mcrha redhat com>
Date:   Fri Mar 19 09:33:50 2021 +0100

    EWebDAVCollectionBackend: Preset also auth method on the new child
    
    The new child inherits the SSL trust setting, but it should inherit
    also the authentication method, thus it can use the collection
    source as the authentication source, thus sharing the credentials.
    As it's done only for the new children, they can still have this
    overwritten later.

 src/libebackend/e-webdav-collection-backend.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)
---
diff --git a/src/libebackend/e-webdav-collection-backend.c b/src/libebackend/e-webdav-collection-backend.c
index f666e60a1..b99f17504 100644
--- a/src/libebackend/e-webdav-collection-backend.c
+++ b/src/libebackend/e-webdav-collection-backend.c
@@ -163,15 +163,16 @@ webdav_collection_add_found_source (ECollectionBackend *collection,
        }
 
        if (source) {
-               ESource *master_source;
+               ESource *collection_source;
                ESourceCollection *collection_extension;
-               ESourceAuthentication *child_auth;
+               ESourceAuthentication *collection_auth, *child_auth;
                ESourceResource *resource;
-               ESourceWebdav *master_webdav, *child_webdav;
+               ESourceWebdav *collection_webdav, *child_webdav;
 
-               master_source = e_backend_get_source (E_BACKEND (collection));
-               master_webdav = e_source_get_extension (master_source, E_SOURCE_EXTENSION_WEBDAV_BACKEND);
-               collection_extension = e_source_get_extension (master_source, E_SOURCE_EXTENSION_COLLECTION);
+               collection_source = e_backend_get_source (E_BACKEND (collection));
+               collection_auth = e_source_get_extension (collection_source, 
E_SOURCE_EXTENSION_AUTHENTICATION);
+               collection_webdav = e_source_get_extension (collection_source, 
E_SOURCE_EXTENSION_WEBDAV_BACKEND);
+               collection_extension = e_source_get_extension (collection_source, 
E_SOURCE_EXTENSION_COLLECTION);
                child_auth = e_source_get_extension (source, E_SOURCE_EXTENSION_AUTHENTICATION);
                child_webdav = e_source_get_extension (source, E_SOURCE_EXTENSION_WEBDAV_BACKEND);
                resource = e_source_get_extension (source, E_SOURCE_EXTENSION_RESOURCE);
@@ -183,8 +184,9 @@ webdav_collection_add_found_source (ECollectionBackend *collection,
                e_source_resource_set_identity (resource, identity);
 
                if (is_new) {
-                       /* inherit ssl trust options */
-                       e_source_webdav_set_ssl_trust (child_webdav, e_source_webdav_get_ssl_trust 
(master_webdav));
+                       /* inherit common settings */
+                       e_source_webdav_set_ssl_trust (child_webdav, e_source_webdav_get_ssl_trust 
(collection_webdav));
+                       e_source_authentication_set_method (child_auth, e_source_authentication_get_method 
(collection_auth));
                }
        }
 


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