From 434a8fe8e558217ccf5f632e66d0a813d0882449 Mon Sep 17 00:00:00 2001 From: Fahim Salam Chowdhury Date: Tue, 26 Jul 2022 14:09:52 +0600 Subject: [PATCH] 5863-Add_missing_default_identity_name issue: https://gitlab.e.foundation/e/backlog/-/issues/5863 For autmated accounts loaded from accountManager, default identity was missing the idenetity name. As a result settings export are failing. In this commit, the default identity name is set to email id. For backword compatibility, checked identity name on export stage; if missing, set to email address. --- .../main/java/com/fsck/k9/preferences/SettingsExporter.kt | 6 +++++- .../activity/setup/accountmanager/EeloAccountCreator.java | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/core/src/main/java/com/fsck/k9/preferences/SettingsExporter.kt b/app/core/src/main/java/com/fsck/k9/preferences/SettingsExporter.kt index 08bc5bbefc..b7cd41f00f 100644 --- a/app/core/src/main/java/com/fsck/k9/preferences/SettingsExporter.kt +++ b/app/core/src/main/java/com/fsck/k9/preferences/SettingsExporter.kt @@ -325,7 +325,11 @@ class SettingsExporter( val suffix = ".$identity" // Write name belonging to the identity - val name = prefs[prefix + IDENTITY_NAME_KEY + suffix] as String? + var name = prefs[prefix + IDENTITY_NAME_KEY + suffix] as String? + if (name == null) { + name = prefs[prefix + IDENTITY_EMAIL_KEY + suffix] as String? + } + serializer.startTag(null, NAME_ELEMENT) serializer.text(name) serializer.endTag(null, NAME_ELEMENT) diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/accountmanager/EeloAccountCreator.java b/app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/accountmanager/EeloAccountCreator.java index 780f92a17d..e210ee0f1f 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/accountmanager/EeloAccountCreator.java +++ b/app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/accountmanager/EeloAccountCreator.java @@ -141,6 +141,7 @@ public class EeloAccountCreator { account.setChipColor(accountCreator.pickColor()); account.setEmail(emailId); account.setName(emailId); + account.setSenderName(emailId); ConnectionSettings connectionSettings = providersXmlDiscoveryDiscover(emailId); if (connectionSettings == null) { -- GitLab