Make sure account display name is never null

This commit is contained in:
cketti 2018-07-23 12:54:09 +02:00
parent b35074315c
commit 91164e04ed
4 changed files with 7 additions and 3 deletions

View file

@ -776,6 +776,10 @@ public class Account implements BaseAccount, StoreConfig {
this.description = description;
}
public String getDisplayName() {
return description != null ? description : getEmail();
}
public synchronized String getName() {
return identities.get(0).getName();
}

View file

@ -27,7 +27,7 @@ class ImapBackendFactory(
override val transportUriPrefix = "smtp"
override fun createBackend(account: Account): Backend {
val accountName = account.description
val accountName = account.displayName
val backendStorage = K9BackendStorage(preferences, account, account.localStore)
val imapStore = createImapStore(account)
val smtpTransport = createSmtpTransport(account)

View file

@ -21,7 +21,7 @@ class Pop3BackendFactory(private val context: Context, private val preferences:
override val transportUriPrefix = "smtp"
override fun createBackend(account: Account): Backend {
val accountName = account.description
val accountName = account.displayName
val backendStorage = K9BackendStorage(preferences, account, account.localStore)
val pop3Store = createPop3Store(account)
val smtpTransport = createSmtpTransport(account)

View file

@ -17,7 +17,7 @@ class WebDavBackendFactory(private val preferences: Preferences) : BackendFactor
override val transportUriPrefix = "webdav"
override fun createBackend(account: Account): Backend {
val accountName = account.description
val accountName = account.displayName
val backendStorage = K9BackendStorage(preferences, account, account.localStore)
val serverSettings = WebDavStoreUriDecoder.decode(account.storeUri)
val webDavStore = createWebDavStore(serverSettings, account)