Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1a74420e authored by cketti's avatar cketti
Browse files

Extract method to construct account display name

parent 25d977a8
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -134,12 +134,8 @@ public class SettingsImporter {
            // will not be null.
            if (imported.accounts != null) {
                for (ImportedAccount account : imported.accounts.values()) {
                    String name = account.name;
                    if (TextUtils.isEmpty(name) && account.identities != null && account.identities.size() > 0){
                        name = account.identities.get(0).email;
                    }

                    accounts.add(new AccountDescription(name, account.uuid));
                    String accountName = getAccountDisplayName(account);
                    accounts.add(new AccountDescription(accountName, account.uuid));
                }
            }

@@ -1098,6 +1094,14 @@ public class SettingsImporter {
        return folder;
    }

    private static String getAccountDisplayName(ImportedAccount account) {
        String name = account.name;
        if (TextUtils.isEmpty(name) && account.identities != null && account.identities.size() > 0){
            name = account.identities.get(0).email;
        }
        return name;
    }

    private static class ImportedServerSettings extends ServerSettings {
        private final ImportedServer mImportedServer;