Fix code to create Outbox folder after settings import
@@ -285,14 +285,16 @@ public class SettingsImporter {
LocalStoreProvider localStoreProvider = DI.get(LocalStoreProvider.class);
// create missing OUTBOX folders
- for (Account account: preferences.getAccounts()) {
- if (accountUuids.contains(account.getUuid())) {
+ for (AccountDescriptionPair importedAccount : importedAccounts) {
+ String accountUuid = importedAccount.imported.uuid;
+ Account account = preferences.getAccount(accountUuid);
LocalStore localStore = localStoreProvider.getInstance(account);
+
long outboxFolderId = localStore.createLocalFolder(Account.OUTBOX_NAME, FolderType.OUTBOX);
account.setOutboxFolderId(outboxFolderId);
+
preferences.saveAccount(account);
}
- }
K9.loadPrefs(preferences);
Core.setServicesEnabled(context);
