From: Matthew Barnes Date: Mon, 6 May 2013 14:02:41 +0000 (-0400) Subject: Bug 699024 - [google/yahoo] Don't override username X-Git-Tag: submit/tizen/20140917.130222~1001 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=49da63819f2c4da465758210fea325f6efa1e7b6;p=platform%2Fupstream%2Fevolution-data-server.git 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. --- 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. */