[evolution-data-server] Bug 699024 - [google/yahoo] Don't override username



commit 49da63819f2c4da465758210fea325f6efa1e7b6
Author: Matthew Barnes <mbarnes redhat com>
Date:   Mon May 6 10:02:41 2013 -0400

    Bug 699024 - [google/yahoo] Don't override username
    
    When mail child sources are added to a google or yahoo collection, avoid
    overriding an existing user name setting.  The IMAP or (especially) SMTP
    configuration may have been modified to use a non-Google/Yahoo! server.

 modules/google-backend/module-google-backend.c |   19 ++++++++++++++-----
 modules/yahoo-backend/module-yahoo-backend.c   |   19 ++++++++++++++-----
 2 files changed, 28 insertions(+), 10 deletions(-)
---
diff --git a/modules/google-backend/module-google-backend.c b/modules/google-backend/module-google-backend.c
index 594e813..d5684bb 100644
--- a/modules/google-backend/module-google-backend.c
+++ b/modules/google-backend/module-google-backend.c
@@ -313,19 +313,28 @@ google_backend_child_added (ECollectionBackend *backend,
        if (is_mail && e_source_has_extension (child_source, extension_name)) {
                ESourceAuthentication *auth_child_extension;
                ESourceCollection *collection_extension;
+               const gchar *collection_identity;
+               const gchar *auth_child_user;
 
                extension_name = E_SOURCE_EXTENSION_COLLECTION;
                collection_extension = e_source_get_extension (
                        collection_source, extension_name);
+               collection_identity = e_source_collection_get_identity (
+                       collection_extension);
 
                extension_name = E_SOURCE_EXTENSION_AUTHENTICATION;
                auth_child_extension = e_source_get_extension (
                        child_source, extension_name);
-
-               g_object_bind_property (
-                       collection_extension, "identity",
-                       auth_child_extension, "user",
-                       G_BINDING_SYNC_CREATE);
+               auth_child_user = e_source_authentication_get_user (
+                       auth_child_extension);
+
+               /* XXX Do not override an existing user name setting.
+                *     The IMAP or (especially) SMTP configuration may
+                *     have been modified to use a non-Google server. */
+               if (auth_child_user == NULL)
+                       e_source_authentication_set_user (
+                               auth_child_extension,
+                               collection_identity);
        }
 
        /* Keep the contacts authentication method up-to-date.
diff --git a/modules/yahoo-backend/module-yahoo-backend.c b/modules/yahoo-backend/module-yahoo-backend.c
index a6fd4e8..4f53516 100644
--- a/modules/yahoo-backend/module-yahoo-backend.c
+++ b/modules/yahoo-backend/module-yahoo-backend.c
@@ -308,19 +308,28 @@ yahoo_backend_child_added (ECollectionBackend *backend,
        if (is_mail && e_source_has_extension (child_source, extension_name)) {
                ESourceAuthentication *auth_child_extension;
                ESourceCollection *collection_extension;
+               const gchar *collection_identity;
+               const gchar *auth_child_user;
 
                extension_name = E_SOURCE_EXTENSION_COLLECTION;
                collection_extension = e_source_get_extension (
                        collection_source, extension_name);
+               collection_identity = e_source_collection_get_identity (
+                       collection_extension);
 
                extension_name = E_SOURCE_EXTENSION_AUTHENTICATION;
                auth_child_extension = e_source_get_extension (
                        child_source, extension_name);
-
-               g_object_bind_property (
-                       collection_extension, "identity",
-                       auth_child_extension, "user",
-                       G_BINDING_SYNC_CREATE);
+               auth_child_user = e_source_authentication_get_user (
+                       auth_child_extension);
+
+               /* XXX Do not override an existing user name setting.
+                *     The IMAP or (especially) SMTP configuration may
+                *     have been modified to use a non-Yahoo! server. */
+               if (auth_child_user == NULL)
+                       e_source_authentication_set_user (
+                               auth_child_extension,
+                               collection_identity);
        }
 
        /* Chain up to parent's child_added() method. */


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