summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2016-11-10 18:46:54 +0100
committerMilan Crha <mcrha@redhat.com>2016-11-10 18:46:54 +0100
commit9140b844dc4e08f92da598499b824a585cde6e1b (patch)
tree11e5348b42b9f3fa14f461ef06d5b9a1b6b00ae7 /src/modules
parent19ee3268378cf0a8c67d377c611d686ba5dc166c (diff)
downloadevolution-data-server-9140b844dc4e08f92da598499b824a585cde6e1b.tar.gz
Bug 774103 - GOA mail account doesn't inherit GoaMail::name
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/gnome-online-accounts/module-gnome-online-accounts.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/modules/gnome-online-accounts/module-gnome-online-accounts.c b/src/modules/gnome-online-accounts/module-gnome-online-accounts.c
index e662180d3..dd273054b 100644
--- a/src/modules/gnome-online-accounts/module-gnome-online-accounts.c
+++ b/src/modules/gnome-online-accounts/module-gnome-online-accounts.c
@@ -650,8 +650,8 @@ gnome_online_accounts_config_mail_identity (EGnomeOnlineAccounts *extension,
GoaObject *goa_object)
{
GoaMail *goa_mail;
- ESourceExtension *source_extension;
EServerSideSource *server_side_source;
+ ESourceMailIdentity *mail_identity;
ESourceMailSubmission *mail_submission;
ESourceMailComposition *mail_composition;
const gchar *extension_name;
@@ -663,11 +663,24 @@ gnome_online_accounts_config_mail_identity (EGnomeOnlineAccounts *extension,
return;
extension_name = E_SOURCE_EXTENSION_MAIL_IDENTITY;
- source_extension = e_source_get_extension (source, extension_name);
+ mail_identity = e_source_get_extension (source, extension_name);
+
+ tmp = e_source_mail_identity_dup_address (mail_identity);
+ if (!tmp || !*tmp) {
+ /* Set the Name only if the mail is not set yet, because users can change the Name,
+ even to an empty string, but the email is fixed with the one from GoaMail.
+ */
+ g_free (tmp);
+
+ tmp = goa_mail_dup_name (goa_mail);
+ if (tmp && *tmp)
+ e_source_mail_identity_set_name (mail_identity, tmp);
+ }
+ g_free (tmp);
e_binding_bind_property (
goa_mail, "email-address",
- source_extension, "address",
+ mail_identity, "address",
G_BINDING_SYNC_CREATE);
g_object_unref (goa_mail);